Jump to content

Recommended Posts

Posted

Hi Everybody,

 

I'm working on my website. I just barely uploaded the files, did it today, actually. I'm using Windows Vista, Mozilla Firefox. Anyway, I'm writing a website called "MySite.php". it requires an activation code at a different site to be entered in. I type the code, and it leads me to my main site. I know that I've typed the correct code, and everything. only I have a little problem - after MySite.php executes the php code, it won't do the html I want it to. Here is the code for it:

 

<html>
<head>
<title>Welcome to My Site</title>
</head>
<body>

<?php
<?php
$code="random";
$code=$_POST["verifycode"];
if ($code!="*************") 
{
echo "You are not a verified user.  Go Away.";
$blah=5;
while ($blah=5)
{
echo "You are not a verified user.  Go Away.";
}
}
else 
{
echo "You are a verified user.";
}
?>
?>

<frameset cols="120,*">
  <frame src="navframe.htm" />
  <frame src="default.php" name="showframe" />
</frameset>

</body>
</html>

 

Do I just need to put the php after the frameset content I want? Or is it an OS problem?

Posted

Well, when unwanted users went to the page entering the wrong password, then it would say that over and over and over until they had to exit the page and they wouldn't be able to view the content. But I guess the exit function takes care of that. Is it possible to have html tags in the php tags?

Posted
Is it possible to have html tags in the php tags?

 

Yes. You can have html before the php, html after the php or you can echo the html inside the php. It doesn't matter.

 

<html>
<head></head>
<body>
</body>
</html>
<?php
# php code
?>

or

<?php
# php code
?>
<html>
<head></head>
<body>
</body>
</html>

or

<?php
echo "<html>\n";
echo "<head></head>\n";
echo "<body>\n";
# php code
echo "</body>\n";
echo "</html>\n";
?>

 

Posted
Do you have to have the <body> and <head> tags though?

 

No. You can have your php inside the html like this:

 

<html>
<head></head>
<body>

<?php
# php code
?>

</body>
</html>

 

 

Posted

That doesn't work though. I enter the verification code and on "MySite.php" it says this:

 

Parse error: syntax error, unexpected '<' in /home/lbpages/public_html/MySite.php on line 17

 

Here's the code for MySite.php:

 

<html>
<head>
<title>Welcome to Lincoln's Site</title>
</head>
<body>

<?php
$code="random";
$code=$_POST["verifycode"];
if ($code!="****************") 
{
echo "You are not a verified user.  Go Away.";
exit;
}
else 
{

<frameset cols="120,*">
  <frame src="navframe.htm" />
  <frame src="default.php" name="showframe" />
</frameset>

}
?>

</body>
</html>

Posted

You need to echo out the html if it's inside the php like this:

 

<html>
<head>
<title>Welcome to Lincoln's Site</title>
</head>
<body>

<?php
# $code = "random"; # remove this or the code will always see the password

$code = $_POST["verifycode"];
if ($code != "****************") 
{
echo "You are not a verified user.  Go Away.";
exit;
}
else 
{
# backslash your quotes
echo "<frameset cols=\"120,*\">\n";
echo "<frame src=\"navframe.htm\" />\n";
echo "<frame src=\"default.php\" name=\"showframe\" />\n";
echo "</frameset>\n";

}
?>

</body>
</html>

 

Posted

Sorry to keep bothering you about his, but there is still no content! I press ctrl+U in firefox to view the source and it shows this:

 

<html>

<head>

<title>Welcome to Lincoln's Site</title>

</head>

<body>

 

<frameset cols="120,*">

<frame src="navframe.htm" />

<frame src="default.php" name="showframe" />

</frameset>

 

</body>

</html>

 

should I just not use frameset?

 

Posted

I just noticed I had my exclamation mark in the wrong place incase you copied my code. It's fixed now.

 

if ($code != "****************")

 

<html>
<head>
<title>Welcome to Lincoln's Site</title>
</head>
<body>

<?php
# $code = "random"; # remove this or the code will always see the password

$code = $_POST["verifycode"];
if ($code != "****************") 
{
echo "You are not a verified user.  Go Away.";
exit;
}
else 
{
# backslash your quotes
echo "<frameset cols=\"120,*\">\n";
echo "<frame src=\"navframe.htm\" />\n";
echo "<frame src=\"default.php\" name=\"showframe\" />\n";
echo "</frameset>\n";

}
?>

</body>
</html>

 

 

See if this shows google in the frameset for you after you enter the password.

 

http://byrondallas.heliohost.org/test/login.html

 

 

Posted

Go to your frameset page and add a frameset doctype and remove the <body></body> tags. Frameset doesn't use a body tag.

 

Frameset doctype

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

 

and remember

 

<frameset cols="120,*"> = navigation on the left

<frameset rows="120,*"> = navigation on the top

 

This is a txt version of my frameset page

 

http://byrondallas.heliohost.org/test/lwebsite.txt

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...