tungsten Posted June 14, 2011 Share Posted June 14, 2011 I need some php help! I think it's a simple problem (something to do with my environment, maybe apache setup, is my guess), but the answer is escaping me. I'm trying to use a script for automatically generating galleries using these: Tutorials - http://scriptandstyle.com/automatically-generate-a-photo-gallery-from-a-directory-of-images http://davidwalsh.name/generate-photo-gallery My code - http://pastebin.com/S67hTczf Online syntax checker http://tools.sopili.net/php-syntax-check/ confirms that my php is valid. Issue - Firefox breaks the script in the first echo (line 75), at the call of href="',$images_dir.$file,'" - it breaks off at $images_dir.| and prints the rest of the script starting at |$file on the page. The last echo works, but the script calling it is still printed to screen. Examining the page source with firefox's source viewer shows the php as functioning up until the foreach statement (line 65), truncating the php at $index=> . I downloaded the example dir from the first tutorial, which comes with images css etc all set up, and it truncates in a similar way, spilling the remaining script onto the page. The fact that the given tutorial creates a similar issue leads me to conclude that my environment is incorrectly configured, but I don't know in what way. tungsten Quote Link to comment https://forums.phpfreaks.com/topic/239306-strange-newbie-problem-syntax-or-setup/ Share on other sites More sharing options...
tungsten Posted June 14, 2011 Author Share Posted June 14, 2011 Well I goofed that subject If somebody compassionate with mod rights want's to change the o to a p I'd be grateful. gotta use mah eyes more! Quote Link to comment https://forums.phpfreaks.com/topic/239306-strange-newbie-problem-syntax-or-setup/#findComment-1229387 Share on other sites More sharing options...
PFMaBiSmAd Posted June 14, 2011 Share Posted June 14, 2011 Php is a web server scripting language. What URL are you entering in your browser? It should be something like http://localhost/your_file_name.php Quote Link to comment https://forums.phpfreaks.com/topic/239306-strange-newbie-problem-syntax-or-setup/#findComment-1229390 Share on other sites More sharing options...
tungsten Posted June 14, 2011 Author Share Posted June 14, 2011 Php is a web server scripting language. What URL are you entering in your browser? It should be something like http://localhost/your_file_name.php I'm opening the file with a browser, so the path I'm using starts with "file:///" I think I've missed something crucial here; should I be using apache to virtually host the files? (note that I may be an idiot) If so I'll see if I can sort that out. Edit: I have since discovered that this is the case and am now continuing to configure my environment Quote Link to comment https://forums.phpfreaks.com/topic/239306-strange-newbie-problem-syntax-or-setup/#findComment-1229391 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.