Jump to content

newbe123

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Everything posted by newbe123

  1. My problem is that this only works on Safari and not IE, FF!? <!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=ISO-8859-1" /> <title>JavaScript</title> <link rel="stylesheet" type="text/css" href="stilmall.css" /> <script src="validate.js" type="text/JavaScript"> </script> </head> <body> <h1>JavaScript-sida 2 </h1> <form name="frmInput" method="post" action="mailto:someone@hotmail.com" enctype="text/plain" onsubmit="return validate()"> <p> Name:<br /> <input type="text" name="txtName" size="12" /><br /> Key: (123)<br /> <input type="password" name="txtKey" size="12" /><br /> gender:<br /> <input type="radio" name="radSex" value="Male" />Male<br /> <input type="radio" name="radSex" value="Female" />Female<br /> Ålder:<br /> <select name="selAge"> <option value="">Choose age range</option> <option value="young">0-17</option> <option value="medium">18-64</option> <option value="old">65-</option> </select> <input type="submit" value="OK" /> </p> </form> </body> </html> JavaScript (alert only works on Safari!) function validate() { var returnValue = true; var name = frmInput.txtName.value; var key = frmInput.txtKey.value; var sex0 = frmInput.radSex[0].checked; var sex1 = frmInput.radSex[1].checked; var age = frmInput.selAge.selectedIndex; if (name.length == 0) { alert("Enter name"); // not working frmInput.txtName.focus(); return false; } if (key != "123") { alert("Wrong password!"); //not working frmInput.txtKey.focus(); return false; } if (!sex0 && !sex1) { alert("Enter gender!"); //not working frmInput.txtKey.focus(); return false; } if (age == 0) { alert("Enter age range"); // not working frmInput.txtKey.focus(); return false; } return true; }
  2. Why is this not working? This is what it does: you can type something into the first box, such as your name. Click on the button. This goes through the string one character at a time. .charAt (..) picks up a single character from the string. It then adds it to the front of the output string. This has the effect of reversing it. When you code a loop, you need to know how many times, and in this case it's the number of characters in the string, in other words the string length or xx.length. <HTML> <HEAD> <SCRIPT TYPE="TEXT/JAVASCRIPT"> // Reverse string function reverse() { var inp = document.rev.inpt.value var outp = 0 for (i = 0; i <= inp.length; i++) { outp = inp.charAt (i) + outp } document.reals.outpt.value = outp } </SCRIPT> </HEAD> <BODY> <FORM ACTION="#" NAME="rev"> <INPUT TYPE=TEXT NAME="inpt" SIZE=20 > <INPUT TYPE=BUTTON VALUE="Reverse" ONCLICK="reverse()"><BR> <INPUT TYPE=TEXT NAME="outpt" SIZE=20 DISABLED> </FORM> </BODY> </HTML>
  3. Thank you so much for helping me The part that I did not understand and had problem with was "the idea is that the function to calculate the area to be used inside the function perimeter, so that the perimeter function handles all printing."
  4. this is what I mean <?php if (isset($_POST['calc'])) { $length= $_POST['length']; $width= $_POST['width']; echo "length:" . $length. "<br><br>"; echo "width:" . $width. "<br><br>"; I am not allowed to give the $length = 10; $width = 5; It's like this anyone that going to see this page can give what ever length and what ever width that they want in the text-box and than enters the calculate button and gets the length, the width that he/she gave and the area and the perimeter that was calculated.
  5. Create a method called "perimeter ()" that calculates the perimeter of a rectangle. The function to receive the two parameters "long" and "width" of a form. perimeter shall then be printed on the page when the user presses a button titled "CALCULATE". Create a method called "Area ()" that calculates the area of a rectangle. Call the method "Area ()" method from within "perimeter ()", submit length and width as an argument to the method "Area ()" and use these to calculate the area. Modify Approach "perimeter () "so that it prints the perimeter and area when the user presses the button "CALCULATE". No printing will be done in Approach "Area () " It's like this that the person that visits this page is going to input any number and that presses the button calculate and than the output is like: length: the number given by the person width: the number given by the person perimeter: answer area: answer
  6. I am not allowed to give the length and the width. and I tried not to give the length and width but it did not work. It's not giving me the area and perimeter
  7. the idea is that the function to calculate the area to be used inside the function perimeter, so that the perimeter function handles all printing. This is what I've done but it's not the same as what I have mentioned above. What Should I do? This is what I want to do Create a method called "Area ()" that calculates the area of a rectangle. Call the method "Area ()" method from within "perimeter ()", submit length and width as an argument to the method "Area ()" and use these to calculate the area. Modify Approach "perimeter () "so that it prints the perimeter and area when the user presses the button "CALCULATE". No printing will be done in Approach "Area () " <body> <h1>PHP-sida 4</h1> <form action="php4.php" method="post"> <p>Längd: <input type="text" name="length" size="20" /></p> <p>Bredd: <input type="text" name="width" size="20" /></p> <p><input type="submit" value="CALCULATE" name="calc" /></p> </form> <?php if (isset($_POST['calc'])) { $length= $_POST['length']; $width= $_POST['width']; echo "length:" . $length. "<br><br>"; echo "width:" . $width. "<br><br>"; function perimeter($length, $width) { return 2* ($length+ $width); } $perimeter= perimeter($length, $width); echo "perimeter:" . $perimeter. "<br>", "<br>"; function area($length, $width) { return $length* $width; } $area = area($length, $width); echo "area:" . $area ; } ?> </body>
  8. can someone please help me with this? Please
  9. I really appreciate your help but I wonder if you could take a look at the codes below and see if my comments are right and what I've missed perhaps? Thank u so much function fetchDelicious(json) { var html = ""; / / Create variable html / / Go through all the links json pick up and populate the list for (var i = 0; i < json.length; i++) { var uri = json[i].u; var description = json[i].d; var tags = json[i].t; //array var time = json[i].dt; var author = json[i].a; / / (li do not seem to be used to create 'html', removed) var bHtml = "<li><a href=\":u\"></a>:t</li>".replace(":u", uri).replace("", description); / / Li tags with links placed in the variable bHtml var tagHtml = ""; / / TagHtml harboring tags / bookmarks for each link / / Go through all the tags / bookmarks, and populate the level-two-list for(var n = 0; n < tags.length; n++) { tagHtml += "<li><a href=\"http://delicious.com/:u\"></a></li>".replace(":u", [author,tags[n]].join("/")).replace("", tags[n]); } tagHtml = "<ul>" + tagHtml + "</ul>"; html += bHtml.replace(":t", tagHtml); / / List is created with the li-tags that contain new ul-list of tags / bookmarks } html = "<ul>" + html + "</ul>"; document.getElementById(config.deliciousTarget).innerHTML = html; }
  10. This is how I understand the codes, do not know if I am right or not? Can someone help me and see if my comments are right? function fetchDelicious(json) { var html = ""; / / Create variable html / / Go through all the links json pick up and populate the list for (var i = 0; i < json.length; i++) { var uri = json[i].u; var description = json[i].d; var tags = json[i].t; //array var time = json[i].dt; var author = json[i].a; / / (li do not seem to be used to create 'html', removed) var bHtml = "<li><a href=\":u\"></a>:t</li>".replace(":u", uri).replace("", description); / / Li tags with links placed in the variable bHtml var tagHtml = ""; / / TagHtml harboring tags / bookmarks for each link / / Go through all the tags / bookmarks, and populate the level-two-list for(var n = 0; n < tags.length; n++) { tagHtml += "<li><a href=\"http://delicious.com/:u\"></a></li>".replace(":u", [author,tags[n]].join("/")).replace("", tags[n]); } tagHtml = "<ul>" + tagHtml + "</ul>"; html += bHtml.replace(":t", tagHtml); / / List is created with the li-tags that contain new ul-list of tags / bookmarks } html = "<ul>" + html + "</ul>"; document.getElementById(config.deliciousTarget).innerHTML = html; }
  11. It is this last bit that I would like some help with. I really appreciate if someone could help me and write some comments for these codes. I would really help function fetchDelicious(json) { var html = ""; for (var i = 0; i < json.length; i++) { var uri = json[i].u; var description = json[i].d; var tags = json[i].t; //array var time = json[i].dt; //var n = json[i].n; //new? var author = json[i].a; var bHtml = "<li><a href=\":u\"></a>:t</li>".replace(":u", uri).replace("", description); var tagHtml = ""; for(var n = 0; n < tags.length; n++) { tagHtml += "<li><a href=\"http://delicious.com/:u\"></a></li>".replace(":u", [author,tags[n]].join("/")).replace("", tags[n]); } tagHtml = "<ul>" + tagHtml + "</ul>"; html += bHtml.replace(":t", tagHtml); } html = "<ul>" + html + "</ul>"; document.getElementById(config.deliciousTarget).innerHTML = html; }
  12. I'm totally new when it comes to JavaScript and I'm trying to learn new things. Here I found the codes I tried it and it works but I would like to have comments for the code to understand how they have proceeded. can someone help me and explain these codes with comments? I really appreciate it. var config = { "tags": "vfx+compositing", "user": "andreasl", "scriptTagTarget": "scriptTagDiv", "deliciousTarget": "deliciousLinks", "callbackFunction": "fetchDelicious" }; window.onload = function() { var url = 'http://feeds.delicious.com/v2/json/' + config.user + '/' + config.tags + '?callback=' + config.callbackFunction; var scriptDiv = document.getElementById(config.scriptTagTarget); addScriptTag(url, scriptDiv); }; function addScriptTag(url, scriptDiv) { if (scriptDiv.hasChildNodes()) { scriptDiv.removeChild(scriptDiv.firstChild) }; var scriptElement = document.createElement('script'); scriptElement.setAttribute('src', url); scriptDiv.appendChild(scriptElement); } function fetchDelicious(json) { var html = ""; for (var i = 0; i < json.length; i++) { var uri = json[i].u; var description = json[i].d; var tags = json[i].t; //array var time = json[i].dt; //var n = json[i].n; //new? var author = json[i].a; var bHtml = "<li><a href=\":u\"></a>:t</li>".replace(":u", uri).replace("", description); var tagHtml = ""; for(var n = 0; n < tags.length; n++) { tagHtml += "<li><a href=\"http://delicious.com/:u\"></a></li>".replace(":u", [author,tags[n]].join("/")).replace("", tags[n]); } tagHtml = "<ul>" + tagHtml + "</ul>"; html += bHtml.replace(":t", tagHtml); } html = "<ul>" + html + "</ul>"; document.getElementById(config.deliciousTarget).innerHTML = html; }
  13. I am saving my posts on file and I want to create the monthly archive for my posts. This is what I've done so far. index.php (where I want my archive to be) <?php session_start(); if(isset($_POST['LoutBtn'])) { session_unset($_SESSION); session_destroy(); } if(isset($_POST['LoginBtn'])) { //convert a string to all lower case letters. //if user gives username with big letters still can login. $user = strtolower($_POST['username']); $pass = $_POST['password']; if($user == 'admin' && $pass == '123') { $_SESSION['LogedIn'] = true; } elseif (empty($user) || empty($pass)) { print('<font color="#FF0000">Please fill in username and password!<br/></font>'); } elseif ($_POST['username'] != 'admin'){ print('<font color="#FF0000">wrong username<br/></font>'); } elseif ($_POST['password'] != '123'){ print('<font color="#FF0000">wrong password<br/></font>'); } } if (isset($_SESSION['LogedIn'])) if ($_SESSION['LogedIn'] == true) { echo 'Welcome You are Loged in.'; ?> <table width="50" align="right" cellpadding="2" cellspacing="2"> <form method="POST" action="panel.php"> <tr> <td><input type="submit" value="add post" name="PnlBtn" /></td> </tr> </form> <form method="POST" action="stat.php"> <tr> <td><input type="submit" name="showstat" value="visitorlog" /></td> </tr> </form> </table> <?php } ?> <?PHP /* define the blog content file name */ $filename = "myBlogContent.txt"; ?> <!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>Untitled Document</title> </head> <body> <form method="post" action="index.php" > <table width="300" border="1" align="right" cellpadding="2" cellspacing="2"> <tr> <td width="150">UserName:</td> <td> <input type="text" name="username" size="20" /> </td> </tr> <tr> <td width="150">Password</td> <td><input type="password" name="password" size="20" /></td> </tr> <tr> <td><input type="submit" value="Login" name="LoginBtn" /> </td> </tr> <tr> <td><input type="submit" value="Logout" name="LoutBtn" /></td> </tr> </table> </form> <!-- CONTENT DIV --> <div style="position:absolute; left: 100px; top: 100px; width: 400px;"> <?PHP /* check to see if the file exists */ if (!file_exists($filename)) { echo "The Blog Is Empty"; }else{ /* get the file lines into an array */ $BlogArray = file($filename); /* count the number of blog entries */ $count = count($BlogArray); $i= $count -1; while($i>=0) { $new_array = explode("|", $BlogArray[$i]); echo "Posted by: " . $new_array[1] . "<br>"; echo "Posted on: " . date("l m/d/y h:i:s", $new_array[0]) . "<br>"; echo "Title: " . $new_array[2] . "<br>"; echo $new_array[3] . "<hr>"; $i --; } } ?> </div> </body> </html> panel.php <?php session_start(); if ($_SESSION['LogedIn'] == false) { $redirect = "Location: " . $_REQUEST['LoginBtn'] . "index.php"; echo header($redirect); } elseif ($_SESSION['LogedIn'] == true) { echo "welcome"; } ?> <!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>Untitled Document</title> </head> <body> <form action="content.php" method="post"> <table> <tr><td>Blog entry posted by (Your name): </td><td><input type="text" name="who" size="20" maxlength="20" value=""></td></tr> <tr><td>Title of this blog entry: </td><td><input type="text" name="title" size="40" maxlength="80" value=""></td></tr> <tr><td>Content: </td><td><textarea name="content" rows="5" cols="40"></textarea></td></tr> <tr><td clospan="2"><input type="submit" value="Submit"></td></tr> </table> </form> </body> </html> <?php $page_parts = explode("/", $_SERVER['PATH_INFO']); $page_filename = $page_parts[count($page_parts)-1]; $lastpage = $_SESSION['index.php']; if ( strlen ($lastpage) == 0 ) $lastpage = "index.php"; $_SESSION['index.php'] = $page_filename; ?> <form action="<?php echo $lastpage ?>" method="post"> <table> <tr><td clospan="2"><input type="submit" value="Tillbaka" name="back" /></td></tr> </table> </form> content.php <?PHP /* obtain the form data */ $who = $_POST['who']; $title = $_POST['title']; $content = $_POST['content']; $content = str_replace(array("\r\n", "\r", "\n"), "<br>", $content); /* create timestamp variable for current date and time */ $when_ts = time(); /* define the blog content file name */ $filename = "myBlogContent.txt"; /* prepare the variables for adding to the file */ $new_line_content = $when_ts . "|" . $who . "|" . $title . "|" . $content . "\n"; /* open the file in the APPEND MODE */ $fh = fopen($filename, 'a+') or die("can't open file"); /* add the new content */ fwrite($fh, $new_line_content); /* close the file */ fclose($fh); header("Location: panel.php"); //exit; // Closes further script execution . ?>
  14. I would like some tips on how to create a monthly archive for my weblog. I am not using MySQL or any databases. Everything is saved on file. any tips or tutorials? Thanks
  15. No. no errors. The problem I am having is that I have created this blog and I have used JavaScript and now when I add a new post I want to save it on a file and than display the saved posts on index.php. I just don't know how to do that. I don't know how to use JavaScript codes in php.
  16. I have created a web log where you can log in and add new entries, etc. I'm using PHP and JavaScript. In the page where you can add new entry, I am using JavaScript, but now I want to save these records in a text file that is then displayed on the index.php page. I'm having trouble putting together JavaScript and php code. How can I do that? index.php <?php session_start(); if(isset($_POST['LoutBtn'])) { session_unset($_SESSION); session_destroy(); } if(isset($_POST['LoginBtn'])) { //convert a string to all lower case letters. //if user gives username with big letters still can login. $user = strtolower($_POST['username']); $pass = $_POST['password']; if($user == 'admin' && $pass == '123') { $_SESSION['LogedIn'] = true; } elseif (empty($user) || empty($pass)) { print('<font color="#FF0000">Please fill in username and password!<br/></font>'); } elseif ($_POST['username'] != 'admin'){ print('<font color="#FF0000">wrong username<br/></font>'); } elseif ($_POST['password'] != '123'){ print('<font color="#FF0000">wrong password<br/></font>'); } } if (isset($_SESSION['LogedIn'])) if ($_SESSION['LogedIn'] == true) { echo 'Welcome You are Loged in.'; ?> <table width="50" align="right" cellpadding="2" cellspacing="2"> <form method="POST" action="panel.php"> <tr> <td><input type="submit" value="add post" name="PnlBtn" /></td> </tr> </form> <form method="POST" action="stat.php"> <tr> <td><input type="submit" name="showstat" value="visitorlog" /></td> </tr> </form> </table> <?php } ?> <!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>Untitled Document</title> </head> <body> <form method="post" action="index.php" > <table width="300" border="1" align="right" cellpadding="2" cellspacing="2"> <tr> <td width="150">UserName:</td> <td> <input type="text" name="username" size="20" /> </td> </tr> <tr> <td width="150">Password</td> <td><input type="password" name="password" size="20" /></td> </tr> <tr> <td><input type="submit" value="Login" name="LoginBtn" /> </td> </tr> <tr> <td><input type="submit" value="Logout" name="LoutBtn" /></td> </tr> </table> <p> <input type="submit" name="this" value="Current Month" /> <input type="submit" name="prev" value="Previous Month" /> <input type="submit" name="next" value="Next Month" /> </p> </form> </body> </html> panel.php (where I can add new entry) <?php session_start(); if ($_SESSION['LogedIn'] == false) { $redirect = "Location: " . $_REQUEST['LoginBtn'] . "index.php"; echo header($redirect); } elseif ($_SESSION['LogedIn'] == true) { echo "welcome"; } ?> <!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>Untitled Document</title> <script src="bloggadd.js" type="text/JavaScript"></script> </head> <body onload="showdate()"> <form action="panel.php" method="post"> <p> Date (yyyy-mm-dd):<br /> <input type="text" name="date" id="date" size="12" /><br /><br /> Subject:<br /> <input type="text" name="header" id="header" size="12" /><br /><br /> Content:<br /> <textarea name="entry" id="entry" rows="20" cols="40"></textarea><br /><br /> <input type="submit" name="add" value="add post" onclick="return validate()"/> </p> </form> </body> </html> <?php $page_parts = explode("/", $_SERVER['PATH_INFO']); $page_filename = $page_parts[count($page_parts)-1]; $lastpage = $_SESSION['thispage']; if ( strlen ($lastpage) == 0 ) $lastpage = "index.php"; $_SESSION['thispage'] = $page_filename; ?> <form action="<?php echo $lastpage ?>" method="post"> <table> <tr><td clospan="2"><input type="submit" value="Home" name="back" /></td></tr> </table> </form> bloggadd.js (the JavaScript code) // Show current date in the date box function showdate() { var now = new Date(); document.getElementById('date').value = now.getFullYear() + "-" + (now.getMonth() + 1) + "-" + now.getDate(); loginform.header.focus(); } // Validate Form function validate() { var date = document.getElementById('date').value; // Heading is no requirement var entry = document.getElementById('entry').value; // If the date is note the correct format if (!/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(document.getElementById('date').value)) { alert('Please enter the dates in the format yyyy-mm-dd.'); document.getElementById('date').focus(); return false; } // on missing posts if (entry.length == 0) { alert("Fyll i ett inlägg."); document.getElementById('entry').focus(); return false; } return true; } I really appreciate if someone helps me.
  17. I have tried to create a back button, but I have not reached the correct solution. I log into first page (index.php) and then you will get two new buttons that brings me to two different pages. Then I want to come back to the login page, the session is gone and I have to log in again. I want to remain logged in when I get to the index page and be able to see the two buttons. I tried different things such as: <input type="button" value="Return to previous page" onClick="javascript:history.go(-1)" /> <?php $referer = $_SERVER['HTTP_REFERER']; if (!$referer == '') { echo '<p><a href="' . $referer . '" title="Return to the previous page">« Go back</a></p>'; } else { echo '<p><a href="javascript:history.go(-1)" title="Return to the previous page">« Go back</a></p>'; } ?> But that's not what I'm thinking about. How can I solve this? index.php <?php session_start(); if(isset($_POST['LoutBtn'])) { session_destroy(); } if(isset($_POST['LoginBtn'])) { //convert a string to all lower case letters. //if user gives username with big letters still can login. $user = strtolower($_POST['username']); $pass = $_POST['password']; if($user == 'admin' && $pass == '123') { $_SESSION['LogedIn'] = true; { print('Welcome admin'); ?> <table width="50" align="right" cellpadding="2" cellspacing="2"> <form method="POST" action="panel.php"> <tr> <td><input type="submit" value="add post" name="PnlBtn" /></td> </tr> </form> <form method="POST" action="stat.php"> <tr> <td><input type="submit" name="showstat" value="visitorlog" /></td> </tr> </form> </table> <?php } } elseif (empty($user) || empty($pass)) { print('<font color="#FF0000">Please fill in username and password!<br/></font>'); } elseif ($_POST['username'] != 'admin'){ print('<font color="#FF0000">wrong username<br/></font>'); } elseif ($_POST['password'] != '123'){ print('<font color="#FF0000">wrong password<br/></font>'); //elseif { // print('<font color="#FF0000">The User Name And/Or Password is incorrect! // Please try again...<br/></font>'); //print('<a href="index.php">Back</a>'); } } ?> <?PHP /* define the blog content file name */ $filename = "myBlogContent.txt"; ?> <!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>Untitled Document</title> </head> <body> <form method="post" action="index.php" > <table width="300" border="1" align="right" cellpadding="2" cellspacing="2"> <tr> <td width="150">UserName:</td> <td> <input type="text" name="username" size="20" /> </td> </tr> <tr> <td width="150">Password</td> <td><input type="password" name="password" size="20" /></td> </tr> <tr> <td><input type="submit" value="Login" name="LoginBtn" /> </td> </tr> <tr> <td><input type="submit" value="Logout" name="LoutBtn" /></td> </tr> </table> </form> <!-- CONTENT DIV --> <div style="position:absolute; left: 100px; top: 100px; width: 400px;"> <?PHP /* check to see if the file exists */ if (!file_exists($filename)) { echo "The Blog Is Empty"; }else{ /* get the file lines into an array */ $BlogArray = file($filename); /* count the number of blog entries */ $count = count($BlogArray); $i=0; while($i<$count) { $new_array = explode("|", $BlogArray[$i]); echo "Posted by: " . $new_array[1] . "<br>"; echo "Posted on: " . date("m/d/y", time($new_array[0])) . "<br>"; echo "Title: " . $new_array[2] . "<br>"; echo $new_array[3] . "<hr>"; $i ++; } } ?> </div> </body> </html> panel.php <?php session_start(); if ($_SESSION['LogedIn'] == false) { $redirect = "Location: " . $_REQUEST['LoginBtn'] . "index.php"; echo header($redirect); } elseif ($_SESSION['LogedIn'] == true) { echo "welcome"; } //if(isset($_POST['LoutBtn'])){ //{ // session_destroy(); // header ('Location: index.php'); //if ($_SESSION['LogedIn'] == true) //{ // print('<h1>Welcome admin</h1>'); // } //else //{ // session_destroy(); // header ('Location: index.php'); //} ?> <!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>Untitled Document</title> </head> <body> <form action="content.php" method="post"> <table> <tr><td>Blog entry posted by (Your name): </td><td><input type="text" name="who" size="20" maxlength="20" value=""></td></tr> <tr><td>Title of this blog entry: </td><td><input type="text" name="title" size="40" maxlength="80" value=""></td></tr> <tr><td>Content: </td><td><textarea name="content" rows="5" cols="40"></textarea></td></tr> <tr><td clospan="2"><input type="submit" value="Submit"></td></tr> <tr><td clospan="2"><input type="submit" name="showstat" value="visitorlog" /></td></tr> <tr><td clospan="2"><input type="submit" value="Back" name="back" /></td></tr> </table> </form> </body> </html>
×
×
  • 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.