hi..
I've created a guestbook and it works just great on my comp. but now when I put it on a free test server it won't work anymore...
I'm using a form with the post action thing to a new php page, and there I've done a $txt = $_POST["txt"]; connection. but something's not working, because nothing is entered into the database. is there a problem using that $txt = $_POST["txt"]; connection thing on some servers or something?
and I'm sure it's that or the form that's the problem. been trying to change everything else...
this is the code:
guestbook.htm
-------------------
<form name="guestbook" method="post" action="guestbook.php">
<p><br><table border="0" class="textsmallbold"><tr>
<td>Namn : </td>
<td><input type="text" name="namn"></td></tr>
<tr>
<td>E-post : </td>
<td><input type="text" name="epost"></td></tr>
<tr>
<td>Meddelande : </td>
<td>
<textarea name="txt"></textarea>
<input type="submit" name="Submit" value="Submit" class="button">
---------------------
guestbook.php
---------------------
<?php
$db = mysql_connect("localhost", "xxxxxx", "xxxxxx");
mysql_select_db("DB_nac88321",$db);
$namn = $_POST["namn"];
$epost = $_POST["epost"];
$txt = $_POST["txt"];
if ($txt) {
(insert query and all that)
?>
<?php
} else {
printf("<meta http-equiv='refresh' content='0;URL=forgot.htm'>\n");
}
?>
-------------
would be realy happy if someone could tell me what's wrong, and why... it just buggs me coz it worked fine until I put it on another server...
what happens when I try to enter a message to the guestbook is that it's just totaly ignored. it says I haven't put any text in the textbox... but I'm sure I have... and if I get rid of that "if ($txt)" thing nothing happens... one message is entered in the guestbook, but it's blanc. it's like nothing is sent to the guestbook.php page at all. or that the connection thing don't work...
please help.. ;)
-s
trouble with the post function
Moderators: egami, macek, gesf
-
- New php-forum User
- Posts: 74
- Joined: Sun Nov 24, 2002 6:48 pm
- Location: katrineholm
-------
stefan
-------
stefan
-------
- Joan Garnet
- Moderator
- Posts: 387
- Joined: Sat Aug 03, 2002 2:56 am
- Location: Mars
- Contact:
Maybe they have an earlier version of PHP than 4.1.0
Try using
bye!
Introduced in 4.1.0. In earlier versions, use $HTTP_POST_VARS.
Try using
Code: Select all
$txt = $HTTP_POST_VARS["txt"];
bye!
-
- New php-forum User
- Posts: 74
- Joined: Sun Nov 24, 2002 6:48 pm
- Location: katrineholm
it worked...
damnit...
they brag about using php4... is there a earlier version of php4 than 4.1.0?
damnit...
they brag about using php4... is there a earlier version of php4 than 4.1.0?
-------
stefan
-------
stefan
-------
-
- New php-forum User
- Posts: 74
- Joined: Sun Nov 24, 2002 6:48 pm
- Location: katrineholm
b.t.w.
thank you sooo much for all your help.

thank you sooo much for all your help.

-------
stefan
-------
stefan
-------
- Joan Garnet
- Moderator
- Posts: 387
- Joined: Sat Aug 03, 2002 2:56 am
- Location: Mars
- Contact:
Good
I'm glad that it worked!
Which server is that??
I want to know so I can recommend it to people interested on learning php
It's not a normal thing to find free php servers. isn't it?

Which server is that??
I want to know so I can recommend it to people interested on learning php

It's not a normal thing to find free php servers. isn't it?