Jump to content

Passing Variables w/ PHP 5.1.5


ibanez270dx

Recommended Posts

Hi,
I have a portion of code in my PHP program that works on my personal server, but not on the freshly installed server here at work... Originally, my server had PHP version 4.3.11, whereas my new server has PHP 5.1.5. Here is the problem... This snippet of code no longer can pass the variables to the next page:

[code=php:0]
<a href="export.php?w=1&amp;month=<? echo $today_month; ?>&amp;year=<? echo $today_year; ?>&amp;listorder=<? echo $listorder; ?>&amp;filename=<? echo $thefilename; ?>" name="2excel" class="print" target="_blank"><img src="images/excel.gif" border="0"> <b>Export to Excel</b></a>
[/code]

However, when I use sessions, it works. I don't know what could be wrong... I'm thinking it has to do with configuration settings somehow, but I don't know what...

Thanks,
- Jeff
Link to comment
Share on other sites

I always write my code as if globals are turned on.

If I'm needing to carry variables from one script to another then I send them one way or another whether it be via the URL or using forms. Any variables that I'm using fresh I make sure they're clear first or set to what they need to be set to.

That way when my code gets moved from server to server like a lot has done in the past I know it stands a much higher chance of working as I want it to.

Never presume globals are always on or off.
Link to comment
Share on other sites

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.