Jump to content

Include() function no longer working


antray

Recommended Posts

I am currently testing a php form on a new server, which hasn't gone public yet. I am working on a vurtual server. One form, floor estimation form, is supposed to carry a variable from a link to load color selection. The code is below:

[code]       <?php    
    include "".$color.".php";
         ?>    [/code]

Link to the problem form: [a href=\"http://gndzero.com/form-test/flooring-estimation-new.php?item=DuroStat%20Tile&color=dscolor\" target=\"_blank\"]http://gndzero.com/form-test/flooring-esti...e&color=dscolor[/a]

I tested it on my host and it worked fine, so I wonder if its a php version issue. [a href=\"http://www.gndzero.com/flooring_estimation.php?item=DuroStat_Tile&color=dscolor\" target=\"_blank\"]Here's what it should look like when the colors load.[/a]

The php version of the new server is 4.4.2-1-1b1
The one I tested it on, my host, is: 4.4.1 [i]- it works on this one!![/i]

Where should I start on this issue?
Link to comment
Share on other sites

I suspect that register_globals is turned off on the other host. Which is why the value of $color is not being recognized. If the value is being passed via the url...then do this:

[code]$color = $_GET[colorvalue];

include $color.'.php';[/code]

If it's being submitted via a form, then do this:


[code]$color = $_POST[colorvalue];

include $color.'.php';[/code]

Hope that help. Good luck.
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.