Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 10-29-2007, 05:16 PM Basic PHP questions
Skilled Talker

Posts: 98
Name: Bruce A
Trades: 0
1. I read an article one day about using css in php forms to validate that the person filling out the form is actually a person, (typing in numbers seen on an image). Where's a link I can use the script for that, or learn how to do it?

2. What do I create a script that checks to see if an email address entered is already taken?



Thanks guys
__________________

Please login or register to view this content. Registration is FREE


bcackerman is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-29-2007, 05:33 PM Re: Basic PHP questions
Foundationflash's Avatar
Ultra Talker

Posts: 410
Name: Harry Burt
Location: Colchester, Essex, England
Trades: 0
1. You want a CAPTCHA, which doesn't exactly use CSS. You can find them at www.captcha.net and www.captchas.net

2. You will want to compare it against a database holding email address registered (I assume you mean to your site), using MySQL integrated into PHP.

Hope this helps,
Harry
__________________
Foundation Flash tutorials :
Please login or register to view this content. Registration is FREE


New Dreamed Up Web Design:
Please login or register to view this content. Registration is FREE
Foundationflash is offline
Reply With Quote
View Public Profile Visit Foundationflash's homepage!
 
Old 10-29-2007, 05:57 PM Re: Basic PHP questions
Skilled Talker

Posts: 98
Name: Bruce A
Trades: 0
Ok, got number 1, but how would I do number 2 though, coding wise.
__________________

Please login or register to view this content. Registration is FREE


bcackerman is offline
Reply With Quote
View Public Profile
 
Old 10-29-2007, 06:31 PM Re: Basic PHP questions
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
To check if email already exists just do a basic query on the users table such as
'SELECT username FROM tbl_users WHERE username= $_POST['email_address'] '
Use the mysql_num_rows function to redirect to a login failed script. If there is a row returned then the email already exists.

$FoundUser = mysql_num_rows($result);

if($FoundUser){
header ("Location: loginFailed.php");
exit;
}
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 10-29-2007, 06:35 PM Re: Basic PHP questions
Skilled Talker

Posts: 98
Name: Bruce A
Trades: 0
ok, thanks!

also one last question. I wanted to create a script that look for the number of unique email address (email) in a table (info). How would i do that
__________________

Please login or register to view this content. Registration is FREE


bcackerman is offline
Reply With Quote
View Public Profile
 
Old 10-29-2007, 06:43 PM Re: Basic PHP questions
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
As for unique you can use DISTINCT in the query.

"SELECT DISTINCT email FROM info"
maxxximus is offline
Reply With Quote
View Public Profile
 
Old 10-29-2007, 06:49 PM Re: Basic PHP questions
Skilled Talker

Posts: 98
Name: Bruce A
Trades: 0
<?php


$username = "*";
$password = "*";
$hostname = "localhost";
$database = "*";


$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");

$selected = mysql_select_db($database,$dbh)
or die("Could not select");



$result = mysql_query("SELECT DISTINCT email FROM info");

echo $result
?>




like that?
__________________

Please login or register to view this content. Registration is FREE


bcackerman is offline
Reply With Quote
View Public Profile
 
Old 10-31-2007, 05:53 PM Re: Basic PHP questions
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
Trades: 1
don't want to be mean but read a tutorial before asking for basic knowledge
http://www.tizag.com/mysqlTutorial/mysqlquery.php
__________________
If you like my posts ... TK is appreciated:)

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Reply     « Reply to Basic PHP questions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.26902 seconds with 12 queries