Jump to content
Larry Ullman's Book Forums

Edward

Members
  • Posts

    1115
  • Joined

  • Last visited

  • Days Won

    27

Everything posted by Edward

  1. You missed the question mark in the php opening tag <?php <?php echo $page_title; ?>
  2. Change the BASE_URI to this and see if it helps define ('BASE_URI', 'C:\xampp\htdocs\');
  3. Edward

    Yii 2.0

    Thanks this blog post was very useful. I will go with what you are teaching, if Yii 1 does the job i may go with that, on the other hand if the Yii 2 has some good reason that we should dedicate our project it, i will hold on. I am working through your javascript book now, you have made everything easy as with your other books. Great book.
  4. Just post up the Show_image.php script in case others want to see the solution <?php # Script 19.8 - show_image.php // This pages retrieves and shows an image. // Flag variables: $image = FALSE; $name = (!empty($_GET['name'])) ? $_GET['name'] : 'print image'; // Check for an image value in the URL: if (isset($_GET['image']) && filter_var($_GET['image'], FILTER_VALIDATE_INT, array('min_range' => 1)) ) { // Full image path: $image = '../uploads/' . $_GET['image']; // Check that the image exists and is a file: if (!file_exists ($image) || (!is_file($image))) { $image = FALSE; } } // End of $_GET['image'] IF. // If there was a problem, use the default image: if (!$image) { $image = 'images/unavailable.png'; $name = 'unavailable.png'; } // Get the image information: $info = getimagesize($image); $fs = filesize($image); // Send the content information: header ("Content-Type: {$info['mime']}\n"); header ("Content-Disposition: inline; filename=\"$name\"\n"); header ("Content-Length: $fs\n"); // Send the file: readfile ($image); The getimagesize() function will determine the size of any given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondant HTTP content type.
  5. Thanks Larry, that will make things much easier then i will work on the show image part for my practice site soon.
  6. PG.618 Chap 19 It just occurred to me if multiple users uploading pictures and then they are renamed to have their own unique md5 name. We can't assume here that everyone would upload a jpeg, what about all the other picture formats, and if we save them as an md5 name, how would we know which type of picture format to load up? Anyone here have any experience with this situation.
  7. Thanks guys. I am going to leave this part in my site as normal upload for now. But later recode this part in using Javascript, i will use your idea Larry Storing the upload information for the picture's uploaded in a session. I see ebay an other sites just using regular html buttons to handle this, once you click them the file select box opens up, where you can pick your pictures. Then you will see a jquery progress bar loader working and the picture will be loaded inside a div for your view, you can then load up other pictures or delete them as you please. Using a html button works out better as then we don't have to deal with this sticky upload button problem.
  8. Edward

    Disable Css Tip

    You are lucky Rob, hey whats up with your Avatar, its plain white, did you set it like that or it is some kind of error?
  9. I do have a MacBook, 2 ipads and iphones, but for my main computer i have a HP with Windows 7. I just see most of the main companies using them but i wonder if they are following an image or is the Mac actually worth getting. To me is seems to be more of a marketing image than actually useful. That's why i debate myself over getting one, the apple image does seem to have a good effect at sucking you in and that's what they want right? But tell me Larry, if i had the cash to buy a Mac, would it be worth me doing so? Would it make my web development easier and if so in what ways? I think one of the features is more room on your desk?
  10. Edward

    Disable Css Tip

    Pro HTML5 and CSS3 Design Patterns, best of the CSS books i have. Most books only explain of the box model, but actually there are 6 different box models, so if you find your CSS is not working correctly with this book you can pinpoint the reason. From the books i am working on now JS and PHP this is the most complicated.
  11. I have read online that browser as a security issue block the input type file from being sticky, i tried to print back the value from $_FILES['upload']['name'] back into the value attribute of the input tag but it failed to work. Does anyone have any suggestions on what they would do in this complex situation?
  12. Thanks, every time i have an idea spring to mind i always put it up. That's the nice idea with having forum avatars they help to define the members image.
  13. Edward

    Disable Css Tip

    If you wish to disable a CSS rule for testing you can insert a 1 in front of it, for example: 1background-color:black This will disable the rule.
  14. How is the popularity of mac's in the US, is it worth investing in one, or could they fade out of business since the loss of Steve? To me it looks more of an image than an actual usage, and with regards to old DOS applications they are not compatible with Mac, one thing which i don't like about it. Means no Alone in the Dark or old favorites of our time.
  15. This part of code you are referring to does also include the activate.php script (highlighted in red) concatenated in the $body variable, that of which would be received by your email. If you don't have the email setup via your localhost or host you can just print out the body string with an echo statement to get the exact activate.php string, which you can then copy and paste into your browser to activate the account. // Send the email: $body = "Thank you for registering at <whatever site>. To activate your account, please click on this link:\n\n"; $body .= BASE_URL . 'activate.php?x=' . urlencode($e) . "&y=$a"; mail($trimmed['email'], 'Registration Confirmation', $body, 'From: admin@sitename.com');
  16. Ha, you won't be getting rid of me that easy. Maybe that will work out for someone else but i am still strong on going with Yii, those guys have years of experience back from the days of Prado framework.
  17. In that case it will be Yii 2 i will be learning then, so i want to keep on the same tracks. Every author and coder has their own opinions on how things should be done, i like what you have done so far so i would like to keep learning more. I have compared codeignitor to Yii and i thought there code was pretty basic in comparison, i like hardcore oop code, i feel that is the right style for me. I told you i done maths before, in order to get the highest marks we had to always simplify each equation or expression to its simplest form. So if i see the long winded procedural code by second nature i can see something is wrong.
  18. Yeah but, a couple of week ago he was saying Yii 2, so that's why i asked for the confirmation. If its Yii 1 that would be better as the version is already stable and we can start production now. Read Larry's reply in this post http://www.larryullman.com/forums/index.php?/topic/1559-yii-20/
  19. So you are no longer doing Yii 2? You are doing this for Yii 1 because it needs to be ready now? I see now that Zend are also trying to get a stable release of their version 2. I will be honest i wouldn't mind settling on Yii Version 1 as it looks easy to follow and i really like Alex M's cook book. I hope you will be doing version 1 Larry, do let me know? Check this out: yii/protected/views/layout/main.php <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="language" content="en" /> <!-- blueprint CSS framework --> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" /> <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" /> <![endif]--> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" /> <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" /> <title><?php echo CHtml::encode($this->pageTitle); ?></title> </head>
  20. When I talk about html5 I was talking about whether it would be placed in the yii header rather than traditional, I meant no more than that. Your going to be teaching something that no one can even use until there is a stable release which could be end of next year, I need some confidence about this framework otherwise I might as well use zend or codeignitor.
  21. Works perfect on the iPad but on my sumsung galaxy note the CSS is incorrect.
  22. I think you may be wrong there Yii 1 has CHTML helper functions so I think it does. If you don't use HTML with Yii what else could you use with it?
  23. I really like the new on the home page larryullman.com, its much clearer. But that picture of yours its a retouch right, your eyes are much lighter in the real life, blue or grey right? Just saw Jason Statham in Expendables 2 the other week ago.
×
×
  • Create New...