Page 1 of 1
I need some help 2 extract an email from a page
Posted: Sun Sep 03, 2006 10:04 am
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
Posted: Sun Sep 03, 2006 10:10 am
by feyd
I'm quite confused by your post. Can you ask your question(s) again with more explaination and proper English please?
Posted: Sun Sep 03, 2006 10:11 am
by Chris Corbyn
I read your post like 3 times and it still makes no sense

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.
Posted: Sun Sep 03, 2006 11:48 am
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
Posted: Sun Sep 03, 2006 11:56 am
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.
Posted: Sun Sep 03, 2006 11:57 am
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.
Posted: Sun Sep 03, 2006 12:07 pm
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
Posted: Mon Sep 04, 2006 11:01 am
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.