Search Results

Search found 3 results on 1 pages for 'tooepic'.

Page 1/1 | 1 

  • passing value of index number to different php file.

    - by tooepic
    hi, i am a php beginner and have a question for you please. i have a text file with list of first and last names like this: john,smith sam,lewis david,davidson mike,anderson in my sort.php file, it sorts that name list by first name in ascending order with index number, which will display like this: 1. david,davidson 2. john,smith 3. mike,anderson 4. sam,lewis also, in that sort.php file, there's a form for input type=text where you can type index number and a button to delete that index number entered in that text field: <form action="deletename.php" method="post"> <table> <tr valign="top"> <td>Delete: <input type="text" size="2" name="indexnumber" /> </td> <td> <div align="left"> <input type="submit" name="delete" value="Delete" /> </div> </td> </tr> </table> </form> now the question...is there anything i can do in that form to send the value of that index number i entered in the text field? in other word...if i enter 3, what can i do to that form to send the value "mike,anderson" to deletename.php? thanks in advance.

    Read the article

  • redirecting back to php file

    - by tooepic
    hello again, following code is my php file that will list the people in my text file. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>viewlist php</title> </head> <body> <h1>List</h1> <?php $file = file("peoplelist.txt"); for($i=0; $i<count($file); $i++) { $person = explode(",", $file[$i]); echo "<hr />"; echo "<table cellspacing=10><tr><td>", $i+1,".", "</td>"; echo "<td>", $person[0], "<br />"; echo $person[1], "</td></tr></table>"; } ?> <hr /> <p> <a href="sortatoz.php" target="_self">Sort A-Z</a><br /> <a href="sortztoa.php" target="_self">Sort Z-A</a><br /> </p> </body> </html> what i want to do is, when i click Sort A-Z link, the file called sortatoz.php will sort the list in my text file and redirect back to viewlist.php with the list in sort order. below is my sortatoz.php: <?php header("Location: http://myserver/workspace/viewlist.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>sort a to z</title> </head> <h1>List</h1> <body> <?php $file = file("peoplelist.txt"); sort($file); for($i=0; $i<count($file); $i++) { $person = explode(",", $file[$i]); echo "<hr />"; echo "<table cellspacing=10><tr><td>", $i+1,".", "</td>"; echo "<td>", $person[0], "<br />"; echo $person[1], "</td></tr></table>"; } ?> <hr /> <p> <a href="sortvisitorsascending.php" target="_self">Sort Visitors A-Z</a><br /> <a href="sortvisitorsdescending.php" target="_self">Sort Visitors Z-A</a><br /> </p> </body> </html> now, when i click Sort A-Z link, it redirects back to viewlist.php...so I'm assuming the header() function is doing it's job. but the problem is...it's not sorting. i am very new with this, so bear with me and give me some guidance please. what can i do to my codes to redirect back viewlist.php with sorted list? thanks in advance.

    Read the article

  • php session_start() error

    - by tooepic
    Hi, i've used a sample found on online and applied it to my code: <?php session_start(); if (isset($_REQUEST["email"])) { $_SESSION["name"] = true; $host = $_SERVER["HTTP_HOST"]; $path = dirname($_SERVER["PHP_SELF"]); $sid = session_name() . "=" . session_id(); header("Location: index.php?$sid"); exit; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> ... ... and rest of the html code When I open this page, I got an error: Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /data/server/user/directory/sub-directory/login.php:1) in /data/server/user/directory/sub-directory/login.php on line 2 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /data/server/user/directory/sub-directory/login.php:1) in /data/server/user/directory/sub-directory/login.php on line 2 I looked around to resolve this issue and saw few posts about this in this site also, but I just can't get a good grip on this...can't find the answer. Please help. Thanks.

    Read the article

1