Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/85186-solved-php-4-to-php-5-error/
Share on other sites

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.