The Saint Posted August 2, 2007 Share Posted August 2, 2007 Alright, Here's the problem I have that I've asked 10 people on Websites,Myspace,Instant Messengers, & Ect. The were just too advanced and confused me ALOT. So I was wondering if someone could help me with my problem and simplify it too a certain level where I Don't get mixed up. Alrighty, So here it is. I have made a website that is currently being worked on OFF LINE. I have Only downloaded WAMP5 SERVER. I followed a tutorial that can be found <a href=" I made a PHP Registration Successfully. I tested it out, the information WAS saved to my database and i could see it in the table. Great. The Way i viewed the registration page is I type in LOCALHOST and then i clicked SaintsProject [Name of Website] Under YOUR PROJECTS. Once the page loaded in h1 font displayed Index of /Saintsprojects then i saw register.php. Clicked it and it loaded and it works. Now i went into my WWW Files. Then Into Saints Project. I saw "register.php". Right-Clicked it, then Clicked Edit. I Copied the source. Went into my website, Edited the login.html pasted the source of register.php into it. I preview it and this is what i found... <img src="http://photobucket.com/albums/i223/ballaj023/image.jpg"> Someone please explain to me what errors i made and this is the preview of register.php from the wamp server documents.... <img src="http://i73.photobucket.com/albums/i223/ballaj023/untitled.jpg"> This one works^ Why arent they identical? Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/ Share on other sites More sharing options...
soycharliente Posted August 2, 2007 Share Posted August 2, 2007 Is the first one a .html file? Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314301 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 Is the first one a .html file? yea it is Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314302 Share on other sites More sharing options...
soycharliente Posted August 2, 2007 Share Posted August 2, 2007 Well there you go. If you want your PHP to process, it has to be a .php file. Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314304 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 Well there you go. If you want your PHP to process, it has to be a .php file. ive made attempts to change it but im not quite shure how Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314305 Share on other sites More sharing options...
soycharliente Posted August 2, 2007 Share Posted August 2, 2007 Are you serious? You don't know how to turn it into a .php file? Save As -> whatever.php Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314311 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 Well there you go. If you want your PHP to process, it has to be a .php file. okay so i copied the source posted it in blank and saved as .php and saw this <img src="http://i73.photobucket.com/albums/i223/ballaj023/untitled-1.jpg"> Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314314 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 Are you serious? You don't know how to turn it into a .php file? Save As -> whatever.php i know how its just i was expecting it to work the right way i put it and it didnt work Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314317 Share on other sites More sharing options...
simcoweb Posted August 2, 2007 Share Posted August 2, 2007 You can right-click on the file and go to 'Rename' and just change the extension to .php Also, the case may be that you've pasted this code in there incorrectly. Looks to me like it's reading it as text. Be sure you have <?php ?> enclosing it plus make sure all your double and single quotes are in line. Otherwise it will just look like a mess. Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314319 Share on other sites More sharing options...
soycharliente Posted August 2, 2007 Share Posted August 2, 2007 That's really weird. So the file is called whatever.php? Can we see some of the code? Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314324 Share on other sites More sharing options...
simcoweb Posted August 2, 2007 Share Posted August 2, 2007 Yeah, ditto that. Please post all the code and make sure you use the tags so we can see it clearly. Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314331 Share on other sites More sharing options...
EagleAmerican Posted August 2, 2007 Share Posted August 2, 2007 Is PHP installed on your system? It's not on mine and that's why I use my host for testing. Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314336 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 <font face=verdana> <?php $c = mysql_connect(localhost,root,"") or die(mysql_error()); $d = mysql_select_db(user,$c); function protect($value){ $value = mysql_real_escape_string($value); $value = stripslashes($value); $value = strip_tags($value); } $action = $_GET['act']; protect($action); if(!$action){ echo "<table border=0 celpadding=3 cellspacing=3> <form name=register method=post action=\"register.php?act=register\">\n <tr><td>Username:</td><td><input type=text name=username maxlength=32>\n</td></tr>\n <tr><td>Password:</td><td><input type=password name=password maxlength=15>\n</td></tr>\n <tr><td>Confirm Pass:</td><td><input type=password name=passconf maxlength=15>\n</td></tr>\n <tr><td>E-Mail:</td><td><input type=text name=email>\n</td></tr>\n <tr><td>Confirm E-Mail:</td><td><input type=text name=econf>\n</td></tr>\n <tr><td>Birthday (Day):</td><td><select name=day>/n"; for($i=1;$i<32;$i++){ echo "<option value=\"$i\">$i</option>\n"; } echo "</select></td></tr>\n <tr><td>Birthday (Month):</td><td><select name=month>\n"; for($i=1;$i<13;$i++){ echo "<option value=\"$i\">$i</option>\n"; } echo "</select></td></tr>\n <tr><td>Birthday (Year):</td><td><select name=year>\n"; for($i=1994;$i>1900;$i--){ echo "<option value=\"$i\">$i</option>\n"; } echo "</select></td></tr>\n <tr><td>Real Name:</td><td><input type=text name=name maxlength=32>\n <tr><td colspan=2 align=right><input type=submit value=\"Register\">\n"; } if($action == "register"){ $username = $_POST['username']; $password = $_POST['password']; $passconf = $_POST['passconf']; $email = $_POST['email']; $econf = $_POST['econf']; $day = $_POST['day']; $month = $_POST['month']; $year = $_POST['year']; $name = $_POST['name']; protect($username); protect($password); protect($passconf); protect($email); protect($econf); protect($day); protect($month); protect($year); protect($name); if(isset($username) && isset($password) && isset($passconf) && isset($email) && isset($econf) && isset($day) && isset($month) && isset($year) && isset($name)){ if(strlen($username) < 4 || strlen($username) > 32){ echo "Sorry, your username is either too short or too long!\n"; }else { if(strlen($password) <4 || strlen($password) > 15){ echo "Sorry, your password is either too short or too long!\n"; }else { if(strlen($email) < 3 || strlen($email) > 125){ echo "Sorry, you're email is either too short or too long!\n"; }else { if(strlen($name) < 1 || strlen($name) > 32){ echo "Sorry your name is too long! Please shorten it!\n"; }else { if(!is_numeric($day) || !is_numeric($month) || !is_numeric($year)){ echo "Sorry your birthday you entered was false!\n"; }else { if($day < 1 || $day > 31){ echo "Sorry, your birthday is invalid!\n"; }else { if($month < 1 || $month > 12){ echo "Sorry, your birth month is invalid!\n"; }else { if($year < 1901 || $year > 1994){ echo "Sorry, your birthyear is invalid!\n"; }else { $array = array('.'); $math = $year/4; if((in_array($math,$array)) && $day > "28" && $month == "2"){ echo "Sorry, your birthday is invalid!\n"; }else { if($password != $passconf){ echo "Sorry the passwords you entered, do not match!\n"; }else { if($email != $econf){ echo "Sorry, the emails you entered do not match!\n"; }else { $checkemail = "/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i"; if(!preg_match($checkemail,$email)){ echo "Sorry, the email you entered appears to be invalid!"; }else { $sql = "SELECT * FROM `users` WHERE `username` ='$username'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) > 0){ echo "Sorry, Our records show this username already exists!"; }else { $sql = "SELECT * FROM `users` WHERE `email` ='$email'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) > 0){ echo "Sorry, Our records show this email is already in use! "; }else { $sql = "SELECT * FROM `users` WHERE `ip` ='$_SERVER[REMOTE_ADDR]'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) > 0){ echo "Sorry, Our records show this IP has already signed up an account!"; }else { $password = md5($password); $bday = "$month/$day/$year"; $date = date("F j, Y @ g:i:s a"); $ip = $_SERVER['REMOTE_ADDR']; $sql = "INSERT INTO `users` (`username` , `password` , `email` , `ip` , `name` , `bday` , `date` )VALUES ('$username', '$password', '$email', '$ip', '$name', '$bday', '$date');"; $res = mysql_query($sql) or die(mysql_error()); echo "Thanks for joining Saints Project.com! You may login now!\n"; } } } } } } } } } } } } } } } } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314475 Share on other sites More sharing options...
teng84 Posted August 2, 2007 Share Posted August 2, 2007 maybe you dont have a php installed thats why it cant read the php file or try to see the phpinfo Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314481 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 maybe you dont have a php installed thats why it cant read the php file or try to see the phpinfo can u give me a link where i can install php Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314483 Share on other sites More sharing options...
teng84 Posted August 2, 2007 Share Posted August 2, 2007 LOL you kill those guys LOL http://www.wampserver.com/en/ Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314485 Share on other sites More sharing options...
simcoweb Posted August 2, 2007 Share Posted August 2, 2007 You can install something like XAMPP which is what I use. It's a suite of server related software such as Apache/PHP/MySQL. Works great on my machine without interrupting anything else. http://www.apachefriends.org/en/xampp.html Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314488 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 LOL you kill those guys LOL http://www.wampserver.com/en/ I already have that and sorry i just started php im much much more at HTML Advanced Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314489 Share on other sites More sharing options...
teng84 Posted August 2, 2007 Share Posted August 2, 2007 try You can install something like XAMPP which is what I use. It's a suite of server related software such as Apache/PHP/MySQL. Works great on my machine without interrupting anything else. http://www.apachefriends.org/en/xampp.html Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314490 Share on other sites More sharing options...
teng84 Posted August 2, 2007 Share Posted August 2, 2007 lol btw i look at the pic you post the location is document and setting the php should be run on your local host if its where the php is located hmm does it make sense Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314492 Share on other sites More sharing options...
simcoweb Posted August 2, 2007 Share Posted August 2, 2007 I think what teng is saying is that normally you would view the page by typing an address similar to: http://localhost/folderwherethepageis/nameofpage.php Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314494 Share on other sites More sharing options...
The Saint Posted August 2, 2007 Author Share Posted August 2, 2007 lol btw i look at the pic you post the location is document and setting the php should be run on your local host if its where the php is located hmm does it make sense so your saying i should just put my web temp on the localhost/blah/register.php? Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314496 Share on other sites More sharing options...
teng84 Posted August 3, 2007 Share Posted August 3, 2007 hmm ya I think what teng is saying is that normally you would view the page by typing an address similar to: http://localhost/folderwherethepageis/nameofpage.php LOL Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314504 Share on other sites More sharing options...
simcoweb Posted August 3, 2007 Share Posted August 3, 2007 What we're saying is that for your server software you've installed to parse the PHP pages or the HTML pages properly it would typically require that you place them into a specific location like I pointed out. In other words, just because you've installed this server software, wampserver, doesn't mean that the pages will run properly from any location on your computer. The pages must be placed within the wampserver directory on your hard drive. Now, i'm not that familiar with that program since I don't use it. But using the basic laws of reason they all work primarily the same since it's the same server software as the others but packaged a bit different. So, read the instructions on where to place your files in order for them to parse properly. What you're showing us with all that text instead of hidden code usually means you're trying to view it 'outside' the realm of your server software. Make sense? Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314508 Share on other sites More sharing options...
The Saint Posted August 3, 2007 Author Share Posted August 3, 2007 What we're saying is that for your server software you've installed to parse the PHP pages or the HTML pages properly it would typically require that you place them into a specific location like I pointed out. In other words, just because you've installed this server software, wampserver, doesn't mean that the pages will run properly from any location on your computer. The pages must be placed within the wampserver directory on your hard drive. Now, i'm not that familiar with that program since I don't use it. But using the basic laws of reason they all work primarily the same since it's the same server software as the others but packaged a bit different. So, read the instructions on where to place your files in order for them to parse properly. What you're showing us with all that text instead of hidden code usually means you're trying to view it 'outside' the realm of your server software. Make sense? okay i understand so when i am ready do i extract the "whole" wamp2 file onto my website Quote Link to comment https://forums.phpfreaks.com/topic/63097-php-help-login-and-registrations-onto-website/#findComment-314513 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.