Jump to content

abhishekdeveloper

Members
  • Posts

    34
  • Joined

  • Last visited

Everything posted by abhishekdeveloper

  1. I have the following code to retrieve the password of a user from the database and email to him. I am successfully able to send a user his password if his email is present in the database. But in the event that the email doesn't exist, I want the code to echo that the email for the particular user doesn't exist in the database. My code gives me the below result if an invalid email is entered in the form: Failed to add recipient: @localhost [sMTP: Invalid response code received from server (code: 555, response: 5.5.2 Syntax error. v9sm2318990paz.6)] I have tried using the if-else statement for this purpose. Here's the code I wrote: <?php //Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); // email value sent from HTML form $email_to=$_POST['email']; // table name $tbl_name="registration"; if($mysql1 = "SELECT ID,Email,Password FROM $tbl_name WHERE Email='$email_to' ORDER BY ID DESC ") { $selectemail = mysql_query($mysql1); $shah = mysql_fetch_array($selectemail); $EMAIL = $shah['Email']; $UID = $shah['ID']; $password = $shah['Password']; require_once "/home/computat/php/Mail.php"; $from = "abhishekagrawal.988@gmail.com"; $to = $EMAIL; $subject = "Your password for www.computationalphotography.in"; $body = "Your password for logging on to our website www.computationalphotography.in is:\n$password\r\nIf you have any additional queries, kindly write to us at abhishekagrawal.988@gmail.com\r\n\nThanks & Regards\nThe Computational Photography Team\n"; $host = "ssl://smtp.gmail.com"; $port = "465"; $username = "abhishekagrawal.988@gmail.com"; // $password = "*********"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p></p>"); } } else{ echo "<b><center>Email not found in the database</center></b>"; } /*
  2. Hi Barry, Thank you for your reply. I incorporated the change that you mentioned. But I am still unable to see the change in my database against the particular user name in the respective table against the particular username. Please let me know if there are any other modifications required, below is my modified code: <?php $character_set_array = array( ); $character_set_array[ ] = array( 'count' => 5, 'characters' => 'abcdefghijklmnopqrstuvwxyz' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => '0123456789' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => '!@#$+-*&?:' ); $temp_array = array( ); foreach ( $character_set_array as $character_set ) { for ( $i = 0; $i < $character_set[ 'count' ]; $i++ ) { $temp_array[ ] = $character_set[ 'characters' ][ rand( 0, strlen( $character_set[ 'characters' ] ) - 1 ) ]; } } shuffle($temp_array); $output=implode($temp_array); echo "<b><b><P ALIGN=Center>$output</P></b></b>"; //this is where the code stores the output in the database $host="localhost"; // Host name $username="computat_abhi"; // Mysql username $password="1123581321"; // Mysql password $db_name="computat_rajesh"; // Database name // Connect to server and select database. $handle = mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db($db_name,$handle)or die("cannot select DB"); mysql_select_db("computat_rajesh",$handle); $sql="INSERT INTO registration (CompletionCode) VALUES ('$output')"; $result = mysql_query($sql); mysql_close($handle); ?>
  3. Dear All, I have a website on which the users vote on a set of images. A script that generates a random code immediately after a particular user has finished voting on an image. Below is the script to generate and store this code in the table in the column titled CompletionCode. However, after running the script, I am unable to see the random number stored in my database in the CompletionCode column. Kindly help me out by suggesting changes/modifications: <?php $character_set_array = array( ); $character_set_array[ ] = array( 'count' => 5, 'characters' => 'abcdefghijklmnopqrstuvwxyz' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => '0123456789' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => '!@#$+-*&?:' ); $temp_array = array( ); foreach ( $character_set_array as $character_set ) { for ( $i = 0; $i < $character_set[ 'count' ]; $i++ ) { $temp_array[ ] = $character_set[ 'characters' ][ rand( 0, strlen( $character_set[ 'characters' ] ) - 1 ) ]; } } shuffle($temp_array); $output=implode($temp_array); echo "<b><b><P ALIGN=Center>$output</P></b></b>"; //this is where the code stores the output in the database $host="localhost"; // Host name $username="computat_xyz"; // Mysql username $password="1234"; // Mysql password $db_name="computat_pqr"; // Database name // Connect to server and select database. $handle = mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db($db_name,$handle)or die("cannot select DB"); $sql="INSERT INTO registration (CompletionCode) VALUES ('$output')"; mysql_close($handle); ?>
  4. Dear All, Below is a program that generates a random password each time the page loads, I am getting an unexpected output as "Array" on running the script: <?php $character_set_array = array( ); $character_set_array[ ] = array( 'count' => 5, 'characters' => 'abcdefghijklmnopqrstuvwxyz' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => '0123456789' ); $character_set_array[ ] = array( 'count' => 1, 'characters' => '!@#$+-*&?:' ); $temp_array = array( ); foreach ( $character_set_array as $character_set ) { for ( $i = 0; $i < $character_set[ 'count' ]; $i++ ) { $temp_array[ ] = $character_set[ 'characters' ][ rand( 0, strlen( $character_set[ 'characters' ] ) - 1 ) ]; } } shuffle( $temp_array ); implode( '', $temp_array ); echo $temp_array; ?> I am expecting output in the below format: mczt0:Rm 2dwvJp!v wo9iVk@b c5xmx:xR a!Xwm5qk oyv!p8Sg Tiu8rb&w rmw&fa1I Kindly help me out by suggesting changes/modifications/errors. Thank you.
  5. I am sorry but same error....I guess I need to put the source code file on the server in the same folder for all these functions self.close, windows.close() etc.
  6. It is not the parent of the entire website...it is the page that opens after the user is done using the website for the purpose it was intended to do...
  7. It is a page written in html/php, i tried HTML script using self.close() but it is also giving the not found error...help!
  8. I am not sure if my window is opened using javascript...and self only works if a window is opened using javascript. Can you please help me out in this regard? I want it to work on all the platforms. Thank you.
  9. Even if I try the below code, it gives me the error: Not Found The requested URL /self.close() was not found on this server. Here's the script: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <title> Thank you! </title> <body bgcolor="#808080"> <br> <br> <h2><P ALIGN=Center>Thank you for voting on our website!</h2> <h3><P ALIGN=Center>We will e-mail you the results of the experiment shortly!</h3> <br> <br> <P ALIGN=Center><a href="login_success.php">Click here to go back and change your votes</a> <br> <br> <P ALIGN=Center><a href="self.close()">Click here to close this window</a> </body> </html> Please suggest modifications asap. Thank you.
  10. Dear All, Below is my script for closing a window, I intend to close the window. Please help me out. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <title> Thank you! </title> <body bgcolor="#808080"> <br> <br> <h2><P ALIGN=Center>Thank you for voting on our website!</h2> <h3><P ALIGN=Center>We will e-mail you the results of the experiment shortly!</h3> <br> <br> <P ALIGN=Center><a href="login_success.php">Click here to go back and change your votes</a> <br> <br> <P ALIGN=Center><a href="" onclick="window.close();return false;">Click here to close this window</a> </body> </html> It is not working as I intend it to work, any suggestions??
  11. My problem is solved. Thank you for your help .
  12. Thank you for your reply, I have reformatted my output and modified my code. However, I am still getting the same error which is Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/computat/public_html/forgotpassword.php on line 29 Here's my modified code: <?php include_once"configure.php"; $email=$_POST['email']; $email=mysql_real_escape_string($email); if($email<>"") { $check_user_data = mysql_query("SELECT * FROM registration WHERE email = '$email'") or die(mysql_error()); if(mysql_num_rows($check_user_data) == 0) { echo '<script language="javascript">alert("This email address does not exist. Please try again.")</script>;';unset($email); } else { $row = mysql_fetch_array($check_user_data); $email=$row['email']; } $to = $email; $subject = "Here are your login details . . . "; $message = "This is in response to your request for login details on www.computationalphotography.in.\nYour username is $row['email']\n.Your password is $row['password']"; if(mail($to, $subject, $message, $headers)) { echo "<center><font face='Verdana' size='2'><b><br><br><br><br><br>THANK YOU</b> <br>Your passwords are posted to your email address. Please check your mail soon.</center>"; } else { echo "<center><font face='Verdana' size='2' color=red>There is some system problem in sending login details to your address" <br><br> <input type='button' value='Retry' onClick='history.go(-1)'></center></font>"; } } ?>
  13. Dear All, I have written the following code for "Forgot Password" link on my website www.computationalphotography.in. Below is my code: <?php include_once"configure.php"; $email=$_POST['email']; $email=mysql_real_escape_string($email); if($email<>""){ $check_user_data = mysql_query("SELECT * FROM registration WHERE email = '$email'") or die(mysql_error()); if(mysql_num_rows($check_user_data) == 0) {echo '<script language="javascript">alert("This email address does not exist. Please try again.")</script>;';unset($email);} else {$row = mysql_fetch_array($check_user_data);$email=$row['email']; $to = $email; $subject = "Here are your login details . . . "; $message = "This is in response to your request for login details on www.computationalphotography.in.\nYour username is $row['email']\n.Your password is $row['password'].\n"; $headers = "From: ".$psbhostemailaddress."\r\nReply-To: ".$email; if(mail($to, $subject, $message, $headers)){echo "<center><font face='Verdana' size='2'><b><br><br><br><br><br>THANK YOU</b> <br>Your passwords are posted to your email address. Please check your mail soon.</center>";} else{echo "<center><font face='Verdana' size='2' color=red>There is some system problem in sending login details to your address. <br><br><input type='button' value='Retry' onClick='history.go(-1)'></center></font>";} }} ?> On execution I am receiving the error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/computat/public_html/forgotpassword.php on line 22 Kindly help me out! Thank you.
  14. Dear All, I want to check that the user has entered a value of the correct data-type in the fields which are marked by * in my website www.computationalphotography.in/registration.php. Below is the code for the same, my form is not returning the value that I intend it to return, i.e. an error message for wrongly/not entering data. Please help me out in this regard: <html> <head> <title> Photography Experiment Registration </title> </head> <body> <h1> Questionnaire </h1> <h3> We would like to know about your background and interests in photography. For each multiple-choice question, please circle all answers that apply.</h3> <?php if($_POST['Submit']== "Submit") { $errormessage=""; if(empty($_POST['name'])) { $errormessage = "<li>You forgot to enter a name</li>"; } if(empty($_POST['email'])) { $errormessage = "<li>You forgot to enter an email</li>"; } if(empty($_POST['password'])) { $errormessage = "<li>You forgot to enter password</li>"; } $varname = $_POST['submit']; $varmail = $_POST['email']; $varpass = $_POST['password']; if(!empty($errorMessage)) { echo("<p>There was an error with your form:</p>\n"); echo("<ul>" . $errorMessage . "</ul>\n"); } } ?> <br> <br> <form method="post" action="registration.php"> Fields marked with * are mandatory <br> <br> Name* <input name="name" type="text"> <br> <br> Email*&nbsp <input name="email" type="text"> <br> <br> Password*<pre></pre> <input type="password" name="password"> <br> <br> Re-Type Password*<pre></pre> <input type="password" name="password"> <br> <br> 1.) Roughly How many pictures do you take each year?* <br> <br> <input name="o1q1" type="radio" value="a"> a) a few: <10 in a year <br> <input name="o2q1" type="radio" value="b"> b) many: probably 100's a photos a year <br> <input name="o3q1" type="radio" value="c"> c) a lot: probably 1000's of photos a year <br> <br> 2.) Do you share your pictures with anyone?* <br> <input name="o1q2" type="radio" value="a"> a) No <br> <input name="o2q2" type="radio" value="b"> b) Yes, but only with friends or family <br> <input name="o3q2" type="radio" value="c"> c) Yes, I share with friends or family and also post on public sites such as Flickr, Picasaweb, or Snapfish for anyone to see. <br> <input name="o4q2" type="radio" value="d"> d) Yes, I share frequently and I have also published my photos in books or magazines, or exhibited my photos in shows. <br> <br> 3.) How much training in photography have you had?* <br> <input name="o1q3" type="radio" value="a"> a) None <br> <input name="o2q3" type="radio" value="b"> b) Some, but it's self-taught from books or websites <br> <input name="o3q3" type="radio" value="c"> c) Quite a bit: I have taken courses in photography <br> <input name="o4q3" type="radio" value="d"> d) A lot:I have completed a degreee or certificate in the subject <br> <br> 4.) How do you describe yourself as a photographer?* <br> <input name="o1q4" type="radio" value="a"> a) A novice:someone who takes a few pictures occasionally <br> <input name="o2q4" type="radio" value="b"> b) An amateur:someone who takes many photos, but doesn't usually share them <br> <input name="o3q4" type="radio" value="c"> c) An enthusiast:someone who loves to take pictures, possibly shows them with oters on public sites, or who might own a DSLR, or frequently uses a camera in other than "automatic mode" <br> <input name="o4q4" type="radio" value="d"> d) An expert:skilled photographer who has published their work, or exhibited their work in shows, or has been paid for their work <br> <br> 5.) Do you have artistic training or exposure?* <br> <input name="o1q5" type="radio" value="a"> a) No <br> <input name="o2q5" type="radio" value="b"> b) I visit museums or art galleries <br> c) I have studied art: please describe <br> <textarea name="data5c" cols="50" rows="5"> </textarea> <br> d) I am a practicing artist: please describe <br> <textarea name="data5d" cols="50" rows="5"> </textarea> <br> <br> 6.) Some optional information, if you don't mind. We respect your privacy. <br> <br> Age <br> <textarea name="6a" cols="1" rows="1"> </textarea> <br> <br> Gender <br> <input name="male" type="radio" value="a"> a) Male <br> <input name="female" type="radio" value="b"> b) Female <br> <br> Languages Spoken <br> <textarea name="6b" cols="25" rows="2"> </textarea> <br> <br> Languages Read <br> <textarea name="6c" cols="25" rows="2"> </textarea> <br> <br> <br> <input type="submit" name="Submit" value="Submit"> <input type="reset" value"Reset"> </form> </body> </html> [code]
  15. Thanks...got some interesting results, will post if I have a specific query.
  16. Dear All, I am writing a code to register new users on my website http://www.computationalphotography.in/registration.php. I want the page to check the entries in each field and return an error if any field is left blank or an invalid data-type has been entered. Could you please suggest ways to achieve this? Below is my code for the form: <html> <head> <title> Photography Experiment Registration </title> </head> <body> <h1> Questionnaire </h1> <h3> We would like to know about your background and interests in photography. For each multiple-choice question, please circle all answers that apply.</h3> <form method="post" action="registration.php"> Note that all fields marked with * are mandatory <br> <br> Name* <input name="name" type="text"> <br> <br> Email&nbsp <input name="email" type="text"> <br> <br> Password<pre></pre> <input type="password" name="password"> <br> <br> Re-Type Password<pre></pre> <input type="password" name="password"> <br> <br> 1.) Roughly How many pictures do you take each year? <br> <br> <input name="o1q1" type="radio" value="a"> a) a few: <10 in a year <br> <input name="o2q1" type="radio" value="b"> b) many: probably 100's a photos a year <br> <input name="o3q1" type="radio" value="c"> c) a lot: probably 1000's of photos a year <br> <br> 2.) Do you share your pictures with anyone? <br> <input name="o1q2" type="radio" value="a"> a) No <br> <input name="o2q2" type="radio" value="b"> b) Yes, but only with friends or family <br> <input name="o3q2" type="radio" value="c"> c) Yes, I share with friends or family and also post on public sites such as Flickr, Picasaweb, or Snapfish for anyone to see. <br> <input name="o4q2" type="radio" value="d"> d) Yes, I share frequently and I have also published my photos in books or magazines, or exhibited my photos in shows. <br> <br> 3.) How much training in photography have you had? <br> <input name="o1q3" type="radio" value="a"> a) None <br> <input name="o2q3" type="radio" value="b"> b) Some, but it's self-taught from books or websites <br> <input name="o3q3" type="radio" value="c"> c) Quite a bit: I have taken courses in photography <br> <input name="o4q3" type="radio" value="d"> d) A lot:I have completed a degreee or certificate in the subject <br> <br> 4.) How do you describe yourself as a photographer? <br> <input name="o1q4" type="radio" value="a"> a) A novice:someone who takes a few pictures occasionally <br> <input name="o2q4" type="radio" value="b"> b) An amateur:someone who takes many photos, but doesn't usually share them <br> <input name="o3q4" type="radio" value="c"> c) An enthusiast:someone who loves to take pictures, possibly shows them with oters on public sites, or who might own a DSLR, or frequently uses a camera in other than "automatic mode" <br> <input name="o4q4" type="radio" value="d"> d) An expert:skilled photographer who has published their work, or exhibited their work in shows, or has been paid for their work <br> <br> 5.) Do you have artistic training or exposure? <br> <input name="o1q5" type="radio" value="a"> a) No <br> <input name="o2q5" type="radio" value="b"> b) I visit museums or art galleries <br> c) I have studied art: please describe <br> <textarea name="data5c" cols="50" rows="5"> </textarea> <br> d) I am a practicing artist: please describe <br> <textarea name="data5d" cols="50" rows="5"> </textarea> <br> <br> 6.) Some optional information, if you don't mind. We respect your privacy. <br> <br> Age <br> <textarea name="6a" cols="1" rows="1"> </textarea> <br> <br> Gender <br> <input name="male" type="radio" value="a"> a) Male <br> <input name="female" type="radio" value="b"> b) Female <br> <br> Languages Spoken <br> <textarea name="6b" cols="25" rows="2"> </textarea> <br> <br> Languages Read <br> <textarea name="6c" cols="25" rows="2"> </textarea> <br> <br> <br> <input type="submit" value="Send"> <input type="reset" value"Reset"> </form> </body> </html> Thank you for your help. I have a few more queries regarding this web-form, but will mention them once this query is resolved.
  17. @batwimp...Thanks for pointing this out...this is one of the problems that I was facing currently with my code...
  18. thanks for your prompt reply...let me get back to you in a short while...
  19. I need to check whether data in each and every field is entered in the proper format and send an error message if anything is left out or entered in the wrong format.
  20. Dear All, I am developing a website www.computationalphotography.in on which I need to register new users. I have designed an HTML form for this purpose, but will need help with writing the code for checking and validating the data in the respective fields. The code for my web form is below and the address of the website is www.computationalphotography.in/registration.php: <html> <head> <title> Photography Experiment Registration </title> </head> <body> <h1> Questionnaire </h1> <h3> We would like to know about your background and interests in photography. For each multiple-choice question, please circle all answers that apply.</h3> <form method="post" action="registration.php"> Name <input name="name" type="text"> <br> <br> Email <input name="email" type="text"> <br> <br> 1.) Roughly How many pictures do you take each year? <br> <br> <input name="radios" type="radio" value="a"> a) a few: <10 in a year <br> <input name="radios" type="radio" value="b"> b) many: probably 100's a photos a year <br> <input name="radios" type="radio" value="c"> c) a lot: probably 1000's of photos a year <br> <br> 2.) Do you share your pictures with anyone? <br> <input name="radios" type="radio" value="a"> a) No <br> <input name="radios" type="radio" value="b"> b) Yes, but only with friends or family <br> <input name="radios" type="radio" value="c"> c) Yes, I share with friends or family and also post on public sites such as Flickr, Picasaweb, or Snapfish for anyone to see. <br> <input name="radios" type="radio" value="d"> d) Yes, I share frequently and I have also published my photos in books or magazines, or exhibitde my photos in shows. <br> <br> 3.) How much training in photography have you had? <br> <input name="radios" type="radio" value="a"> a) None <br> <input name="radios" type="radio" value="b"> b) Some, but it's self-taught from books or websites <br> <input name="radios" type="radio" value="c"> c) Quite a bit: I have taken courses in photography <br> <input name="radios" type="radio" value="d"> d) A lot:I have completed a degreee or certificate in the subject <br> <br> 4.) How do you describe yourself as a photographer? <br> <input name="radios" type="radio" value="a"> a) A novice:someone who takes a few pictures occasionally <br> <input name="radios" type="radio" value="b"> b) An amateur:someone who takes many photos, but doesn't usually share them <br> <input name="radios" type="radio" value="c"> c) An enthusiast:someone who loves to take pictures, possibly shows them with oters on public sites, or who might own a DSLR, or frequently uses a camera in other than "automatic mode" <br> <input name="radios" type="radio" value="d"> d) An expert:skilled photographer who has published their work, or exhibited their work in shows, or has been paid for their work <br> <br> 5.) Do you have artistic training or exposure? <br> <input name="radios" type="radio" value="a"> a) No <br> <input name="radios" type="radio" value="b"> b) I visit museums or art galleries <br> c) I have studied art: please describe <br> <textarea name="data5c" cols="50" rows="5"> </textarea> <br> d) I am a practicing artist: please describe <br> <textarea name="data5d" cols="50" rows="5"> </textarea> <br> <br> 6.) Some optional information, if you don't mind. We respect your privacy. <br> <br> Age <br> <textarea name="6a" cols="1" rows="1"> </textarea> <br> <br> Gender <br> <input name="radios" type="radio" value="a"> a) Male <br> <input name="radios" type="radio" value="b"> b) Female <br> <br> Languages Spoken <br> <textarea name="6b" cols="25" rows="2"> </textarea> <br> <br> Languages Read <br> <textarea name="6c" cols="25" rows="2"> </textarea> <br> <br> <br> <input type="submit" value="Send"> <input type="reset" value"Reset"> </form> </body> </html> Kindly help me out with this issue. Thank you for your help in this regard.
  21. My exact question is that $sql stores values b1,1 in the column ImageNumber and LikeCounter.Here b1 is the image name which is statically entered into the db. I want this to be dynamically entered for each image name. The code is the part of rating system that I have developed which is referenced again and again when the user votes in a Like/Dislike voting system. if( isset($_POST['Like']) ) { $sql = 'INSERT INTO record(ImageNumber,LikeCounter) VALUES (\'b1\', 1)'; mysql_query($sql, $db) or die(mysql_error()); echo 'Like vote is registered'; } elseif(isset($_POST['Dislike'])) { $sql = 'INSERT INTO record(ImageNumber,DislikeCounter) VALUES (\'b1\', 1)'; mysql_query($sql, $db) or die(mysql_error()); echo 'Dislike vote is registered'; } [\code] Thank you for your help. [quote author=AyKay47 link=topic=354171.msg1672827#msg1672827 date=1329795892] I hope that isn't your actual db credentials. What exactly do you need help with? [/quote]
  22. Hi Guys, I am designing this website that takes votes on images. I need to store the votes for each image against the image name and a username. For this purpose, I need to modify the current code which retrieves votes from the voting system but doesn't have a system to enter the image name dynamically. Below is the code for the same: <?php ob_start(); $host="localhost"; $username="computat_abhi"; $password="[..]"; $databasename="computat_button"; $tbl_name="record"; $db=mysql_connect ("localhost", "computat_abhi", "[..]")or die(mysql_error()); mysql_select_db($databasename, $db) or die(mysql_error()); if( isset($_POST['Like']) ) { $sql = 'INSERT INTO record(ImageNumber,LikeCounter) VALUES (\'b1\', 1)'; mysql_query($sql, $db) or die(mysql_error()); echo 'Like vote is registered'; } elseif(isset($_POST['Dislike'])) { $sql = 'INSERT INTO record(ImageNumber,DislikeCounter) VALUES (\'b1\', 1)'; mysql_query($sql, $db) or die(mysql_error()); echo 'Dislike vote is registered'; } ob_end_flush(); ?> <html> <head> <title> Do you Like/Dislike this image? </title> </head> <body> <h1> Do you Like/Dislike this image? </h1> <form name="form1" method ="post"> <input type="submit" name="Like" value="Like"> <input type="submit" name="Dislike" value="dislike"> </form> </body> </html> Another issue is to register a new user on the website www.computationalphotography.in and link it with the voting system above. Looking forward to your help and suggestions.
×
×
  • 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.