simpli Posted February 11, 2009 Share Posted February 11, 2009 Hi, I have the script below and it is now working. The $_SERVER... is supposed to refer to the current page but all I get is the below error message from firefox? Can anyone give me a hint of a solution? Thank you kindly. J-R The error message is as below: Firefox can't find the file at /Applications/MAMP/htdocs/pool/<?=$_SERVER['PHP_SELF']?>. This is my script. <?php if(isset($_POST['Login'])) { ' if($_POST['username']!='' && $_POST['password']!='')' ' {' ' echo " utilisateur actuel"' ' }' } else{ if(isset($_POST['CreateUser'])) { echo "Nouvel utilisateur" } } ?> <?php if(isset($error)){ echo $error;}?> <form action="<?=$_SERVER['PHP_SELF']?>" method="post"> <input type="text" id="username" name="username" size="32" value="" /> <input type="password" id="password" name="password" size="32" value="" /> <input type="submit" name="Login" value="Login" /> <input type="submit" name="New account" value="CreateUser" /> </form> Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/ Share on other sites More sharing options...
gevans Posted February 11, 2009 Share Posted February 11, 2009 Use full tags; <?php echo $_SERVER['PHP_SELF'] ?> Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/#findComment-759346 Share on other sites More sharing options...
simpli Posted February 11, 2009 Author Share Posted February 11, 2009 Hi, and thank you very much for your very fast reply. I tried to do the change you suggested. So far it's not working. Right now I have removed everything in the php file except for that little piece. Could this be a configuration issue? Thanks for your continued help. J-R I still get the same error message: Firefox can't find the file at /Applications/MAMP/htdocs/pool/<? php=$_SERVER['PHP_SELF']?>. Here is my code, to its simplest expression. <form action="<? php=$_SERVER['PHP_SELF']?>" method="post"> <input type="text" id="username" name="username" size="32" value="" /> <input type="password" id="password" name="password" size="32" value="" /> <input type="submit" name="Login" value="Login" /> <input type="submit" name="New account" value="CreateUser" /> </form> Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/#findComment-759354 Share on other sites More sharing options...
gevans Posted February 11, 2009 Share Posted February 11, 2009 copy it exactly, you have funny spaces <? php=$_SERVER['PHP_SELF']?> it should be <?php echo $_SERVER['PHP_SELF'] ?> copy and paste it Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/#findComment-759359 Share on other sites More sharing options...
simpli Posted February 11, 2009 Author Share Posted February 11, 2009 Hi again, it's still not working. Here's how I set it up. <?php if(isset($error)){ echo $error;}?> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> <input type="submit" name="Login" value="Login" /> <input type="submit" name="New account" value="CreateUser" /> </form> Do you think it would be possible for you to put a complete implementation of that command so I could try it on my end. What you have above is absolutely ALL there is in my php file. I am fairly new to php so I'm going through a brutal learning curve. Thanks again for your help. J-R Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/#findComment-759366 Share on other sites More sharing options...
gevans Posted February 11, 2009 Share Posted February 11, 2009 What error message did you get, that looks fine Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/#findComment-759367 Share on other sites More sharing options...
PFMaBiSmAd Posted February 11, 2009 Share Posted February 11, 2009 FYI: action="" produces the same end result as - action="<?php echo $_SERVER['PHP_SELF']; ?>" Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/#findComment-759369 Share on other sites More sharing options...
simpli Posted February 11, 2009 Author Share Posted February 11, 2009 I got the error. I am going through MAMP to test and when going through MAMP you must use http://localhost:8888/MAMP/ as the root. Also your files must be placed in that directory and be resolved accordingly. When I was testing I just opened the file in the browser but that didnt work. I have to have the http://localhost:8888/MAMP/ at the beginning of the adress or it wouldnt work. Anyway thanks, J-R Link to comment https://forums.phpfreaks.com/topic/144710-on-mamp-is-not-working/#findComment-759380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.