Board index   FAQ   Search  
Register  Login
Board index PHP Your Scripts

Link

This is where you share YOUR scripts with others

Moderators: macek, egami, gesf

Link

Postby newguy11 » Wed Jul 13, 2011 3:43 am

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?

Code: Select all
<?php
$username = $_POST["username"];
$password = $_POST["password"];
$actualusername = "newguy11";
$actualpassword = "password";

if($username == $actualusername && $password == $actualpassword){
echo "<a href=http://127.0.0.1:8888/web/Msapcalcmainsite/template3.html/>";
}
else {
echo 'info';
}
?>
newguy11
New php-forum User
New php-forum User
 
Posts: 1
Joined: Wed Jul 13, 2011 3:28 am

Re: Link

Postby egami » Thu Jul 14, 2011 4:55 am

If you pull up this website, what happens?

http://127.0.0.1:8888/web/Msapcalcmains ... late3.html
User avatar
egami
php-forum GURU
php-forum GURU
 
Posts: 2196
Joined: Wed Oct 06, 2010 11:19 am
Location: Happy Valley, UT

Re: Link

Postby inv123 » Thu Aug 11, 2011 5:40 am

Try to add a name to your url, like:

Code: Select all
<a href=http://127.0.0.1:8888/web/Msapcalcmainsite/template3.html/>Href title</a>


Than the link should be appeared.
inv123
New php-forum User
New php-forum User
 
Posts: 4
Joined: Fri Jun 03, 2011 11:45 pm

Re: Link

Postby NigelRen » Sun Aug 14, 2011 1:05 pm

If you want it to automatically go onto a new page, then use the http_redirect ( http://php.net/manual/en/function.http-redirect.php )

perhaps
Code: Select all
http_redirect("http://127.0.0.1:8888/web/Msapcalcmainsite/template3.html");
NigelRen
php-forum Active User
php-forum Active User
 
Posts: 450
Joined: Fri Aug 05, 2011 9:53 am


Return to Your Scripts

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.