Jump to content

ben3001

Members
  • Content Count

    213
  • Joined

  • Last visited

Everything posted by ben3001

  1. ben3001

    PHP Voting Script

    Hey guys,I'm trying to find a solution to my ratings script problem.At the moment I have a simple thumbs up and down script which posts +1 in the corresponding field (votes_up or votes_down). The only security I have at the moment preventing the user from voting numerous times is a cookie is set with the commentID. I then have a statement that: if cookie is set, then do not display voting thumbs. This is my temporary solution but i'm sure there is another way.Is it possible to post many values into one field in a mysql database seperated by commas?The idea I have is that when the user votes their user id is posted into the user_vote field along with all the other id's that have voted seperated by commas.If is possible then I would have a script that searchs each userid, and if there isn't a match then display voting form.Have you got any suggestions?CheersB
  2. ben3001

    Player Urgent

    Hey mate thanks for the quick reply, how would i go about this?Tonight is really my last chance
  3. ben3001

    Player Urgent

    Hi Guys long time,I have a little problem here i have a project in for tomorrow and my group have let me down.I need a music player that loads all mp3 files that are in a folder.I have seen some where you have to specify the folder you want in the place list (in the xml file), but this is not what i need. It has to display all the files in that folder.Im really a little anoyed becuase at the last minute my mates said they couldnt get anything to work.Any help is really appreacited This is one examplehttp://www.premiumbeat.com/flash_resources...player_menu.phpBut you have to have direct url, as shown in the below xml file <?xml version="1.0" encoding="UTF-8"?><xml> <track> <path>samples/</path> <title>Track 1 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 2 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 3 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 4 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 5 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 6 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 7 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 8 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 9 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 10 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 11 - Track Title</title> </track> <track> <path>song.mp3</path> <title>Track 12 - Track Title</title> </track></xml> Ben
  4. ben3001

    Fixed Fonts

    Well smartalco others also seem to think his question is also unclear, thus I made an assumption, as to which you cannot judge until Amit replies. I have simply tried to clarify what he is asking and although I may be wrong, your comment is irrelevant to the question asked and has no purpose! Possibly you should wait for his reply instead of being certain. .
  5. ben3001

    Fixed Fonts

    Im guessing by fixed fonts you mean fonts that everyone has on their computer, right?
  6. although you can build good sites in flash (and i have seen quite a few) i believe flash should be used to enhance the site.
  7. ben3001

    Captcha

    i'd just like to take this time to say thanks a million for your help. it worked!
  8. ben3001

    Opinions ?

    As the designer of a site you should be the one who has a flare for design and creativity. You should prehaps suggest to the client these colours are not appealing to the site because...Its better to say now at the start rather than leaving it till the end.
  9. As i understand it, you want to remove the menu that appears when you right click. To be honest it is pointless in trying. If someone wants to get an image from your site they will!For example in firefox right click a page and select View Page Info. Then select media. Here you can download evey image displayed on the site.
  10. ben3001

    Captcha

    i have been looking at how other sites do this and i just cant seem to accomplish it
  11. ben3001

    Captcha

    Sorry but i dont really understand what i must do.this is the code i have for the captcha field <tr> <td>Verification Code</td> <td><br /><img src="verify.php" alt="captcha" /><a href="design.php?num=1">Refresh </a><br />Enter the verification code as it is shown in the box above.<br /> <input id="cpt" name="captcha" type="text" size="10" maxlength="5" />'; if( $incorrectCaptcha) print " <span style='color:#FF0000'> Invalid code. Try again!</span>"; print '</td> </tr>
  12. This is what your looking for i believehttp://www.aharef.info/2006/05/websites_as_graphs.htm
  13. ben3001

    Captcha

    ok so this is the working captchahttp://aquatic-management.org/design.phpthe image is held at: http://aquatic-management.org/verify.phpas you see when the page refreshes any data inputted into the form is lost
  14. ben3001

    Captcha

    so how do other captchas work? currently the only way i have of refreshing the captcha is by pressing a button that refreshes the whole page, however, this obviously looses the data inputted into the form
  15. I think it makes the statement more effective .I just find it bad practice, whats the point of teaching someone something they will never use. If you gonna go out your way to teach something do it the valid way!
  16. ben3001

    Captcha

    Hi justsomeguy,i've managed to get it working finally using this tutorial. http://www.webcheatsheet.com/php/create_ca..._protection.php.what i would like to add is a button that will refresh the image automatically.is there some sort of javascript where you can reload the image file verify.php
  17. ben3001

    Captcha

    thanks for the advice ill look in to it. indenting makes it look alot more legible
  18. ben3001

    Captcha

    I have found where i didnt close it, it was on line 56, now im back to where the form submits regardless of the captcha. <?php$name=$_POST['Name'];$Email=$_POST['Email'];$Comment=$_POST['Comment'];$Subject=$_POST['subject'];$counter=0;require_once('recaptchalib.php');// Get a key from [url="http://recaptcha.net/api/getkey"]http://recaptcha.net/api/getkey[/url]$publickey = "6LcFHwAAAAAAAFyCHo-h-t65VHyvye-yL9VDhFtY";$privatekey = "6LcFHwAAAAAAAE22y6Z62EprK2oyTg9NNjGVl07h";# the response from reCAPTCHA$resp = null;# the error code from reCAPTCHA, if any$error = null;function printit(){global $publickey;if ( isset ($_POST['submit'])){$incorrectCustomer="";$incorrectEmail="";$incorrectDate="";$incorrectComment="";if($_POST['Name']==null){$incorrectCustomer="<span style='color:#FF0000'> * Required</span>";}else{$incorrectCustomer="";}if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST['Email'])){$incorrectEmail="";}else{$incorrectEmail="<span style='color:#FF0000'> * Required</span>";}if($_POST['Comment']==null){$incorrectComment="<span style='color:#FF0000'> * Required</span>";}else{$incorrectComment="";}}if ($_POST["recaptcha_response_field"]) {$resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_POST["recaptcha_challenge_field"],$_POST["recaptcha_response_field"]);}if ($resp->is_valid) {echo "You got it!";} else {# set the error code so that we can display it$error = $resp->error;}echo recaptcha_get_html($publickey, $error);print '<span class=style4>Enquires</span><p>Problem with the site? Need more information? Complete the form below,if you have entered your email address correctly you should recieve an automated reply confirmingyour query has been recieved . All emails are replied to within 24 hours.</p><script language="JavaScript"><!--document.myForm.myField.disabled=true;//--></script><form name="Contact Us" action="design2.php" method="post"><table style= width="100%" border="0" cellpadding="3" cellspacing="1"><tr><td width="20%"><p align="left">Website design regarding:</p></td><td width="80%"><input class="border" type="text" disabled onFocus="if (this.disabled) this.blur()" name="subject" size="35" maxlength="100" value="http://www.aquatic-management.org""' . $_POST['subject'] . '"/>';print '</td></tr><tr><td width="20%">Name:</td><td width="80%"><input class="border" type="text" name="Name" size="25" maxlength="35" value="' . $_POST['Name'] . '" />';print "$incorrectCustomer";print '</td></tr><tr><td>Email:</td><td><input class="border" type="text" name="Email" size="35" maxlength="100" value="' . $_POST['Email'] . '"/>';print "$incorrectEmail";print '</td></tr><tr><td>Enquiry</td><td><textarea class="border" name="Comment" rows="3" cols="41">' . $_POST['Comment'] . '</textarea>';print "$incorrectComment";print '</td></tr><tr><td>Verification:</td><td>' . recaptcha_get_html($publickey, $error) . '</td></tr><table border="0" width="100%"><tr><td width="100%"><input type="submit" name="submit" value="Send" /> <input type="reset" name="Reset" value="Reset" /></td></tr></table></form></table>';}if ( isset ($_POST['submit'])){$validEmail=true;$validNumber=true;if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)){ }else{$validEmail=false;}if(($name==null)||($validEmail==false)||($Comment==null)){print"";printit();}else{ mail("b_e_n04@hotmail.com","Website Design: [url="http://www.aquatic-management.org",""]http://www.aquatic-management.org","[/url]From: $nameEmail Address: $EmailMessage: $Comment","From:$Email");mail("$Email","Auto Reply Website Design: [url="http://www.aquatic-management.org",""]http://www.aquatic-management.org","[/url]Dear: $nameThank you for contacting me regarding [url="http://www.aquatic-management.org"]http://www.aquatic-management.org[/url]. Your enquiry is shown below.'$Comment'I attempt to respond to all emails with in 24 hours however, due to busy times this may take longer.Once again thank-you for your enquiry.Ben Davies","From:b_e_n04@hotmail.com");print "<span class=style4>Thank you for your enquiry</span><br><p>Comments are always welcomed and replied to within 2-3 days.</br></font><p>The email you sent is shown below, you should of received an email confirming I have recieved your enquiry:</p><strong><p>Website design regarding:</strong> [url="http://www.aquatic-management.org<p/>"]http://www.aquatic-management.org<p/>[/url]<strong><p>Name:</strong> $name<p/><strong><p>Email address:</strong> $Email</p><strong><p>Enquiry:</strong> $Comment</p>";}}else { // Display the form.printit();}?>
  19. ben3001

    Captcha

    now ive got a new error in removing that note line 187 is ?>
  20. ben3001

    Captcha

    i've added the code in the part where it gets executed when the form gets submitted but ive recieved this message <?php $name=$_POST['Name'];$Email=$_POST['Email'];$Comment=$_POST['Comment'];$Subject=$_POST['subject'];$counter=0;require_once('recaptchalib.php');// Get a key from [url="http://recaptcha.net/api/getkey"]http://recaptcha.net/api/getkey[/url]$publickey = "6LcFHwAAAAAAAFyCHo-h-t65VHyvye-yL9VDhFtY";$privatekey = "6LcFHwAAAAAAAE22y6Z62EprK2oyTg9NNjGVl07h";# the response from reCAPTCHA$resp = null;# the error code from reCAPTCHA, if any$error = null;function printit(){ global $publickey;if ( isset ($_POST['submit'])){$incorrectCustomer="";$incorrectEmail="";$incorrectDate="";$incorrectComment="";if($_POST['Name']==null){$incorrectCustomer="<span style='color:#FF0000'> * Required</span>";}else{$incorrectCustomer="";}if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST['Email'])){$incorrectEmail="";} else {$incorrectEmail="<span style='color:#FF0000'> * Required</span>";}if($_POST['Comment']==null){$incorrectComment="<span style='color:#FF0000'> * Required</span>";}else{$incorrectComment="";}}if ($_POST["recaptcha_response_field"]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($resp->is_valid) { echo "You got it!"; } else { # set the error code so that we can display it $error = $resp->error; } echo recaptcha_get_html($publickey, $error);else {}print '<span class=style4>Enquires</span> <p>Problem with the site? Need more information? Complete the form below, if you have entered your email address correctly you should recieve an automated reply confirming your query has been recieved . All emails are replied to within 24 hours.</p><script language="JavaScript"><!--document.myForm.myField.disabled=true;//--></script><form name="Contact Us" action="design2.php" method="post"><table style= width="100%" border="0" cellpadding="3" cellspacing="1"><tr><td width="20%"><p align="left">Website design regarding:</p></td><td width="80%"><input class="border" type="text" disabled onFocus="if (this.disabled) this.blur()" name="subject" size="35" maxlength="100" value="http://www.aquatic-management.org""' . $_POST['subject'] . '"/>';print '</td></tr><tr><td width="20%">Name:</td><td width="80%"><input class="border" type="text" name="Name" size="25" maxlength="35" value="' . $_POST['Name'] . '" />';print "$incorrectCustomer";print '</td> </tr><tr><td>Email:</td><td><input class="border" type="text" name="Email" size="35" maxlength="100" value="' . $_POST['Email'] . '"/>';print "$incorrectEmail";print '</td></tr><tr><td>Enquiry</td><td><textarea class="border" name="Comment" rows="3" cols="41">' . $_POST['Comment'] . '</textarea>';print "$incorrectComment";print '</td></tr><tr> <td>Verification:</td> <td>' . recaptcha_get_html($publickey, $error) . '</td> </tr><table border="0" width="100%"> <tr> <td width="100%"><input type="submit" name="submit" value="Send" /> <input type="reset" name="Reset" value="Reset" /></td> </tr></table></form></table>';}if ( isset ($_POST['submit'])) {$validEmail=true;$validNumber=true;if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)){ }else {$validEmail=false;}if(($name==null)||($validEmail==false)||($Comment==null)) { print"";printit();}else { mail("b_e_n04@hotmail.com","Website Design: [url="http://www.aquatic-management.org",""]http://www.aquatic-management.org","[/url]From: $name Email Address: $Email Message: $Comment","From:$Email");mail("$Email","Auto Reply Website Design: [url="http://www.aquatic-management.org",""]http://www.aquatic-management.org","[/url]Dear: $nameThank you for contacting me regarding [url="http://www.aquatic-management.org"]http://www.aquatic-management.org[/url]. Your enquiry is shown below. '$Comment'I attempt to respond to all emails with in 24 hours however, due to busy times this may take longer.Once again thank-you for your enquiry.Ben Davies","From:b_e_n04@hotmail.com"); print "<span class=style4>Thank you for your enquiry</span> <br><p>Comments are always welcomed and replied to within 2-3 days.</br></font><p>The email you sent is shown below, you should of received an email confirming I have recieved your enquiry:</p> <strong><p>Website design regarding:</strong> [url="http://www.aquatic-management.org<p/>"]http://www.aquatic-management.org<p/>[/url]<strong><p>Name:</strong> $name<p/><strong><p>Email address:</strong> $Email</p> <strong><p>Enquiry:</strong> $Comment</p> "; }} else { // Display the form.printit();}?>
  21. ben3001

    Captcha

    Were are nearly there justsomeguy.the captcha form displays however, it seems as there is no point to it as you can just submit the form as normal without filling the captcha out and the form will submit.if you do enter the captcha it just prints You got it! and submits the form.@geekygirl thanks for the tut ill keep that in mind when im next thinking of doing another captcha.
  22. ben3001

    Captcha

    Now its performing as i have the incorrect api key, i definately have the right one. <?php $name=$_POST['Name'];$Email=$_POST['Email'];$Comment=$_POST['Comment'];$Subject=$_POST['subject'];$counter=0;require_once('recaptchalib.php');// Get a key from [url="http://recaptcha.net/api/getkey"]http://recaptcha.net/api/getkey[/url]$publickey = "6LcFHwAAAAAAAFyCHo-h-t65VHyvye-yL9VDhFtY";$privatekey = "6LcFHwAAAAAAAE22y6Z62EprK2oyTg9NNjGVl07h";# the response from reCAPTCHA$resp = null;# the error code from reCAPTCHA, if any$error = null;function printit(){if ( isset ($_POST['submit'])){$incorrectCustomer="";$incorrectEmail="";$incorrectDate="";$incorrectComment="";if($_POST['Name']==null){$incorrectCustomer="<span style='color:#FF0000'> * Required</span>";}else{$incorrectCustomer="";}if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_POST['Email'])){$incorrectEmail="";} else {$incorrectEmail="<span style='color:#FF0000'> * Required</span>";}if($_POST['Comment']==null){$incorrectComment="<span style='color:#FF0000'> * Required</span>";}else{$incorrectComment="";}}else {}print '<span class=style4>Enquires</span> <p>Problem with the site? Need more information? Complete the form below, if you have entered your email address correctly you should recieve an automated reply confirming your query has been recieved . All emails are replied to within 24 hours.</p><script language="JavaScript"><!--document.myForm.myField.disabled=true;//--></script><form name="Contact Us" action="design2.php" method="post"><table style= width="100%" border="0" cellpadding="3" cellspacing="1"><tr><td width="20%"><p align="left">Website design regarding:</p></td><td width="80%"><input class="border" type="text" disabled onFocus="if (this.disabled) this.blur()" name="subject" size="35" maxlength="100" value="http://www.aquatic-management.org""' . $_POST['subject'] . '"/>';print '</td></tr><tr><td width="20%">Name:</td><td width="80%"><input class="border" type="text" name="Name" size="25" maxlength="35" value="' . $_POST['Name'] . '" />';print "$incorrectCustomer";print '</td> </tr><tr><td>Email:</td><td><input class="border" type="text" name="Email" size="35" maxlength="100" value="' . $_POST['Email'] . '"/>';print "$incorrectEmail";print '</td></tr><tr><td>Enquiry</td><td><textarea class="border" name="Comment" rows="3" cols="41">' . $_POST['Comment'] . '</textarea>';print "$incorrectComment";print '</td></tr><tr> <td>Verification:</td> <td>' . recaptcha_get_html($publickey, $error) . '</td> </tr><table border="0" width="100%"> <tr> <td width="100%"><input type="submit" name="submit" value="Send" /> <input type="reset" name="Reset" value="Reset" /></td> </tr></table></form></table>';}if ($_POST["recaptcha_response_field"]) { $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if ($resp->is_valid) { echo "You got it!"; } else { # set the error code so that we can display it $error = $resp->error; } echo recaptcha_get_html($publickey, $error);}if ( isset ($_POST['submit'])) {$validEmail=true;$validNumber=true;if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)){ }else {$validEmail=false;}if(($name==null)||($validEmail==false)||($Comment==null)) { print"";printit();}else { mail("b_e_n04@hotmail.com","Website Design: [url="http://www.aquatic-management.org",""]http://www.aquatic-management.org","[/url]From: $name Email Address: $Email Message: $Comment","From:$Email");mail("$Email","Auto Reply Website Design: [url="http://www.aquatic-management.org",""]http://www.aquatic-management.org","[/url]Dear: $nameThank you for contacting me regarding [url="http://www.aquatic-management.org"]http://www.aquatic-management.org[/url]. Your enquiry is shown below. '$Comment'I attempt to respond to all emails with in 24 hours however, due to busy times this may take longer.Once again thank-you for your enquiry.Ben Davies","From:b_e_n04@hotmail.com"); print "<span class=style4>Thank you for your enquiry</span> <br><p>Comments are always welcomed and replied to within 2-3 days.</br></font><p>The email you sent is shown below, you should of received an email confirming I have recieved your enquiry:</p> <strong><p>Website design regarding:</strong> [url="http://www.aquatic-management.org<p/>"]http://www.aquatic-management.org<p/>[/url]<strong><p>Name:</strong> $name<p/><strong><p>Email address:</strong> $Email</p> <strong><p>Enquiry:</strong> $Comment</p> "; }} else { // Display the form.printit();}?>
  23. Im definately not sure of the solution however with the last example on that page the one with the fields the tab behaviour seems to be the same on all browsers.cant you look into both sources to see what's the difference?
  24. ben3001

    Captcha

    it doesn't seem to have the captcha on it. although im greatful the code is cleaner.Even with me have the required fields the spam bot manages to fill in everything perfectly
  25. This is from one of the local radio stages in London
×
×
  • Create New...