Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,323 members, 7,957,864 topics. Date: Tuesday, 24 September 2024 at 10:30 PM |
Nairaland Forum / Science/Technology / Programming / My First Real PHP Based Website (8840 Views)
Closed - Out of date / Question And Answer Based Website (Program Routes) (2) (3) (4)
Re: My First Real PHP Based Website by Olaide1295: 11:48pm On Jun 04, 2016 |
hello bro,
I also want to learn php, what softwares are u using to run it on your PC?
I have xampp already,what do I need |
Re: My First Real PHP Based Website by halmat(m): 12:05am On Jun 05, 2016 |
Olaide1295: Nothing more than text editor and the offline version of php.net online documentation |
Re: My First Real PHP Based Website by Nobody: 10:17am On Jun 10, 2016 |
Olaide1295: Download a Text-Editor e.g; Sublime Text or Brackets (I use both). To create a new Xampp Project, create a folder for the project at C:/xampp/htdocs/exampleproject . To view the project on the browser, go to localhost/exampleproject . Hope you get it right, happy devving! 1 Like |
Re: My First Real PHP Based Website by Realphilo(m): 5:39pm On Jun 11, 2016 |
Thirdwrist:Check your index1.php file @ line 34 |
Re: My First Real PHP Based Website by wisemania(m): 10:55pm On Jun 12, 2016 |
@op, the truth is nobody cares about your codes unless it can create admirable web pages accessible by all. |
Re: My First Real PHP Based Website by Thirdwrist(m): 11:22am On Jun 13, 2016 |
The login script is as follows
Please help review if you see any inconsistency i will be more than happy to correct it. And any security flow. |
Re: My First Real PHP Based Website by Thirdwrist(m): 11:24am On Jun 13, 2016 |
The signup script is as follows [codes] #sighup script below // Save form values in variables as well as clear it of any malicious characters $fname=mysql_real_escape_string($_POST['fname']); $lname=mysql_real_escape_string($_POST['lname']); $email=mysql_real_escape_string($_POST['email']); $gset=mysql_real_escape_string($_POST['gset']); $department=mysql_real_escape_string($_POST['dpt']); $pass1=mysql_real_escape_string($_POST['pass1']); $pass2=mysql_real_escape_string($_POST['pass2']); require "db_connect.php"; //checking lenght of string if (strlen($lname) > 30 || strlen($lname)< 3 ){ $output="Invalid Last name"; require_once "signup.php"; die; } elseif (strlen($fname) > 30 || strlen($fname)< 3 ){ $output="Invalid First name"; require_once "signup.php"; die; } elseif (strlen($pass1) > 50 || strlen($pass1)< 7 ){ $output="Invalid password, Password must be minimum of 7 units"; require_once "signup.php"; die; } //if email is already reistered $sql="SELECT Email FROM users WHERE email='{$email}'"; $result= mysql_query($sql); //if the two passwords are the same if($pass1!=$pass2){ $output= "Please make sure the two passwords are the same "; require_once "signup.php"; die(); } elseif(mysql_num_rows($result)==True){ $output= "This Email address has already been regisered here"; require_once "signup.php"; die(); } else{ $pass1=md5(mysql_real_escape_string($pass1)); $sql=" INSERT INTO users SET First_name ='{$fname}', Last_name = '{$lname}', Email= '{$email}', Pass= '{$pass1}', Graduation_set='{$gset}', Department='{$department}'"; try{ $result=mysql_query($sql); } catch(MYSQLException $e){ $output="Failed to register, Please try again and if problem persist contact the admin". $e->getmessage(); } } echo "welcome bro"; [/codes] Please help review if you see any inconsistency i will be more than happy to correct it. And any security flaw |
Re: My First Real PHP Based Website by Thirdwrist(m): 11:27am On Jun 13, 2016 |
Thank you Sir, I have fixed that. thank you... Realphilo: 1 Like |
Re: My First Real PHP Based Website by Thirdwrist(m): 11:32am On Jun 13, 2016 |
Thank you very much I have rectified the issue thanks to you Sir... I would be grateful if you follow more of my recent posts on this tread and be as generous as you are now to administer solutions to my errors. Thank you again Sir. sleepingdemon: |
Re: My First Real PHP Based Website by wisemania(m): 1:00am On Jun 14, 2016 |
I think it's still susceptible to sql injection...you could add a trim($pass) function together with strip_tags () aswell...theses would prevent simple attacks.to make it more secured you can hard code your validation to prevent any acceptance of sql syntaxes like : select, delete, insert, join, modify etc... But that doesnt mean it still isnt suceptible though, but it would require an expert to reck harvoc. My $0.2 |
Re: My First Real PHP Based Website by wisemania(m): 1:04am On Jun 14, 2016 |
Good |
Re: My First Real PHP Based Website by D34lw4p(m): 3:26am On Jun 14, 2016 |
Booyakasha:join www.nct.com.ng its the best programmers forum I can recommend to help you on your project, G33ks are there to help you! |
Which Programming Language Holds Brighter Prospects In Nigeria / Can Developers Do Without The Use Of Google Or Stackoverflow? / Is There Any Chance That A Female Can Become A Very Good Programmer
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 34 |