|
Comments for: zhang19990610
| Message # 1011174: |
|
Date: 05/05/02 04:48
By: Ali Zubayer Faruq Subject: RE: PHP_SELF I have used php_self at winnt server (mysql and php) platform and i am getting error usign this at my form action part. please help me. i am sending code.. -------------------------------------------- <html> <head> <title> The Internet Joke Database </title> </head> <body> <?php if (isset($addjoke)): // If the user wants to add a joke ?> <form action="<?=$PHP_SELF?>" method="post"> <p>Type your joke here:<br /> <textarea name="joketext" rows="10" cols="40" wrap> </textarea><br /> <input type="submit" name="submitjoke" value="SUBMIT" /> </p> </form> <?php else: // Default page display // Connect to the database server $dbcnx = @mysql_connect("192.168.1.212", "root", "test"); if (!$dbcnx) { echo( "<p>Unable to connect to the " . "database server at this time.</p>" ); exit(); } // Select the jokes database if (! @mysql_select_db("jokes") ) { echo( "<p>Unable to locate the joke " . "database at this time.</p>" ); exit(); } // If a joke has been submitted, // add it to the database. if ($submitjoke == "SUBMIT") { $sql = "INSERT INTO Jokes SET JokeText='$joketext', JokeDate=CURDATE()"; if (@mysql_query($sql)) { echo("<p>Your joke has been added.</p>"); } else { echo("<p>Error adding submitted joke: " . mysql_error() . "</p>"); } } echo("<p> Here are all the jokes in our database:" . "</p>"); // Request the text of all the jokes $result = @mysql_query("SELECT JokeText FROM Jokes"); if (!$result) { echo("<p>Error performing query: " . mysql_error() . "</p>"); exit(); } // Display the text of each joke in a paragraph while ( $row = mysql_fetch_array($result) ) { echo("<p>" . $row["JokeText"] . "</p>"); } // When clicked, this link will load this page // with the joke submission form displayed. echo("<p><a href='$PHP_SELF?addjoke=1'>" . "Add a Joke!</a></p>"); endif; ?> </body> </html> |
Previous Message | Next Message |
| Comments: | ||
| RE: How do I find window.location.href in PHP? | Kalid | 09/07/05 05:40 |
| RE: Class Newbie Here! | Ken | 05/17/04 22:26 |
| RE: How do I find window.location.href in PHP? | joren | 11/12/02 17:20 |
| RE: Template are much better | Neil J. McLeish | 09/07/02 03:37 |
| RE: Template are much better | Michael | 08/03/02 21:04 |
| Template are much better | Bryan Alsdorf | 06/20/02 16:39 |
| RE: PHP_SELF | Tom | 05/30/02 10:10 |
| learn | starter | 05/14/02 05:48 |
| RE: PHP_SELF | Ali Zubayer Faruq | 05/05/02 04:48 |
| Functions printer | ranjith | 03/12/02 05:37 |
| RE: PHP_SELF | Nick | 01/30/02 02:27 |
| Multiple selects limitations | Simone Capra | 01/25/02 06:33 |
| RE: PHP_SELF | Henning Blunck | 01/08/02 11:37 |
| Class Newbie Here! | christian | 12/19/01 07:46 |
| Hello | Shamim | 12/05/01 02:09 |
| How do I find window.location.href in PHP? | Randy Tayler | 10/30/01 17:14 |
| RE: Not for a serious project | Horacio Lopez | 10/27/01 22:27 |
| RE: A bit different implementation | Luke | 09/23/01 14:51 |
| RE: Not for a serious project | Luke | 09/23/01 11:39 |
| table viewer for Postgres | Kiran | 08/25/01 10:59 |
| Functions printer | Daniel | 08/14/01 15:57 |
| What about Speed and more complicated pages | Jan Varwig | 06/17/01 01:50 |
| Need to build a dynamic template | Richard | 06/13/01 07:28 |
| PHP_SELF | Chi-Thuan Truong | 05/23/01 11:00 |
| RE: including documents in a particular folder | Bob | 02/07/01 06:07 |
| RE: Error report + | Rodrigo | 01/21/01 04:19 |
| including documents in a particular folder | Doug Dzierzak | 01/08/01 17:07 |
| A bit different implementation | Idan Sofer | 01/02/01 15:22 |
| RE: Not for a serious project | Dallas Kropka | 12/20/00 23:46 |
| RE: Not for a serious project | sander | 11/30/00 04:45 |
| RE: Not for a serious project | JayH | 11/27/00 11:41 |
| RE: Not for a serious project | Eric Mueller | 11/24/00 21:29 |
| RE: Not for a serious project | Lennie | 11/13/00 14:32 |
| RE: Not for a serious project | MikeFM | 11/03/00 10:44 |
| Not for a serious project | JAvier Leyba | 10/30/00 14:35 |
| Error report | Eusebe Dollars | 09/01/00 05:45 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly. | ||


