Jump to content

Archived

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

awebbdesign

test fine live not

Recommended Posts

I have created a very simple page where the page idtest.php displays the information of the database from the url parameter...

 

idtest.php?id=1...

displays the information fine...

 

idtest.php?id=2

displays the information fine...

 

So when I look at it on my browser (from the testing server) it works, I can change the number and the page reloads with the correct corrasponding information...

 

But... When I upload this simple page to the web it doesn't work, why does it work on the testing server (my mac) and not on the web (a php server)?

 

Any pointers would be helpful.

 

Andy

 

 

 

 

Share this post


Link to post
Share on other sites

Depends on how you retrieve the passed parameters. Best guess is that your server is set to register_globals OFF (the more secure setting). Retrieving a URL passed parameter then requires code like so:

<?php
$id = $_GET['id']; // url passed parameter
....

Share this post


Link to post
Share on other sites

Thanks for the help, the register_globals is on and the server is running PHP Version 4.0.6, I have upload the site to another site and it works fine, so I guess the issue is with the first server which was a bit of a suprise, the server can run php as I have ran phpinfo() but for some reason doesn't like passing the id=1;

 

Thanks for your help... if your interested http://www.swindonweb.com/test/tcm/phpinfo.php is where I have just pulled the information, have a look and let me know if there is a problem with the php server and I can ring up the company and tell them the problem... much would be appreciated.

 

Again thanks for your help

 

 

Andy

Share this post


Link to post
Share on other sites

The phpinfo script from your domain clearly shows register_globals is set to ON, so you should be able to read passed variables 'directly'. Can you post a small sample of code that works locally and doesn't work on your domain server, so we can take a closer look just in case there's something weird there?

Share this post


Link to post
Share on other sites

I rang up the company and they said they could'nt upgrade the php server because it was an old server, so I set up the page on a different account and it works fine, to be honest the other server company are a pain in the butt, so when we register the domain for our client we wont use them, the server I am uploading to has a newer version of php, so I will use them...

 

I set-up the site using dreamweaver so I know it cant be the code as it wouldn't of worked on my mac and the newer server.

 

Thanks for the help though, I work for www.swindonweb.com and trying to convince my boss of doind PHP and not ASP so this has helped a lot.

 

 

 

Cheers

Share this post


Link to post
Share on other sites

I'd say you definitely made the right decision to dump the hosting company with the clapped-out server.

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.