problem with form and post

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
Chicken Deluxe
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Apr 24, 2003 1:04 pm
Contact:

problem with form and post

Postby Chicken Deluxe » Fri Apr 25, 2003 9:11 am

i have a form with a textfield (variable name: text) in it. when i push a button, i want the text in the textfield to be posted to a php-file called formtest.php.
my problem is, that the variable "text" does not contain anything, when i want to echo it in testform.php
the funny thing is that it works on my localhost but not on the internet.

here´s the source:
form.php:

Code: Select all

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<form name="form1" method="post" action="formtest.php">
  <input name="text" type="text" id="text">
  <input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>


formtest.php:

Code: Select all

<?

   $test = $_POST["text"];
   echo "text: ".$test;

?>


where´s the mistake?

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Fri Apr 25, 2003 10:28 am

I don't see any problems...

http://home.bezmond.co.uk/form.htm

Andrew

to add, I just copied your code straight into notepad and saved it. No alterations...

liquedus
php-forum Active User
php-forum Active User
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada
Contact:

Postby liquedus » Fri Apr 25, 2003 10:53 am

where on the internet are you hosting it on?

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Fri Apr 25, 2003 11:02 am

my computer, Windows XP running a Xitami web server and PHP

User avatar
Chicken Deluxe
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Apr 24, 2003 1:04 pm
Contact:

Postby Chicken Deluxe » Fri Apr 25, 2003 3:13 pm

i´m hosting it on coolfreepages.com
take a look at http://eyeq.ionichost.com/form.php
it doesn´t work there. maybe a server configuration problem?

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Fri Apr 25, 2003 11:36 pm

hmmmmmmmmmmmmm, not sure... are you positive they are running PHP? Try running a script with only <? phpinfo(); ?> and see if that works

Andrew

superfasty
New php-forum User
New php-forum User
Posts: 2
Joined: Sat Apr 26, 2003 7:19 am
Location: Portland, OR
Contact:

I have the same problem... with cool free pages

Postby superfasty » Sat Apr 26, 2003 7:28 am

I wrote code so that my one file would rewrite itself passing a variable to itself and rewriting the thumbnail pics every time they are detected in the directory folder. It should go to pics 25 but not when I made it live at cool free pages. I would try a different host. My site is at: http://epicunion.ionichost.com/portlandart.php

User avatar
bezmond
Moderator
Moderator
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK
Contact:

Postby bezmond » Sat Apr 26, 2003 1:26 pm

I guess it's a problem with cool free pages then... perhaps they are running an old version of PHP.

Andrew

superfasty
New php-forum User
New php-forum User
Posts: 2
Joined: Sat Apr 26, 2003 7:19 am
Location: Portland, OR
Contact:

Answer?

Postby superfasty » Sat Apr 26, 2003 3:51 pm

I am going to try netfirms for one month and see how paid PHP works. If mine (code) works when switching then I will let you know; then we'll both know if cfp's is crap. -Steve

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Tue Apr 29, 2003 2:48 am

make sure you use <?php and not just <?

it might not sovle the problem but i've seen it cause many problems.


also if you are looking for cheap hosting I offer $50 a year for 10mb, PHP, Mysql

I also have other plans if more space is needed.


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest