this is link to code http://jsbin.com/ixupuk/4/edit
when my form is loaded into browser OR refreshed, all fields are auto-submitted to mysql database..
i included at the bottom, an if(isset) statement that i couldnt get to work.
thanx
amkaos
0
Light Poster
Recommended Answers
Jump to Postwhen my form is loaded into browser OR refreshed, all fields are auto-submitted to mysql database..
I am not sure but I never seen data submited to the database by refreshing the browsers.
Maybe using a cookie? Not sure.
You also need another query to update the data …
Jump to Postgoogle turns up hits for my prob.seems like they mostly say to add the isset that i tried ,but couldnt get to work.. idk what i did wrong.
Where did you get that info?
Do you understand how a isset() function works?
It means to find or verify …
Jump to Postppl reported success by adding the isset where shown. i dont understand why js is needed
I don't feel like arguing. Base on this code:
if(isset($_POST)){ $sql = "INSERT INTO admin_table (fullname, email, comment) VALUES ('$fullname', $email', '$comment')"; if (!mysql_query($sql)) { die('Error: ' .mysql_error()); } …
Jump to PostI notice you comment a dozen code lines
Try this code without those commnets then tell me if you got any errors:
define('DB_NAME', 'yyy_ContactForm'); define('DB_USER', 'xxx'); define('DB_PASSWORD', 'zzz'); define('DB_HOST', 'localhost'); $link = mysql_connect (DB_HOST, DB_USER, DB_PASSWORD); if(!$link) { die('Could not connect: ' .mysql_error()); } $db_selected = mysql_select_db(DB_NAME,$link); …
Jump to Posti put in your edited code and got this error: :
Function name must be a string in @ this:if($_POST($fullname, $email, $comment) == '') { $error[] = '';
Try this (instead of this
($fullname, $email, $comment)
change it to this[$fullname, $email, …
All 23 Replies
amkaos
0
Light Poster
LastMitch
amkaos
0
Light Poster
LastMitch
amkaos
0
Light Poster
LastMitch
LastMitch
amkaos
0
Light Poster
LastMitch
amkaos
0
Light Poster
LastMitch
amkaos
0
Light Poster
LastMitch
amkaos
0
Light Poster
LastMitch
amkaos
0
Light Poster
urtrivedi
276
Nearly a Posting Virtuoso
diafol
amkaos
0
Light Poster
TonyG_cyprus
36
Newbie Poster
urtrivedi
276
Nearly a Posting Virtuoso
amkaos
0
Light Poster
amkaos
0
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.