Jump to content

frameset problems


Recommended Posts

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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";
?>

 

Link to comment
Share on other sites

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>

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.   Paste as plain text instead

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