Jump to content


This topic is now archived and is closed to further replies.


Include() function no longer working

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?

Share this post

Link to post
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.

Share this post

Link to post
Share on other sites


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.