leest Posted January 9, 2008 Share Posted January 9, 2008 Hi, I have a link on my website that calls a download script and downloads an image in to my webpage. This works perfectly in php 4. I am currently converting my site from php4 to php 5 to allow me to use another hosting company and i am having trouble with passing information in the link to the downloads page. If i use this script un changed it doesn't display any errors just stops displaying the page at the point of the script. the script is: <img src="http://www.websitename/image_manager/download.php?id= [code=php:0]=$site_id [/code] the problem occurs when i try to change from the short method of writting the php tag to the normal version, with the short version the = sign changes to read along with the php tag and on the longer version it doesn't when the script is then run it displays the following error: "Parse error: syntax error, unexpected '=' in /public_html/search/search_results.php on line 428" if i remove the equals sign then it displays the page correctly but does not download the image. Any help or advice would be appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/ Share on other sites More sharing options...
kenrbnsn Posted January 9, 2008 Share Posted January 9, 2008 Please post your script again putting all of the code in question between tags and explain your problem again. Ken Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/#findComment-434612 Share on other sites More sharing options...
leest Posted January 9, 2008 Author Share Posted January 9, 2008 <img src="http://www.harrier-recruitment.com/image_manager/download.php?id==$site_id OK this code works fine in php4 and returns an image from a mysql database by passing the site_id to a download script through this link. However in php 5 it doesn't work. In the script i have used the short tag for php ie, just the less than and a question mark, when i add php to the tag, it stops the code from working. Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/#findComment-434619 Share on other sites More sharing options...
leest Posted January 9, 2008 Author Share Posted January 9, 2008 Not sure why but when i post the srcipt on here it removes the php tag from between the two = signs and from the end of the script. Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/#findComment-434623 Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 <img src="http://www.harrier-recruitment.com/image_manager/download.php?id=<?php echo $site_id ?> Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/#findComment-434630 Share on other sites More sharing options...
leest Posted January 9, 2008 Author Share Posted January 9, 2008 Thanks Iwill give it a try Leest Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/#findComment-434637 Share on other sites More sharing options...
revraz Posted January 9, 2008 Share Posted January 9, 2008 Need to put code in code tags. Not sure why but when i post the srcipt on here it removes the php tag from between the two = signs and from the end of the script. Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/#findComment-434638 Share on other sites More sharing options...
leest Posted January 9, 2008 Author Share Posted January 9, 2008 HI, Thanks for that it worked perfectly Quote Link to comment https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/#findComment-434826 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.