Jump to content

nimzrocks

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Everything posted by nimzrocks

  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
  15. ok thank you I corrected other two sting to string but now I'm getting this error Notice: Undefined index: id in /home/vol11/0fees.net/fees0_4383963/mywebsite.com/htdocs/script1/comment2.php on line 17 what is this time ?
  16. ok now I can see the form and I can fill it but when i clickes on submit I'm getting this error now. Fatal error: Call to undefined function mysql_real_escape_sting() in /home/vol11/0fees.net/fees0_4383963/mywebsite.com/htdocs/script1/comment2.php on line 14 what can be the error now ?
  17. Thank you very much. These are my errors Warning: require_once(write-comment.php) [function.require-once]: failed to open stream: No such file or directory in /home/vol11/0fees.net/fees0_4383963/mywebsite.com/htdocs/script1/comment.php on line 15 Fatal error: require_once() [function.require]: Failed opening required 'write-comment.php' (include_path='.') in /home/vol11/0fees.net/fees0_4383963/mywebsite.com/htdocs/script1/comment.php on line 15 and I found out a what is the error so I just renamed write_comment.php to write-comment.php and now I'm getting this error now Notice: Undefined index: id in /home/vol11/0fees.net/fees0_4383963/mywebsite.com/htdocs/script1/comment.php on line 17 No database selected What is the problem ?
  18. My problem is I cant see anything when I go to comment.php I do not see my form there is anyone has a script ? Please give me. I'm really sick of this now. I typed a lot to get help every where but no one is helping me properly It is two weeks now still could not make this http://www.phpfreaks.com/forums/index.php/topic,287535.msg1363149.html#msg1363149 you can see someone was helping me but he did not finish it Is anyone can complete it ? please help me
  19. Thank you nblackwood but I'm new to php. I do not see a code to connect to my sql data base can you tell me how to put that code also ? Thank you
  20. Can you please tell me what is wrong with this comment script ? it is not showing anything. Just a blank page This is comment.php <!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 $id = $_REQUEST["id"]; include('write_comment.php'); $result = mysql_query ("SELECT * FROM commenttable WHERE postid='$id' ORDER BY id desc") or exit (mysql_error()); while($row = mysql_fetch_array($result)) { echo $row['name']; echo $row['mail']; echo $row['comment']; echo $row['timestamp']; } ?> <form action="index.php?id=<? echo $id;?>" method="post"/> Name:<input name="name" type="text" ><br /> Mail:<input name="mail" type="text" ><br /> Kommentar: <textarea name="comment" cols="50" rows="6"></textarea><br /> <input name="submit" type="submit" class="submit" value="Send"/> </form > </body> </html> This is write_comment.php <!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 $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("databasename", $con); if(isset($_POST['submit'])) { $name = $_REQUEST['name']; $mail = $_REQUEST['mail']; $commen = $_REQUEST['comment']; $postid = $_REQUEST['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(mysql_error()); } } ?> </body> </html> Please someone help me....... Thank you
  21. Thank you very much for your kindness I'm really stuck with this comment script. Can you please tell me step by step ? and do you want me to forget everything I have done before ? This is what I'm looking for http://www.labnol.org/internet/google-image-search-problem/12671/ Thank you.
  22. Yes it echo like this Let test to make sure the data is being passed. name=Bob email= url=www.testing.com notes=This is testing. and I created the table and this is table code CREATE TABLE `mydatabase`.`comment` ( `commentid` INT NOT NULL AUTO_INCREMENT , `time` TIMESTAMP 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 Hope this is correct and I did updated the comment_post.php as well. Waiting for your reply.
×
×
  • 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.