Jump to content

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

 

 

 

 

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

Link to comment
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

Link to comment
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?

Link to comment
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

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.