Jump to content

PHP will not display, please help


Akshay123

Recommended Posts

I am pretty new to PHP, can you please help?

Ok, thank you.

 

One quick question:

why is this not working?

 

some usual html stuff is excluded, just look for the php part

 

http://localhost/login.html

 

 

Please Log In.

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

<!-- usual header stuff goes here, excluded -->

<!-- wrap starts here -->

<div id="wrap">

<div id="header">

<div id="header-content">

<h1 id="site_heading"><a href="index.php" title="">Maahi<span class="gray">Network</span></a></h1>

<h2 id="site_subheading"><span><!-- here comes the spaces --> By AKSHAY                                                                                                        

 

<!-- this php part works, keep reading -->

 

<?php

if (isset($_COOKIE["LOGIN"])){

include('/oauth/login/CookieHeaderHTML.php');

}else{

include('/oauth/login/NoCookieHeaderHTML.html');

}

?>

<!-- Menu Tabs -->

<!-- unimportant stuff excluded, basic html -->

 

 

<!-- part that doesn't work below, shows up blank -->

 

 

 

<!-- troublesome part -->

<!-- below is where the login form http://localhost/oauth/login/login.php (mentioned before) is framed -->

<!-- again, the '/oauth/login/login.php?error=incorrect' displays a special form with a error message -->

<h1>Please Log In:</h1>

<?php

if(isset($_GET['ERROR'])){

echo "<html>";

echo "<iframe src ="/oauth/login/login.php?error=incorrect" width="35%" height="400" frameborder="no" scrolling="no">";

}

else

{

echo "<html>";

echo "<iframe src ="/oauth/login/login.php?" width="35%" height="400" frameborder="no" scrolling="no">";

}

?>

<!-- wierdly enough, anything after this iframe doesn't show up. it shows up on the browser html source code, but not on the page. -->

  <br><br><br>

<!-- content-wrap ends here -->

<!-- footer starts here -->

<div id="footer">

<div id="footer-content">

<div id="footer-bottom">

<br>

<p> <a href="/">Home</a> | <a href="/terms">Terms and Conditions</a> | <a href="/#top">Top</a> | <a href="/?mobileoveride=1">Switch to Mobile Version</a></p>

<div id="copyright">

<p>© AKSHAY</p>

</div>

<div id="powered_by"><!-- This design is released under Creative Commons Attribution 2.5 License (http://creativecommons.org/licenses/by/2.5/) - Please leave the theme attribution intact -->

<a href="http://vivi" style="text-decoration: none;"><img

src="/assets/viviti/viviti_icon.png"

alt="Powered by AKSHAY"

style="margin-right: 2px; vertical-align: middle;" height="16"

width="16"></a>  ~

Designed by <a href="http://styleshout.com">styleshout.com</a> </div>

</div>

</div>

</div>

<!-- footer ends here --><!-- wrap ends here -->

</body>

</html>

 

 

anyway, what happens when I go to "http://localhost/login.html?error=0", "http://localhost/login.html?error=1", "http://localhost/login.html?error=", and "http://localhost/login.html" is all the same. A empty spot is just there where the iframe is supposed to be.

 

any help would be appreciated. thank you in advance...

Link to comment
https://forums.phpfreaks.com/topic/205514-php-will-not-display-please-help/
Share on other sites

You've tried to use unescaped double quotes in a double quoted string. You can either escape them, or change the enclosing quotes to single quotes.

 

if(isset($_GET['ERROR'])){
echo "<html>";
echo "<iframe src ="/oauth/login/login.php?error=incorrect" width="35%" height="400" frameborder="no" scrolling="no">";
}

I don't understand, should I write the code like this, in single quotes?

 

<?php
if(isset($_GET['ERROR'])){
echo '<iframe src="/oauth/login/login.php?error=incorrect" width="35%" height="400" frameborder="no" scrolling="no">';
}
else
{
echo '<iframe src="/oauth/login/login.php?" width="35%" height="400" frameborder="no" scrolling="no">';
}
?>

 

when I use this code, the second iframe shows up, followed by a bunch of characters from the php code, like this

'; } else { echo ' appearing in regular font

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.