Ok so now it works so far but after submitting it won't get it into the database. It does not give me any error but I cannot find anythying in the database.
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Lotsoftext');
$Lotsoftext=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Lotsoftext);if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Lots of text: ".$Lotsoftext."
";
$link = mysql_connect("localhost","root","");
mysql_select_db("hrm",$link);
$query="insert into testtable (name,textmass) values ('".$HTTP_POST_FILES['Name']['name']."','".$HTTP_POST_FILES['Lotsoftext']['name']."')";
mysql_query($query);
header("Refresh: 0;url=http://127.0.0.1");
}
?>
It works when I hit send but thisng ends up in the database
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you can use numbers, but you can't start a field name with a number. This is a general programming rule, you cannot name identifiers starting with numeric digits.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
heh yea.. I had to release 2.04 quickly cuz people were bombarding me with emails :P But anyway, stick around .. I'll have this lil thing fixed and upload the new packages
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok all done. The new file is called phpFormGen-php-2.04b.tar.gz or phpFormGen-php-2.04b.zip , depending on which archive you'll be downloading (notice the 'b').
It might take a little time for sourceforge to show the new files.. I can seem up right now though.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I'm using ver 2.04 and phpdev on a win machine. When I build a form with 2 text areas and have it all well and done and then try it out it says:
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in c:\phpdev\www\process.php on line 6
This is after I have built a for with 2 text areas and nothing else just for testing. The code looks like this:
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','1');
$1=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $1);pt_register('POST','2');
$2=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $2);if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="1: ".$1."
2: ".$2."
";
mail("asfasdf@asdds.se","Form Submitted at your website",$message,"From: phpFormGenerator");
$link = mysql_connect("localhost","root","");
mysql_select_db("hrm",$link);
$query="insert into clients (table1,table2) values ('".$HTTP_POST_FILES['1']['name']."','".$HTTP_POST_FILES['2']['name']."')";
mysql_query($query);
header("Refresh: 0;url=http://127.0.0.1");
}
?>
The parse error is on line 6. Any ideas
Cheers
Please don't use numbers as your field names. A field name should start with a letter.
ohh we'll I missed that I shall try and come back.. Sorry for the dumb misstake
Ok so now it works so far but after submitting it won't get it into the database. It does not give me any error but I cannot find anythying in the database.
<?php
include("global.inc.php");
$errors=0;
$error="The following errors occured while processing your form input.<ul>";
pt_register('POST','Name');
pt_register('POST','Lotsoftext');
$Lotsoftext=preg_replace("/(\015\012)|(\015)|(\012)/"," <br />", $Lotsoftext);if($errors==1) echo $error;
else{
$where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/"));
$message="Name: ".$Name."
Lots of text: ".$Lotsoftext."
";
$link = mysql_connect("localhost","root","");
mysql_select_db("hrm",$link);
$query="insert into testtable (name,textmass) values ('".$HTTP_POST_FILES['Name']['name']."','".$HTTP_POST_FILES['Lotsoftext']['name']."')";
mysql_query($query);
header("Refresh: 0;url=http://127.0.0.1");
}
?>
It works when I hit send but thisng ends up in the database
Well look at that, it works ... No numbers and then it works. Would that be no numbers at all or could it be "something_1" or should I skip numbers
you can use numbers, but you can't start a field name with a number. This is a general programming rule, you cannot name identifiers starting with numeric digits.
aah rats, u've found a bug :P wait.. fixing
What ? You mean that I have found a bug *feels proud* I'll be waiting right here :-)
heh yea.. I had to release 2.04 quickly cuz people were bombarding me with emails :P But anyway, stick around .. I'll have this lil thing fixed and upload the new packages
I'll be waiting right here.....
Ok all done. The new file is called phpFormGen-php-2.04b.tar.gz or phpFormGen-php-2.04b.zip , depending on which archive you'll be downloading (notice the 'b').
It might take a little time for sourceforge to show the new files.. I can seem up right now though.
ok will try and get back to you
Ok it works, now I will try this with a online questionare that i need to build with about 40 questions all multiple choice.
I'll inform you how i went
FYI Everything works fine and I have tested several different ways of doing a online form. I have no problems so far. Thanks for the fix.