I just changed servers. The old one ran version 4.0.6, and the new one runs 4.something (I was told by cust service). I can't use the <?php phpinfo()?> successfully to find out exactly which version they are running because any script I try to run returns the error message "no input file specified." Is this a problem with my script not being compatible with the server software, or the version of PHP? I'm not sure what server software they are running, either. I'm rather new to php, so I don't really know anything other than what I've read in forums similar to these. Here is a sample of the code I've been using, which worked perfectly on the old server.
<?PHP
/usr/local/bin/php4 #this line was not used on the old server, but without
#it, I was getting "file not found" errors
$filename = $myState.".txt";
if($submit == "yes"){
$fp = fopen($filename,"r");
$old = fread($fp, 800000);
fclose( $fp );
$old = split(",",$old);
$old = implode(",",$old);
$newText = $me.",".$old;
$fp = fopen($filename,"w+");
fwrite($fp, $newText, 800000);
fclose( $fp );
}
$fp = fopen($filename,"r");
$where = fread($fp, 800000);
fclose( $fp );
$where = split(",",$where);
$where = implode(",",$where);
print "&loading=absolutely";
print "&where=".$where;
?>
I don't know what to try...help please! Thanks
error output "no input file specified"
Moderator: General Moderators
a file with just <?php phpinfo(); ?> should work just fine no matter what..
Make sure the tag is not just <? but inclduing the 'php' part, I have noe idea if it is case sensitive, try lowercase just to make sure..
What filename are you using, .php ?
I have seen some that use .phtml, but that is more often used for perl/html (mod_perl).
Make sure the tag is not just <? but inclduing the 'php' part, I have noe idea if it is case sensitive, try lowercase just to make sure..
What filename are you using, .php ?
I have seen some that use .phtml, but that is more often used for perl/html (mod_perl).
I ended up figuring it out...
I was using the <?php phpinfo();?> with the .php filename, but it still wasn't reading it. Apparently I needed this line before any code in the file:
#!/usr/local/bin/php4
Everything else works fine now, but I had to change all of my variables from $someVariable to $HTTP_POST_VARS['someVariable'] for them to be read properly. Anyway, thanks very much for the reply.
mrhosh
I was using the <?php phpinfo();?> with the .php filename, but it still wasn't reading it. Apparently I needed this line before any code in the file:
#!/usr/local/bin/php4
Everything else works fine now, but I had to change all of my variables from $someVariable to $HTTP_POST_VARS['someVariable'] for them to be read properly. Anyway, thanks very much for the reply.
mrhosh
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Since they've upgraded your version of PHP you can use the new superglobals instead of the old $HTTP_xxx_VARS arrays, so instead of $HTTP_POST_VARS you can just use $_POST. It definitely cuts down on the typingmrhosh wrote:Everything else works fine now, but I had to change all of my variables from $someVariable to $HTTP_POST_VARS['someVariable'] for them to be read properly. Anyway, thanks very much for the reply.
For more info:
http://www.php.net/manual/en/language.v ... efined.php
Mac