473,890 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

My code doesnt work :(

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


<?php
$pagetitle="Log in";
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>$pagetit le</title>
<body>
<form name=\”form1\” method=\”post\” action=\”home.c ms.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>$pagetit le</title>
<body>
<form name=\”form1\” method=\”post\” action=\”home.c ms.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 2100
Rhys.Mataira
3 New Member
I figured it out as i posted :| very sorry

if statements were not correct
Jun 12 '06 #2
Rhys.Mataira
3 New Member
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=\"smallfo nt\">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\">$li ne[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.cm s.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
1839
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
3638
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> </head> <style type="text/css">
17
2737
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 know nothing about ASP. He can build the design of the pages in HTML with tables, labels, textboxes etc. But then I would need to change them to ASP.net objects and write the code to make the page work (normally I do this as I go - can't do this...
3
2296
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 but the same code doesnt work in other form in run time it's going to skip if satatement of date part to check if month is 4 or not what is the problem ? i have looked in the net and i read somehting about reference what should i do about it .
15
1586
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 = temp.Remove(temp.IndexOf("<body>"), 6) temp = temp.Remove(temp.IndexOf("</body>"), 7)
0
1528
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 update commands set. The gridview is part of a "admin" page where the admin will view the data, then use the gridview edit/update buttons to update the data.......that all works great.
0
1652
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 application by pressing run button. but it doesnt work when we type the path directly in the browser's address bar eg. http://localhost/testapplicationdefault.aspx error it gives is "COULD NOT LOAD testapplication._default". IN default.aspx. While in...
8
1704
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 values are given they will work, but will cause a random segmentation fault. (BUT only with giving two values.) 3. -average doesnt give average. 4. -gta is ment to give all the values greater then the average. but doesnt do anything 5. -gt is ment...
5
2101
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
9976
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9814
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10801
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9616
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7158
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6034
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4659
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4257
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.