Link

So here is the code I am using at the moment and I know its very basic. What I would like to happen is for the php to check weather the username and password is correct then link directly to another URL but with this code it just pulls up a blank screen with /processphp at the end of the URL. Can someone please help me to understand why this isn’t quite working the way I need it to and help me to fix it?

[php]<?php
$username = $_POST[“username”];
$password = $_POST[“password”];
$actualusername = “newguy”;
$actualpassword = “password”;

if($username == $actualusername && $password == $actualpassword){
echo “”;
}
else {
echo ‘info’;
}
?>[/php]

will give them a link to click. Your code isn’t using the link correctly. You have to close with after some text. You also need to use speech marks to encase the href. Echo using commas ( ’ )
[php]<?php
$username = $_POST[“username”];
$password = $_POST[“password”];
$actualusername = “newguy”;
$actualpassword = “password”;

if($username == $actualusername && $password == $actualpassword){
echo ‘Click here’;
}
else {
echo ‘info’;
}
?>[/php]

Header will forward them to the location.
[php]<?php
$username = $_POST[“username”];
$password = $_POST[“password”];
$actualusername = “newguy”;
$actualpassword = “password”;

if($username == $actualusername && $password == $actualpassword){
header(“Location: http://127.0.0.1:8888/web/Msapcalcmainsite/template3.html”);
}
else {
echo ‘info’;
}
?>[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service