Jump to content

nimzrocks

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nimzrocks's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you very much bro, now its working There will be 25 questions and I'm going to add (q1,q2,q3,.....q25) to every question. Is it all right ?
  2. Thank for your reply this is my table code CREATE TABLE `database`.`emailquestionnaire` ( `id` INT NOT NULL AUTO_INCREMENT , `firstname` INT( 30 ) NOT NULL , `lastname` INT( 30 ) NOT NULL , `age` INT NOT NULL , `q3` INT NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM ;
  3. Hello my friends I need to build a email questionnaire form. I need to use some radio buttons as well. As a example I have this php code and form but I do not know how to send radio button data to my database. So I did like this, but radio button data is saving as "0" Can you please how to do this properly? this is my form <form action="insert.php" method="post"> Firstname: <input type="text" name="firstname" /> Lastname: <input type="text" name="lastname" /> Age: <input type="text" name="age" /> <table width="100%" border="1"> <tr> <td>What is your First Car ?</td> <td> <p> <label> <input type="radio" name="q3" value="Honda" id="q3_0" /> Honda</label> <br /> <label> <input type="radio" name="q3" value="Sunny" id="q3_1" /> Sunny</label> <br /> <label> <input type="radio" name="q3" value="Bluebird" id="q3_2" /> Bluebird</label> <br /> </p></td> </tr> </table> <input type="submit" /> </form> and this my insert page <?php $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("mydatabase", $con); $sql="INSERT INTO emailquestionnaire (FirstName, LastName, Age, q3) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]','$_POST[q3]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?> Thank you
  4. No its not like that WolfRage. I highly appreciate your help but Its been more than 3 weeks, I have stuck with this and I can not finish my project till I complete this that is why I said that. I'm really tired of doing this. Do not think this is the only place where I tried. I tried every where and tried to learn it and I'm glad I learn lil bit because of you. I always appreciate your help. I will put all together and I will test this right now. Thank you very much my friend.
  5. Can I integrate wordpress comment feature to my personal php web site ? If is is possible, can you tell me how to do it ?
  6. hmmm thank you but I'm really tired of waiting WolfRage
  7. Ok I renamed it to include_comments.php and changed pagecolumn to varchar. I know css but I do not have an idea to style comments, Can you please give me an example ? Then I can do it
  8. I added that page column as you requested. CREATE TABLE `mydatabase`.`comment` ( `commentid` INT NOT NULL AUTO_INCREMENT , `time` TIMESTAMP NOT NULL , `pagecolumn` INT NOT NULL, `name` VARCHAR( 40 ) NOT NULL , `email` VARCHAR( 50 ) NOT NULL , `url` VARCHAR( 50 ) NOT NULL , `notes` VARCHAR( 500 ) NOT NULL , PRIMARY KEY ( `commentid` ) , UNIQUE ( `commentid` ) ) ENGINE = MYISAM I'm bit confuse now but I made the file and named it $_SERVER['PHP_SELF'].php that is what you asked me to do right ? Waiting for you next step WolfRage
  9. WolfRage, everything you gave me and everything i did with this script working perfectly till now So I'm waiting for your next lesson. Thank you
  10. Thank you for coming back. I had a really bad time and I went so many things and finally I found something very simple. but I do not like It. Yes I want your help still and I'm sure you will give me something good. ok what do you want me to do now ?
  11. visit these http://www.phpfreaks.com/forums/index.php/topic,287535.msg1363149.html#msg1363149 http://www.phpfreaks.com/forums/index.php/topic,287949.msg1365068.html#msg1365068 I think you are not blind. NO ONE IS HELP PROPERLY..... damn it
  12. Everyone is talking like big shots but no one has php commenting script.
  13. Yes you are right it is comment but nothing happened even i corrected it any help ?
  14. No errors. I'm getting a new form back and data base is not getting any data This is is script <?php error_reporting(E_ALL); ini_set('display_errors', 1); $con = mysql_connect("...","....","..."); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("fees0_4383963_test", $con); if(isset($_POST['submit'], $_GET['id']) && is_numeric($_GET['id'])) { $name = mysql_real_escape_string($_POST['name']); $mail = mysql_real_escape_string($_POST['mail']); $commen = mysql_real_escape_string($_POST['comment']); $postid = (int) $_GET['id']; if( (!empty($name)) && (!empty($mail)) && (!empty($comment)) ) { $sql = "INSERT INTO prototype (name, mail, comment, postid) VALUES('$name', '$mail', '$comment', '$postid')"; mysql_query($sql) or die('Unable to insert comment: '. mysql_error()); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <?php if(isset($_REQUEST["id"]) && is_numeric($_REQUEST["id"])) { $id = (int) $_REQUEST["id"]; $result = mysql_query ("SELECT * FROM prototype WHERE postid='$id' ORDER BY id desc") or die ('Unable to grab comments: '.mysql_error()); while($row = mysql_fetch_array($result)); { echo $row['name']; echo $row['mail']; echo $row['comment']; echo $row['timestamp']; } } ?> <form id="form1" name="form1" method="post" action="comment2.php?id=<?php echo $id; ?>"> Name: <input name="name" type="text" /> <br /> Mail: <input name="mail" type="text" /> <br /> Kommentar: <textarea type="text" name="comment" cols="50" rows="6"></textarea> <br /> <input name="submit" type="submit" class="submit" value="Send"/> </form> </body> </html> This is table CREATE TABLE `databasename`.`prototype` ( `name` VARCHAR( 50 ) NOT NULL , `mail` VARCHAR( 50 ) NOT NULL , `comment` VARCHAR( 500 ) NOT NULL , `postid` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ) ENGINE = MYISAM What should I do now ? Please help
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.