PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi, I am writing a user authenticated website that uses php to authenticate users against a mySQL database. Everything works fine to a point... I send the user an email with random password for email validation... the email is received fine - and after that I want the user to be directed to a "signup success" page. For some reason, whether I include the HTML for this success page directly or as a php include, it does not get parsed and displayed. See code below! Thanks in advance for any help!
<?php
...
// everything works fine so far
...
mail($_POSTї'newEmail'],"Your Password for the elearnJava Website", $message, "From:elearnJava Webmaster <webmaster@realisedesign.co.uk>");
...
// mail is sent and received successfully - page should load saying
// success
include 'success.php';
// page doesnt load - browser status bar says 'done'
endif;
?>
my guess is that i can't find success.php (might want to read the documentation on include/require where it says where those functions will search for the file)
/login/success.php very very very likely isn't the full path. More likely it's /home/yourusername/public_html/login/success.php but you shouldn't have to do that.. Check the path of the executing file: $_SERVER['PATH_TRANSLATED'] as well as __FILE__ .. and check the include paths to see where they are through phpinfo()
I'm doing all this on a local XP testing server... I have http://project
setup as a virtual host and the actual website is installed in
c:\www\project... so http://project points to c:\www\project.
As such, I think /login/success.php is the full path as far as the web server is concerned since this is a web root relative url
(n.b. path to success.php is c:\www\project\login\success.php)
could you elaborate on that? how should I include a file 'success.php'
give it is located at c:\www\project\login\success.php, where my virtual host document_root is c:\www\project!?