Hi,

This Page will give possible answers to questions of Jazeb’s Course “PHP Secure Login and Registration System + Email Activation“. Try to find your questions keyword in this page and you will get all the steps to find the right answer.

 

Q:

Database question mysql mysqli syntax

 

See Lecture “Working with DataBase” inside course curriculum.

Check out following Information

 

Download XAMP SERVER 3.2.2 for running only mysqli

https://www.apachefriends.org/index.html

Download XAMP SERVER 3.2.1 for running both, mysql and mysqli

 

LEARN mysqli FUNCTIONS SYNTAX

See my course “Learning PHP Data Objects PDO” for a better database application.

 

$Connection=mysql_connect("localhost","root"," ");

$Selected=mysql_select_db("Put Your Data Base Name here",$Connection);

Error functions

error.mysql_connect();

error.mysql_select_db();

Other Major Functions in mysql

$Query="SELECT * From emp_record ";

$Execute=mysql_query($Query);

mysql_fetch_array($Execute)

mysql_real_escape_string($Varriable);
$Connection = mysqli_connect("localhost","root","","Put Your Data Base Name here");

Error functions

mysqli_connect_error(); // for showing error message if something went wrong

mysqli_connect_errorno();  // for showing error number if we have any error

Other Major Functions in mysqli

$Query="SELECT * From emp_record ";

$Execute=mysqli_query($Connection,$Query);

mysqli_fetch_array($Execute)

mysqli_real_escape_string($Connection,$Varriable);

Connection Code in Mysql Mysqli

 

<?php

$Connection = mysqli_connect("localhost","root","","YourDataBaseName");

// Check connection

// mysqli_connect_error(); for showing error message if something went wrong

// mysqli_connect_errno(); for showing error number if we have any error

if (mysqli_connect_errno())

{   echo "Failed to connect to MySQL: " . mysqli_connect_error();   }

mysqli_close($Connection);

// Function for closing connection at the end of the page/work when you are done

 ?>
<?php

$Connection=mysql_connect('localhost','root','');

if($Connection){ echo "DataBase Connected <br>"; }

else{ error.mysql_connect(); }

$Selected=mysql_select_db('YourDataBaseName',$Connection);

if($Selected){ echo "DataBase Selected"; } else{ error.mysql_select_db(); }

?>

See my course “Learning PHP Data Objects PDO” for a better database application.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End

Best,

 

Q:

PHP 7 OR PHP 5.6

Hi,

The Future of PHP is bright. 🙂 

When we talk about php versions, they introduced new features and never ever removed something without replacing it with something useful. So if you compare PHP 5.6 and with 7.1 the newer version has namespace and other new classes but all the php 5.6 is fully supported in 7.1 with the miner new additions. that’s good right!

If the newer version dont offer old functions and syntax it wont gonna attract lazy developers (e.g Angular JS).They deprecated mysql after 5.6 and all  developers had time to learn mysqli syntax. Now, PDO (my PDO course is just went livehas replaced the need of  mysqli too. but you can still use mysqli as well because its fully supported.

As for newbies, 7 out of 10 will find mysql (deprecated) syntax a lot difficult. So i designed my PHP Series to move forward step by step.

Best,

Jazeb

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End

 

Q:

login system | function Login_Attempt($Username,$Password) is not working

Hi,

1st remove this function

Login_Attempt($Username,$Password){ }

from your function file completely. save it and close your file.

Clear your browser(chrome/firefox) cache.

restart computer.

Now write this function

Login_Attempt($Username,$Password){}

in another file say Test.php

Now open the function file and paste it here.

Conclusion: Write your function in another file and past it directly into your function file without writing in it. Check.

See my course Learning PHP Data Objects PDO for writing a better login system application.

Best,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End

Q:

Source Codes of course

Hi,

Check Course curriculum for coding files.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End

Q:

syntax error or undefined variable on some line

 Error: undefined variable / Syntax Error on some line
Solution: Compare your code with the source codes available inside the curriculum of this course

Q:

Sending Email question

1st Possible Response:

Hi,

Maybe you did not edit it right.

Uninstall Xamp then restart and install XAMP 3.2.1 version again.

then

Watch the video again.

Follow the instruction below.

Setting local host to send email 1st STep go to Xamp ->PHP-> locate php.ini go to line 1142 remove ; at the begining go to line 1145 and add a ; at the begining 2nd step go to Xamp -> sendmail -> locate sendmail.ini go to line 14 set smtp.gmail.com go to line 18 set port to 587 go to line 46 and 47 add gmail email and password

Best,

Jazeb

2nd Possible Response:

 

Hi,

1:

Are you getting any message

like

“Mail Sent Successfully”

or

“Mail Sent Un-Successfully”

2:

Did Gmail gave you the security warning e.g less security app login same as video? At the end of running your PHP script and having a success message e.g. “Mail Sent Successfully”

3rd Possible Response:

if there is nothing arrived in your email inbox it could be due to many reason.

Actually from a FROM_MAIL_SERVER to RECEIVE_MAIL_SERVER 1 mail has to travel from a lot of servers and every server has their spam filters. So its possible that you sent your email but due to spam filters in the middle it got stuck somewhere. if nothing worked from the above solution i will suggest you to just watch this mail project and when you are done contact your online hosting company and asked them how to configure emails. They are the one responsible for emails.

Q:

URL error | undefined id error on some line

Hi,

$_GET[‘id’] means : get the the id from URL.

SO in case if you dont have any id in URL it will be undefined that is why you must have id in your URL tab

as shown below

Best,

 

Q:

URL Post ID is not getting from URL / Post is not Updating

 

Hi,

Go to lecture 14. download coding exercises. In the file of FullPost.php On line 14 we made

$PostId=$_GET["id"];

means we are getting the id of post from URL . So if you skip this line or Have some URL Like Fullpost.php?id= it wont gonna work

So there should be some id in URL before submitting it

if($Execute){
 $_SESSION["SuccessMessage"]="Comment Submitted Successfully";
 Redirect_to("FullPost.php?id={$PostId}");
 }

Your Comments form should be like this

<form action="FullPost.php?id=<?php echo $PostId; ?>" method="post">

Your Browser should be like this

and for code

see course curriculum.

Best,

Jazeb

End…..

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End

Q:

login system | function Login_Attempt($Username,$Password) is not working

Hi,

1st remove this function

Login_Attempt($Username,$Password){ }

from your function file completely. save it and close your file.

Clear your browser(chrome/firefox) cache.

restart computer.

Now write this function

Login_Attempt($Username,$Password){}

in another file say Test.php

Now open the function file and paste it here.

Conclusion: Write your function in another file and past it directly into your function file without writing in it. Check.

See my course Learning PHP Data Objects PDO for writing a better login system application.

Best,

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~End

Best,

jazebakram.com