Edward
Members-
Posts
1115 -
Joined
-
Last visited
-
Days Won
27
Everything posted by Edward
-
Header
Edward replied to Paul_Blackpool's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
You missed the question mark in the php opening tag <?php <?php echo $page_title; ?> -
Change the BASE_URI to this and see if it helps define ('BASE_URI', 'C:\xampp\htdocs\');
-
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.
-
Add_Print.Php
Edward replied to Edward's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
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. -
Add_Print.Php
Edward replied to Edward's topic in PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
Thanks Larry, that will make things much easier then i will work on the show image part for my practice site soon. -
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.
-
Input Type File Sticky
Edward replied to Edward's topic in PHP for the Web: Visual QuickStart Guide (4th Edition)
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. -
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?
-
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?
-
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.
-
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?
-
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.
-
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.
-
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');
-
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.
-
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.
-
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/
-
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>
-
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.
-
Works perfect on the iPad but on my sumsung galaxy note the CSS is incorrect.
-
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?
-
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.