473,394 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

My code doesnt work :(

My code will not show up anything at all on the screen can someone guide me why this would be?


<?php
$pagetitle="Login";
If (!$_POST['pass']) or (!$_POST['user']) {
echo"
<head></head>
<style type=\”text/css\”>
<!--
.style1 {
font-family: Tahoma, \”High Tower Text\”, fantasy;
font-size: large;
}
-->
</style>
<title>$pagetitle</title>
<body>
<form name=\”form1\” method=\”post\” action=\”home.cms.php\”>
Username
<input type=\”text\” name=\”user\”>
<br>
<br>
Password
<input type=\”password\” name=\”pass\”>
<br>
<br>
Submit
<input type=\”submit\” name=\”Submit\” value=\”Submit\”>
</form>
<p>&nbsp;</p>
</body>
</html>";
elseif ($_POST['pass'] == "PASSWORD")&&($_POST['user'] == "USER") {
print "success";
// For testing purposes
}
else {
echo"
<head></head>
<style type=\”text/css\”>
<!--
.style1 {
font-family: Tahoma, \”High Tower Text\”, fantasy;
font-size: large;
}
-->
</style>
<title>$pagetitle</title>
<body>
<form name=\”form1\” method=\”post\” action=\”home.cms.php\”>
Username
<input type=\”text\” name=\”user\”>
<br>
<br>
Password
<input type=\”password\” name=\”pass\”>
<br>
<br>
Submit
<input type=\”submit\” name=\”Submit\” value=\”Submit\”>
</form>
<p>&nbsp;</p>
</body>
</html>";
}
?>
Jun 12 '06 #1
2 2083
I figured it out as i posted :| very sorry

if statements were not correct
Jun 12 '06 #2
My code will not work again, i only started codeing php about 2 days ago, so sorry for my posts.

The code was working but i must of changed something and now it wont work. Help would be greatly apperciated

<?php
$login = "false";
if ($_POST['pass']=="pass" && $_POST['user']=="user") {
print "success";
global $login;
$login = "true";
// For testing purposes
// include("a.cms.html");
if (!file_exists("news.cms.txt")) {
print "Error with news database.";
exit;
}
//file does exist
$array = file("news.cms.txt");
// $cdate = date('l dS \of F Y h:i A')
$i = 0;
foreach($array as $row) {
global i;
$line = explode("|", $row);
print "<label class=\"smallfont\">Posted by $line[0]</label>";
print "<input name=\"name$i\" type=\"text\" value=\"$line[0]\">";
print "<br />";
print "<textarea name=\"news$i\" cols=\"80\" rows=\"4\" id=\"news\">$line[1]</textarea>";
print "<br />";
print "</p>";
$i++;
}
echo "
</td>
</tr>
</table>

</form>
</tr>
</table>
</body>
</html>";
} else {
?>
<head>
<title>CMS - Login</title>
<style type=“text/css”>
<!--
.style1 {
font-family: Tahoma, “High Tower Text”, fantasy;
font-size: large;
}
-->
</style>
</head>
<body>
<form name="form1" method="post" action="home.cms.php">
Username
<input type="text" name="user">
<br>
<br>
Password
<input type="text" name="pass">
<br>
<br>
Submit
<input type="submit" name="Submit" value="Submit">
</form>
<p>&nbsp;</p>
</body>
</html>
<?
}
?>
Jun 12 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Todd Beauchemin | last post by:
Is there any documentation or reference for the Mozilla web browsers. Some of my older Netscape code doesnt work and the IE code still doesnt work :(. Thanks ~Todd
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
3
by: funfair | last post by:
Hi, I'm facing a strange problem in access 2003 i dont know how to solve it i have a code in VB which give an autonumber but in finanical new year it reset to 1 on new year it works in one form...
15
by: iwdu15 | last post by:
hi, i have these 2 code snippets: Public Sub ImRec(ByVal IM As IAccIm, ByVal Sender As IAccUser) Dim str As String = IM.GetConvertedText(DECODE) Dim temp As String = str temp =...
0
by: jmacduff | last post by:
Big question: How to enable edit/update commands to work when setting the sqldatasource select command from code behind. Details: I have a GridView using a sqldatasouce with the select and...
0
by: Juna | last post by:
I have been working in vs2003, but now started to work in vs2005 but the problem, I have simple web application not website, which work i mean open in browser when we press F5 or run the...
8
by: wastedhello | last post by:
ok. here are a list of things i cant fix. ive been trying for way to long now. 1. if more then 1000 values are told, will still continue with program. 2. if -max, min, average etc run, and 2...
5
by: slizorn | last post by:
hi, well this is the file i have to read into the system... <matrix> rows = 2 cols = 2 1 2 2 4 </matrix>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.