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
https://forums.phpfreaks.com/topic/176708-solved-help-with-database-debug-pls/
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');
}

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

 

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');

}

?>

 

 

 

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 '='.

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")

?>

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>

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")

?>

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

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.