Jump to content

adamriley

Members
  • Posts

    122
  • Joined

  • Last visited

    Never

Everything posted by adamriley

  1. Hi could someone say why its not working index1.php (used to check username & password & id) <?php $name = $_POST['name']; $pass = $_POST['pass']; $id = $_POST['id']; if ($name == '4' && $pass =='5' && $id == '6'){ ?> <html> <body> <h1>admin</h1> </body> </html> <?php }elseif ($name == '1' && $pass =='2' && $id == '3'){ ?> <html> <body> <h1>user:nathan</h1> </body> </html> <?php }else{ /* OPEN PHP FOR THE ELSE THEN CLOSE IT FOR HTML AGAIN */ ?> <html> <body> <center><h1>wrong password or user</h1></center> </body> </html> <?php } // OPEN PHP AGAIN FOR THE CLOSING BRACE?> -------------------------------------------------------------------------------------------------- index.php (Used to enter the username and password ) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Untitled Page</title> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Form1" style="position:absolute;left:198px;top:102px;width:467px;height:200px;z-index:3;" align="left"> <form name="Form1" method="POST" action="index1.php" id="Form1"> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:127px;top:159px;width:75px;height:24px;font-family:Arial;font-size:13px;z-index:0"> <input type="text" id="Editbox2" style="position:absolute;left:7px;top:77px;width:395px;font-family:Courier New;font-size:16px;z-index:1" name="pass" value=""> <input type="text" id="Editbox3" style="position:absolute;left:8px;top:113px;width:396px;font-family:Courier New;font-size:16px;z-index:2" name="id" value=""> </form> </div> <input type="text" id="Editbox1" style="position:absolute;left:202px;top:147px;width:399px;font-family:Courier New;font-size:16px;z-index:4" name="name" value=""> <div id="bv_Text1" style="position:absolute;left:309px;top:25px;width:305px;height:32px;z-index:5;" align="left"> <font style="font-size:27px" color="#000000" face="Arial"><b> </b></font><font style="font-size:27px;background-color:#0000FF" color="#FF0000" face="Arial"><b><u>Shot factory login</u></b></font></div> </body> </html> ----------------------------------------------------------------------------------------------- error log ||[Mon Jan 25 18:20:42 2010] [error] [client 127.0.0.1] PHP Notice: Undefined index: name in C:\\web\\htdocs\\factory\\index1.php on line 2, referer: http://localhost/factory/|| -----------------------------------------------------------------------------------------
  2. Hi to start with i know i have forgotten something but dont know what could some one tell me please error log ------------------------------------------------------------------------ [sat Jan 23 18:54:03 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected $end in C:\\web\\htdocs\\Files\\change\\adam1.php on line 40 -------------------------------------------------------------------------- Form.html ----------------------------------------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Untitled Page</title> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Form1" style="position:absolute;left:33px;top:34px;width:341px;height:150px;z-index:2;" align="left"> <form name="Form1" method="POST" action="adam1.php" id="Form1"> <input type="text" id="Editbox1" style="position:absolute;left:25px;top:24px;width:150px;font-family:Courier New;font-size:16px;z-index:0" name="adam" value=""> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:62px;top:69px;width:75px;height:24px;font-family:Arial;font-size:13px;z-index:1"> </form> </div> </body> </html> ---------------------------------------------------------------------------------- adam1.php --------------------------------------------------------------- <?php $a1 = $_POST["adam"]; // Assign all HTML code within one single variable. // All variables within HERDOC will be parsed if ($a1 == 'on'){ /* CLOSE PHP HERE BECAUSE WE WANT TO OUTPUT HTML */ $stringData = <<<HTMLCODE ?> <html> <head> <title>Your interact is on</title> <body> <h1>interact is now turned on</h1> </body> </html> <?php HTMLCODE; $myFile = "adam.html"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, "\n"); fwrite($fh, "$stringData\n"); fclose($fh); }else{ /* OPEN PHP FOR THE ELSE THEN CLOSE IT FOR HTML AGAIN */ ?> $stringData = <<<HTMLCODE <html> <head> <title>Your interact is off</title> <body> <h1>interact is now turned off</h1> </body> </html> <?php HTMLCODE; $myFile = "adam.html"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, "\n"); fwrite($fh, "$stringData\n"); fclose($fh); <?php } } // OPEN PHP AGAIN FOR THE CLOSING BRACE ?>
  3. Hi this script used to work and i think that i must of changed it wrongly url "index.php?a=form&b=php&c=1" index.php ---------------------------------- <?php $directories = array(1=>'1'); if (isset($_GET['a']) && isset($_GET['b']) && isset($_GET['c']) && $_GET['c'] !='' && $_GET['a'] != '' && $_GET['b'] != '') { $a = $_GET['a']; $b = $_GET['b']; $c = $_GET['c']; if (!isset($directories[$c]) && !@include($directories[$c].'/'.$a.'.'.$b)) { echo 'Page you are requesting doesnt exist'; } } else { include ('error.php'); } ?>
  4. Hi thanks it now works and it is defined in the file called "variables.php" that i displayed in my first post
  5. Hi is there a away to do this The bit that is wrong is the variable called "url_login" what i get it takes you to a 404 "The requested URL /Login/$url_login was not found on this server." Part of variables.php ------------------------------------------------------------------------------------------- $url_login ="http://localhost/Change/" ------------------------------------------------------------------------------------------- Loginwrite.php -------------------------------------------------------- <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/Login/common.php';?> <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/Variables.php';?> <?php $username = $_SESSION['userName']; $Date = date("F j, Y, g:i a"); $Login_page_file = fopen("Logindateabace.txt","a"); fwrite($Login_page_file, "$username:$Date\r\n"); fclose($Login_page_file);?> header('Location: $url_login'); ---------------------------------------------------------
  6. Im sorry that you dont understand me i will try and explain it much as i can ||| All together there is two pages one called "menu" which contains a menu the second page contains a link to to the menu page. ___________________ -------------------__________________------------------- what happens is the page with the link to the menu opens the menu in a pop up ----------------------------___________________--------------------------------------___________________ the bit i now want is when the user clicks on a link in via the menu page it changes the page that i used to open up the menu to change instead of the menu itself
  7. Hi could you say why this script is not working error log ---------------------------------------------------------------------------------------------------------------- [Mon Jan 11 18:08:25 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected T_SL in C:\\web\\htdocs\\Files\\contact.php on line 7, referer: http://localhost/Files/contactform.php -------------------------------------------------------------------------------------------------------------- Form.php ------------------------------------------------------------------------------------------ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Untitled Page</title> <script language="JavaScript" type="text/javascript"> <!-- function ValidateForm1(theForm) { if (theForm.Editbox1.value.length < 4) { alert("It look like you have not deleted the type of reason why your contacting make sure there is a minimum of 4 and a maximum of 5"); theForm.Editbox1.focus(); return false; } if (theForm.Editbox1.value.length > 5) { alert("It look like you have not deleted the type of reason why your contacting make sure there is a minimum of 4 and a maximum of 5"); theForm.Editbox1.focus(); return false; } return true; } //--> </script> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Table1" style="position:absolute;left:89px;top:10px;width:600px;height:74px;background-color:#FF0000;z-index:3;" align="left"> <table width="100%" cellpadding="0" cellspacing="1" style="border:5px #0000FF groove;" id="Table1"> <tr> <td align="left" valign="top" bgcolor="#FF0000" width="588" height="62" style="border:1px #0000FF dotted;"> </td> </tr> </table></div> <div id="bv_Text1" style="position:absolute;left:160px;top:31px;width:442px;height:32px;z-index:4;" align="left"> <font style="font-size:27px" color="#000000" face="Arial"><b>Report a bug or your comments</b></font></div> <div id="bv_Table2" style="position:absolute;left:25px;top:88px;width:844px;height:368px;background-color:#FFFF00;z-index:5;" align="left"> <table width="100%" cellpadding="0" cellspacing="1" border="5" bordercolor="#00FF00" id="Table2"> <tr> <td align="left" valign="top" bgcolor="#FFFF00" width="832" height="356" style="border:1px #00FF00 solid;"> </td> </tr> </table></div> <div id="bv_Form1" style="position:absolute;left:30px;top:106px;width:825px;height:326px;z-index:6;" align="left"> <form name="Form1" method="POST" action="contact.php" id="Form1" onsubmit="return ValidateForm1(this)"> <input type="text" id="Editbox1" style="position:absolute;left:11px;top:17px;width:798px;border:5px #0000FF groove;background-color:#FFFF00;color:#FF0000;font-family:Courier New;font-weight:bold;font-style:italic;font-size:24px;z-index:0" name="type" value="Reason for contacting "Error" / "comment" Delete!! 1" maxlength="5" accesskey="1"> <textarea name="Comment" id="TextArea1" style="position:absolute;left:25px;top:62px;width:752px;height:202px;border:6px #0000FF groove;background-color:#FF0000;color:#FFFF00;font-family:Courier New;font-weight:bold;font-style:italic;font-size:16px;z-index:1" rows="9" cols="70">Type any comments or more infomation about the error you found </textarea> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:294px;top:271px;width:199px;height:41px;border:5px #32CD32 inset;background-color:#800080;color:#FF6820;font-family:Arial;font-weight:bold;font-size:27px;z-index:2"> </form> </div> </body> </html> ----------------------------------------------------------- contact.php ------------------------------------------------------- <?php $a1 = $_POST["type"]; $a2 = date("F j, Y, g:i a"); $a3 = $_POST["Comment"]; // Assign all HTML code within one single variable. // All variables within HERDOC will be parsed $stringData = <<<HTMLCODE; $a1|$a2|$a3; HTMLCODE; $myFile = "1221.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); fwrite($fh, "\n"); fwrite($fh, "$stringData\n"); fclose($fh); ?>
  8. Hi this is an new error but the error is the same! ----------------------------------------------------------------------------------------------------- error log "[sat Jan 09 18:49:32 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected T_VARIABLE in C:\\web\\htdocs\\Filey\\2.php on line 12, referer: http://localhost/Filey/1.php" ----------------------------------------------------------------------------------------------------------- 2.php ---------------------------------------------------------------------------------------------------- <?php $a1 = $_POST["PN"]; $a2 = $_POST["Date_name"]; $a3 = $_POST["Note"]; $filler1 = "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">"; $filler2 = "<html"; $filler2 = "<head>"; $filler3 = "<meta http-equiv='Content-Type' content='text/html; charset=ISO-8859-1'>"; $filler4 = "<title>$a1</title>"; $filler5 = "</head>"; $filler6 = "<body bgcolor="#FFFFFF" text="#000000">"; $filler7 = "<div id="bv_Text1" style="position:absolute;left:34px;top:34px;width:713px;height:32px;z-index:0;" align="left">"; $filler8 = "<font style="font-size:27px" color="#000000" face="Arial"><b>Note name:$a1</b></font></div>"; $filler9 = "<div id="bv_Text2" style="position:absolute;left:12px;top:76px;width:781px;height:32px;z-index:1;" align="left">"; $filler10 = "<font style="font-size:27px" color="#000000" face="Arial"><b>Date and time:$a2</b></font></div>"; $filler11 = "<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:41px;top:134px;width:743px;height:391px;font-family:Courier New;font-size:16px;z-index:2" rows="20" cols="70" readonly="readonly">$a3</textarea>"; $filler12 = "</body>"; $filler13 = "</html>"; $myFile = "notenw.html"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "$filler1"; $stringData1 = "$filler2"; $stringData2 = "$filler3"; $stringData3 = "$filler4"; $stringData4 = "$filler5"; $stringData5 = "$filler6"; $stringData6 = "$filler7"; $stringData7 = "$filler8"; $stringData8 = "$filler9"; $stringData9 = "$filler10"; $stringData10 = "$filler11"; $stringData11 = "$filler12"; $stringData12 = "$filler13"; fwrite($fh, "\n"); fwrite($fh, "$stringData1\n"); fwrite($fh, "$stringData2\n"); fwrite($fh, "$stringData3\n"); fwrite($fh, "$stringData4\n"); fwrite($fh, "$stringData5\n"); fwrite($fh, "$stringData6\n"); fwrite($fh, "$stringData7\n"); fwrite($fh, "$stringData8\n"); fwrite($fh, "$stringData9\n"); fwrite($fh, "$stringData10\n"); fwrite($fh, "$stringData11\n"); fwrite($fh, "$stringData12\n"); fclose($fh); ?>
  9. Hi ---------------------------------------------------------------------------------------------------------------- error log "[sat Jan 09 18:27:58 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected T_STRING in C:\\web\\htdocs\\Filey\\2.php on line 8 " ----------------------------------------------------------------------------------------------------------------- 2.php <?php $a1 = $_POST["PN"]; $a2 = $_POST["Date_name"]; $a3 = $_POST["Note"]; $filler1 = "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">"; $filler2 = "<html"; $filler2 = "<head>"; $filler3 = "<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">"; $filler4 = "<title>$a1</title>"; $filler5 = "</head>"; $filler6 = "<body bgcolor="#FFFFFF" text="#000000">"; $filler7 = "<div id="bv_Text1" style="position:absolute;left:34px;top:34px;width:713px;height:32px;z-index:0;" align="left">"; $filler8 = "<font style="font-size:27px" color="#000000" face="Arial"><b>Note name:$a1</b></font></div>"; $filler9 = "<div id="bv_Text2" style="position:absolute;left:12px;top:76px;width:781px;height:32px;z-index:1;" align="left">"; $filler10 = "<font style="font-size:27px" color="#000000" face="Arial"><b>Date and time:$a2</b></font></div>"; $filler11 = "<textarea name="TextArea1" id="TextArea1" style="position:absolute;left:41px;top:134px;width:743px;height:391px;font-family:Courier New;font-size:16px;z-index:2" rows="20" cols="70" readonly="readonly">$a3</textarea>"; $filler12 = "</body>"; $filler13 = "</html>"; $myFile = "notenw.html"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "$filler1"; $stringData1 = "$filler2"; $stringData2 = "$filler3"; $stringData3 = "$filler4"; $stringData4 = "$filler5"; $stringData5 = "$filler6"; $stringData6 = "$filler7"; $stringData7 = "$filler8"; $stringData8 = "$filler9"; $stringData9 = "$filler10"; $stringData10 = "$filler11"; $stringData11 = "$filler12"; $stringData12 = "$filler13"; fwrite($fh, "\n"); fwrite($fh, "$stringData1\n"); fwrite($fh, "$stringData2\n"); fwrite($fh, "$stringData3\n"); fwrite($fh, "$stringData4\n"); fwrite($fh, "$stringData5\n"); fwrite($fh, "$stringData6\n"); fwrite($fh, "$stringData7\n"); fwrite($fh, "$stringData8\n"); fwrite($fh, "$stringData9\n"); fwrite($fh, "$stringData10\n"); fwrite($fh, "$stringData11\n"); fwrite($fh, "$stringData12\n"); fclose($fh); ?>
  10. hi ---------------------------------------------------------------------------------------------------- error log "[sat Jan 09 17:40:00 2010] [error] [client 127.0.0.1] PHP Notice: Undefined variable: a1 in C:\\web\\htdocs\\Filey\\2.php on line 2, referer: http://localhost/Filey/1.php" "[sat Jan 09 17:40:00 2010] [error] [client 127.0.0.1] PHP Notice: Undefined variable: a3 in C:\\web\\htdocs\\Filey\\2.php on line 3, referer: http://localhost/Filey/1.php" "[sat Jan 09 17:40:00 2010] [error] [client 127.0.0.1] PHP Notice: Undefined variable: a2 in C:\\web\\htdocs\\Filey\\2.php on line 4, referer: http://localhost/Filey/1.php" --------------------------------------------------------------------------------------------------- 2.php ---------------------------------------------------------------------------------------------------- php $filler1 = "<html><head><title>$a1</title>"; $filler2 = "<body>$a3"; $filler3 = "<div>$a2</div></body></html>"; $a1 = $_POST["PN"]; $a2 = $_POST["Date_name"]; $a3 = $_POST["Note"]; $myFile = "notenw.html"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "$filler1"; $stringData1 = "$filler2"; $stringData2 = "$filler3"; fwrite($fh, "$stringData\n"); fwrite($fh, "$stringData1\n"); fwrite($fh, "$stringData2\n"); fclose($fh); ?> ------------------------------------------------------------------------------------------------- 1.php <?php require_once $_SERVER['DOCUMENT_ROOT'] . '/Login/common.php';?> <?php if ($_SESSION['userName'] == 'Adamriley') { $name = 'Adam lee riley';} else { $name = 'Nathan Warburton';} ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Untitled Page</title> <script language="JavaScript" type="text/javascript"> <!-- function ValidateForm1(theForm) { var strFilter = /^[A-Za-zƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-]*$/; var chkVal = theForm.TextArea1.value; if (!strFilter.test(chkVal)) { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } if (theForm.TextArea1.value == "") { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } if (theForm.TextArea1.value.length < 2) { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } if (theForm.TextArea1.value.length > 100) { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } return true; } //--> </script> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Form1" style="position:absolute;left:58px;top:59px;width:704px;height:356px;z-index:5;" align="left"> <form name="Form1" method="POST" action="2.php" id="Form1" onsubmit="return ValidateForm1(this)"> <input type="text" id="Editbox2" style="position:absolute;left:94px;top:36px;width:483px;font-family:Courier New;font-size:16px;z-index:0" name="Date_name" value="<?php echo date("F j, Y, g:i a"); ?> || <?php echo $name ?>" readonly="readonly"> <input type="text" id="Editbox1" style="position:absolute;left:93px;top:4px;width:489px;font-family:Courier New;font-size:16px;z-index:1" name="PN" value="Page name (title)"> <textarea name="Note" id="TextArea1" style="position:absolute;left:81px;top:63px;width:547px;height:215px;font-family:Courier New;font-size:16px;z-index:2" rows="10" cols="51"></textarea> <input type="submit" id="Button1" name="Button1" value="Save changes" style="position:absolute;left:336px;top:293px;width:194px;height:41px;border:3px #98FB98 solid;background-color:#0000FF;color:#FFFF00;font-family:Bookman Old Style;font-size:27px;z-index:3"> <input type="reset" id="Button2" name="Reset" value="Reset note" style="position:absolute;left:158px;top:291px;width:167px;height:44px;border:3px #FFFF00 dotted;background-color:#00FF00;color:#FF0000;font-family:Arial;font-size:27px;z-index:4"> </form> </div> <div id="bv_Text1" style="position:absolute;left:334px;top:9px;width:150px;height:32px;z-index:6;" align="left"> <font style="font-size:27px" color="#FF0000" face="Arial"><b>New note</b></font></div> </body> </html>
  11. so how would you "require_once" a file if you was on "http://localhost/Filey/2.php" and you want to require "http://localhost/Login/common.php" what would put as the url
  12. hi im having a little trobble with this script -------------------------------------------------------------------------------------------- error log -------------------------------------------------------------------------------------------- [sat Jan 09 17:00:16 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in C:\\web\\htdocs\\Filey\\create.php on line 5 ------------------------------------------------------------------------------------------------ create.php --------------------------------------------------------------------------------------------- <?php $filler1 = "<html><head><title>$1</title>"; $filler2 = "<body>$3</body></html>"; $filler3 = "<div>$2</div>"; $1 = $_POST["PN"]; $2 = $_POST["Date_name"]; $3 = $_POTS["Note"]; $myFile = "notenw.html"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "$filler1"; $stringData1 = "$filler2"; $stringData2 = "$filler3"; fwrite($fh, "$stringData\n"); fwrite($fh, "$stringData1\n"); fwrite($fh, "$stringData2\n"); fclose($fh); header('Location: http://localhost/Docs/$myfile'); ?> code for 1.php ----------------------------------------------------------------------------------------------------------- <?php require_once('http://localhost/Login/common.php');?> <?php if ($_SESSION['userName'] == 'Adamriley') { $name = 'Adam lee riley';} else { $name = 'Nathan Warburton';} ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Untitled Page</title> <script language="JavaScript" type="text/javascript"> <!-- function ValidateForm1(theForm) { var strFilter = /^[A-Za-zÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-]*$/; var chkVal = theForm.TextArea1.value; if (!strFilter.test(chkVal)) { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } if (theForm.TextArea1.value == "") { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } if (theForm.TextArea1.value.length < 2) { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } if (theForm.TextArea1.value.length > 100) { alert("In your note you may only have a maximum of 100 letters"); theForm.TextArea1.focus(); return false; } return true; } //--> </script> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Form1" style="position:absolute;left:58px;top:59px;width:704px;height:356px;z-index:5;" align="left"> <form name="Form1" method="POST" action="create.php" id="Form1" onsubmit="return ValidateForm1(this)"> <input type="text" id="Editbox2" style="position:absolute;left:94px;top:36px;width:483px;font-family:Courier New;font-size:16px;z-index:0" name="Date_name" value="<?php echo date("F j, Y, g:i a"); ?> || <?php echo $name ?>" readonly="readonly"> <input type="text" id="Editbox1" style="position:absolute;left:93px;top:4px;width:489px;font-family:Courier New;font-size:16px;z-index:1" name="PN" value="Page name (title)"> <textarea name="Note" id="TextArea1" style="position:absolute;left:81px;top:63px;width:547px;height:215px;font-family:Courier New;font-size:16px;z-index:2" rows="10" cols="51"></textarea> <input type="submit" id="Button1" name="Button1" value="Save changes" style="position:absolute;left:336px;top:293px;width:194px;height:41px;border:3px #98FB98 solid;background-color:#0000FF;color:#FFFF00;font-family:Bookman Old Style;font-size:27px;z-index:3"> <input type="reset" id="Button2" name="Reset" value="Reset note" style="position:absolute;left:158px;top:291px;width:167px;height:44px;border:3px #FFFF00 dotted;background-color:#00FF00;color:#FF0000;font-family:Arial;font-size:27px;z-index:4"> </form> </div> <div id="bv_Text1" style="position:absolute;left:334px;top:9px;width:150px;height:32px;z-index:6;" align="left"> <font style="font-size:27px" color="#FF0000" face="Arial"><b>New note</b></font></div> </body> </html>
  13. i changed it and now it does not work again create.php ---------------------------------------------------- <?php $head1 = "<html>"; $head2 = "<head>"; $head3 = "<title>"; $head4 = "</title>"; $head5 = "</head>"; $head6 = "</html>"; $hell = $_POST["fname"]; $myFile = "html.html"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "$head1"; $stringData2 = "$head2"; $stringData3 = "$head3"; $stringData4 = "$hell"; $stringData5 = "$head4"; $stringData6 = "$head5"; $stringData7 = "$head6"; fwrite($fh, $stringData\n); fwrite($fh, $stringData2\n); fwrite($fh, $stringData3\n); fwrite($fh, $stringData4\n); fwrite($fh, $stringData5\n); fwrite($fh, $stringData6\n); fwrite($fh, $stringData7\n); fclose($fh); ?> ----------------------------------------------- Form.php <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Untitled Page</title> <meta name="GENERATOR" content="Created by BlueVoda"> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Form1" style="position:absolute;left:33px;top:35px;width:669px;height:388px;z-index:2;" align="left"> <form name="Form1" method="POST" action="create.php" id="Form1"> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:264px;top:336px;width:75px;height:24px;font-family:Arial;font-size:13px;z-index:0"> <input type="text" id="Editbox1" style="position:absolute;left:62px;top:110px;width:533px;font-family:Courier New;font-size:16px;z-index:1" name="fname" value=""> </form> </div> </body> </html>
  14. Ok im new to php and am trying to make this script to work If it helps the error i get is "PHP Parse error: syntax error, unexpected T_VARIABLE in C:\\web\\htdocs\\Filey\\create.php on line 3" ------------------------------------------------------------- form.php --------------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Form</title> </head> <body bgcolor="#FFFFFF" text="#000000"> <div id="bv_Form1" style="position:absolute;left:34px;top:34px;width:669px;height:221px;z-index:2;" align="left"> <form name="Form1" method="POST" action="create.php" id="Form1"> <input type="text" id="Editbox1" style="position:absolute;left:24px;top:24px;width:565px;font-family:Courier New;font-size:16px;z-index:0" name="fname" value="name1"> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:266px;top:126px;width:75px;height:24px;font-family:Arial;font-size:13px;z-index:1"> </form> </div> </body> </html> ------------------------------- code for create.php --------------------------------------- <?php $hell = $_POST["fname"] $myFile = "t.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "$hell\n"; fwrite($fh, $stringData); fclose($fh); ?> ------------------------------------------------------------
  15. hi could someone tell me if it is posible to the following thing ------------------------------------------------------------------------------------------------------------- Pages 2 1.Open (used to open the menue) 2.Menue The user should click on the link in the "Open" page which opens up the menue The bit that im stuck on is when the user clicks on a link it changes the page 2 (menue) Which should change page 1 (Open) i tryed to use "_parent" any idears how to do it
  16. Hi couuld someone say why its not working It writes "|" to the text file "Enter.txt" code for "form.html" --------- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Input Form</title> </head> <body> <form name="Form1" method="POST" action="forma.php" enctype="text/plain" id="Form1" name="inputform"> <input type="submit" id="Button1" name="Button1" value="Submit" style="position:absolute;left:249px;top:83px;width:75px;height:25px;font-family:Arial;font-size:13px;z-index:2"> <input type="text" id="Editbox1" style="position:absolute;left:63px;top:21px;width:499px;color:#FF0000;font-family:Courier New;font-size:27px;z-index:3" name="Adam" value=""> </form> </body> </html> ---------- code for "forma.php" <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { $field1 = $_POST['Adam'] ; $f=fopen("Enter.txt","a"); fwrite($f,"$field1|\r\n"); fclose($f); } header("Location: form.html") ?>
  17. im new to php and this does not work any reason why not The error i get is "[sat Jan 02 15:53:37 2010] [error] [client 127.0.0.1] PHP Parse error: syntax error, unexpected '<' in C:\\web\\htdocs\\test1.php on line 6" <?php require_once('common.php'); checkUser(); ?> <?php if ($_SESSION['userName'] == 'Adamriley'){ <html> <head> <title>adam lee riley</title> </head> <body> </body> </html> }else{ <html> <head> <title>Nathan warburton</title> </head> <body> </body> </html> } ?>
  18. Ok to start with there is a variable called "$username" what i want is to see if the variable is got the value of "ar" which would show a html page but if the username is anything else i would like to "header" the user to a different page using if and else statements
  19. Hi could someone tell me if this is posible what i need is for example there is a variable named ($username) what i want is to display the users name which would be ($name) there are two users all together how would you do this by doing something like "if $username == adamriley $fullname =adam lee riley else $fullname=nathan" i have tryed the above but Im new to php Im really sorry for not using the code tags but im on a mobile
×
×
  • 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.