Jump to content

[SOLVED] help with database debug pls


k21chrono

Recommended Posts

 

Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 13

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

<?php

$myusername=$_POST['username'];

$mypassword=$_POST['password'];

 

if($myusername='********'&&$mypassword='********')

header('Location:http://www.mesickonline.com/students/05/php/index.html');

else($myusername='********'&&$mypassword='********')

header('Location:http://www.mesickonline.com/students/05/php/index.html');

?>

 

 

 

 

<body>

 

</body>

</html>

 

Link to comment
Share on other sites

Tell him to use code tags, and read PHP manual on if-else syntax.

 

He needs curly braces

 


if($myusername=='********'&&$mypassword='********') 
{
   header('Location:http://www.mesickonline.com/students/05/php/index.html');
}
elseif($myusername=='********'&&$mypassword='********')
{
   header('Location:http://www.mesickonline.com/students/05/php/index.html');
}

Link to comment
Share on other sites

Tell him to use code tags, and read PHP manual on if-else syntax.

 

He needs curly braces

 


if($myusername=='********'&&$mypassword='********') 
{
   header('Location:http://www.mesickonline.com/students/05/php/index.html');
}
elseif($myusername=='********'&&$mypassword='********')
{
   header('Location:http://www.mesickonline.com/students/05/php/index.html');
}

 

He says thanks....lol

 

Link to comment
Share on other sites

ok now its still being a pain

 

Parse error: syntax error, unexpected T_ELSE in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 13

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

<?php

$myusername=$_POST['username'];

$mypassword=$_POST['password'];

 

if($myusername='******'&&$mypassword='********')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');

}

else($myusername='*******'&&$mypassword='********')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');

}

?>

 

 

 

Link to comment
Share on other sites

Use


tags around your code.

 

'else' was in line 13 in your previous code. There is a good chance you didn't save or upload your changes.

 

This code doesn't make much sense anyway. It should be 'elseif' instead of 'else' and '==' instead of '='.

Link to comment
Share on other sites

Parse error: syntax error, unexpected '{' in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 15

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

<?php

$myusername=$_POST['username'];

$mypassword=$_POST['password'];

 

if($myusername=='*******'&&$mypassword='********')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');}

else($myusername=='k**********h'&&$mypassword='*********')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');}

elseif

echo ("wronge user or pass")

?>

Link to comment
Share on other sites

ok now i got no errors but instead of it taking my user or pass and saying heres the next page it just saying wrounge user and pass im trying to make a logg in for another site

 

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

<?php

$myusername=$_POST['username'];

$mypassword=$_POST['password'];

 

if($myusername=='*******'&&$mypassword='********')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');}

elseif($myusername=='**********'&&$mypassword='*******')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');}

else

echo ("wronge user or pass")

?>

 

 

 

 

<body>

Link to comment
Share on other sites

fixed that now its still going to wronge user and pass

 

<?php

$myusername=$_POST['username'];

$mypassword=$_POST['password'];

 

if($myusername=='******'&&$mypassword=='*******')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');}

elseif($myusername=='**********'&&$mypassword=='*******')

{

header('Location:http://www.mesickonline.com/students/05/php/index.html');}

else

echo ("wronge user or pass")

?>

Link to comment
Share on other sites

Hi

 

Echo out the userid and password to check they are the ones you expect:-

 

<?php
$myusername=$_POST['username'];
$mypassword=$_POST['password'];

if($myusername=='******'&&$mypassword=='*******')   
{
header('Location:http://www.mesickonline.com/students/05/php/index.html');
}
elseif($myusername=='**********'&&$mypassword=='*******')
{
header('Location:http://www.mesickonline.com/students/05/php/index.html');
}
else
{
echo ("wronge user or pass *".$myusername."*".$mypassword."*")
}
?>

 

All the best

 

Keith

Link to comment
Share on other sites

omfg

Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/e/s/mesick/html/students/05/php/checklogin.php:8) in /home/content/m/e/s/mesick/html/students/05/php/checklogin.php on line 14

 

 

 

<code>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Untitled Document</title>

</head>

<body>

<?php

$myusername=$_POST['myusername'];

$mypassword=$_POST['mypassword'];

 

if($myusername=='fishandben'&&$mypassword=='holycrap')

{

header('Location:mesickonline.com/students/05/php/index.html');}

elseif($myusername=='k21chrono'&&$mypassword=='bloody01')

{

header('Location:http:mesickonline.com/students/05/php/index.html');}

else

echo ("wronge user or pass *" . $myusername . "*" . $mypassword . "*")

?>

 

 

 

 

 

 

</body>

</html>

</code>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.