Jump to content


Photo

test fine live not


  • Please log in to reply
5 replies to this topic

#1 awebbdesign

awebbdesign
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 22 February 2005 - 01:11 PM

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





#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 22 February 2005 - 01:23 PM

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
....

Legend has it that reading the manual never killed anyone.
My site

#3 awebbdesign

awebbdesign
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 22 February 2005 - 01:44 PM

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.swindonwe...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

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 22 February 2005 - 02:42 PM

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?
Legend has it that reading the manual never killed anyone.
My site

#5 awebbdesign

awebbdesign
  • Members
  • PipPip
  • Member
  • 28 posts

Posted 22 February 2005 - 02:51 PM

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

#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 22 February 2005 - 04:14 PM

I'd say you definitely made the right decision to dump the hosting company with the clapped-out server.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users