I need some help 2 extract an email from a page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
butchhh
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 9:42 am

I need some help 2 extract an email from a page

Post by butchhh »

I have a website and i want 2 give my users a way 2 see other users e-mail but the problem is that i have more infos there than the user all i want is the e-mail for example i need a box where u type an user, and that box will ad that user name 2 a link like: https://www.mywebsote.com/dfdsfd6565userid=USERHERE and after the loading of that page r some infos but what i need is 2 extract just the e-mail from that loaded page.

Ill reappy apreciate if someone can help me
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm quite confused by your post. Can you ask your question(s) again with more explaination and proper English please?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I read your post like 3 times and it still makes no sense 8O There's like one full-stop (period) in that whole post ;)

You want to allow users to view others users email addresses (presumably agreed by the users!). Where does extracting an email address from a page come into it? What code have you tried so far? Maybe that would help to clear up the confusion as to what you're aiming to do.
butchhh
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 9:42 am

Post by butchhh »

i have a link(this link must be hidden from users) with infos about the users like e-mail address, home address, phone etc and i need some kind of php that will extract from the link just the e-mail address...and i was thinking about a form with a box where i enter the userid and the script will extract just the e-mail adress and shows it to you. the link its something like this https://www.mysite.com/userid=JhonDoe and here ull see all info about jhon doe but i need that script 2 extract the e-mail address af the userid u enter in that form box.
in other words i enter a string in the form and the script connects 2 the link and extratcs only the e-mail .

sry for my bad english im really stressed hope this will help more ill update if u need more info thank you
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

Do you have the email address stored in any kind of database? If not, and you do actually intend to just lift it off a random page, you will probably need some sort of regexp. Although this is long-winded and it would probably be better in the long-run if you put your users data into a database of some sort.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Why does the link need to be "hidden" from users when you could put security restrictions in place to stop users from accessing it's content? ;)

Where is the data coming from in the first place? Out of a database I'm guessing, so read the data from the database, not from the page.
butchhh
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 9:42 am

Post by butchhh »

the info comes from a database that i dont have access, i have just link access thats the problem i got this script for the variable userid

Code: Select all

$id=mysql_real_escape_string($_GET['userid']);
$query=mysql_query("SELECT * FROM table_name WHERE id = '$id'") or die (mysql_error());
$row=mysql_fetch_array($query);

echo $row['email'];
hope this helps
butchhh
Forum Newbie
Posts: 4
Joined: Sun Sep 03, 2006 9:42 am

Post by butchhh »

i did the mail extract thing by using iframe in php and the link its hidden what i still cant do is that box where u enter the user at the end of the link after userid= and will redirect 2 that iframe.
Post Reply