Basically if you write over the “<!-- Add your site header here –>
HTML DESIGN-start” You will have no problems inserting your code. You have to use absolute addresses to include files in different directories (http://www.yourcode.cim/includes/yourcode.php). I thought that it was a faulty design until I tried to brute force it myself and saw where it ended up.
I don’t know if that will solve your header problem, but it should, all html and php will come after the header has already parsed.
Also renikdelan, the begining of your index.php file calls out to include(design.inc.php) twice, for some reason it will only work if this remains so. Make sure that you keep both of those lines.
You have to place all of your <style> code within the <<<__HTML_END and __HTML_END; area.
I have just copied whole code of page 2(preupload.php) of this tutorial, but didn’t get the same look as screenshot right below the code on page 2 (preupload.php) of tutorial. Secondly don’t understand what those codes meant “<<<__HTML_END"and”__HTML_END;", I have attached the code below, please let me know if I am wrong, this is the url of the tutorial :http://www.sitepoint.com/article/php-gallery-system-minutes/2, thanks bunch!!
Do you have a trouble for showing the upload form as the same as screen shot in the tutorial(preupload.php) that I mentioned? If you don’t, can you let me know how to understand the codes <<<__HTML_END"and"__HTML_END;". I don’t understand them. Do I need to create a header.php and footer.php individually to be able to display preupload.php correctly?
Excellent tutorial: can somebody tell me though, how do I alter the code so that regardless of the uploaded file type (as long as it is GD version compatible), the sytem creates and resizes the original image into a jpeg and creates the thumbnail as a gif??
you could have a form with so many feilds (say 20) for the user to upload there photos. then place these files into a temporay folder awaiting approval from you.
this will aquire a table in the database for listing new awaiting approvals.
doing it your way will take longer. the way above can also check the file size, type, width and height. this will help in the before uploading, then you can then check if the photo is then suitable either by a thumbnail or a full size view.
i personally prefer the changed example above, to me it makes it easy to understand and read. others will like the other method of using the html tags “<<<__HTML_END”, etc…
the problem with the method that i like using is you may have to do something like the code below to get the code to work, only if there’s an error message appearing in the web browser:
<option value="'.$row[0].'">'.$row[1].'</option>
as for the other question:
Do I need to create a header.php and footer.php individually to be able to display preupload.php correctly?
you will need to create a header.php and footer.php to display the top and bottom of each page.
the preupload.php goes inbetween the header and footer then placed into the index page through the web browser.
This is a great script no doubt. However, if we need to upload hundreds of photos, this may not be the most suitable one. I was looking for something that will allow me to do so. As a solution, I was thinking to help users to upload photos in a zip file which will then be unzipped and (images) resized in the server itself … any solution?
thanks.
Thanks so much. But I’ve got this error when I called it in browser:Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Inetpub\wwwroot\photoGallery\config.inc.php on line 2
Warning: mysql_select_db(): Access denied for user ‘ODBC’@‘localhost’ (using password: NO) in C:\Inetpub\wwwroot\photoGallery\config.inc.php on line 3
Warning: mysql_select_db(): A link to the server could not be established in C:\Inetpub\wwwroot\photoGallery\config.inc.php on line 3
Could not select database Here is the PHP code that I just copied it in page 1 making config.php file:
<?php
$mysql_link = mysql_connect('localhost', 'root', 'root');
mysql_select_db('myphotogallery') or die('Could not select database');
$images_dir = 'photos';
?>
Tried, still got this Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Inetpub\wwwroot\photoGallery\config.inc.php on line 2. Don’t know why this tutorial has so many unclear definition, that created so much confusion for people.
I was trying to connect to my local testing server on my local PC. And the problem is not Mysql Socket, it shows that the problem of config.inc.php file that this tutorial provided on the first page.
Warning: mysql_connect(): Client does not support authentication protocol requested by server; consider upgrading MySQL client in C:\Inetpub\wwwroot\photoGallery\config.inc.php on line 2
Fatal error: Call to undefined function: mysql_erro() in C:\Inetpub\wwwroot\photoGallery\config.inc.php on line 2
This is the config.inc.php file code:
<?php
$mysql_link = mysql_connect('localhost', 'root', 'root')or die ('I cannot connect to the database because:'.mysql_erro());
mysql_select_db('myphotogallery');
$images_dir = 'photos';
?>