www.webdeveloper.com
Results 1 to 10 of 10

Thread: modify select query result

  1. #1
    Join Date
    Jan 2006
    Posts
    63

    modify select query result

    i am not sure how to do this and i would appreaciate any ideas

    example if i have this in my table (www.webdeveloper.com)

    IT would be modified to
    info@webdeveloper.com
    sales@webdeveloper.com
    techsupport@webdeveloper.com

    then i input a subject and a mesage and click on send, the modified data would become the email address that it will email out to.

    where am i starting?
    find a way to change the first 4 characters in very result and change it to the new variables

    i.e
    www.webdeveloper
    change first 4 (www.)
    to

    $first ( which is equal to info@)
    then
    $second (which is equal to sales@)



    I would appreaciate any ideas.


    Thank you all

  2. #2
    Join Date
    Oct 2005
    Location
    Erie, PA
    Posts
    401
    $preg_replace??? I am not following your question to well the Title of the Post has to do with a query but in your message you are asking how to replace www. with something else..

  3. #3
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,736
    Quote Originally Posted by USER4FUN
    I would appreaciate any ideas.
    On sending spam? Don't do it. It spoils the web for everyone.

  4. #4
    Join Date
    Jan 2006
    Posts
    63
    by no means am i going to spam.

    to make you feel better, i swear on everything that is good i an not spamming, i hate spam.
    .

    to the previosue post,
    yes sir, i am trying to find a way to reaplace the
    www.
    into different variable that would be declared in a different file.

    list.inc

    $first = info@;
    $second = sales@;

    thatis is pretty much it, i go arround and find the email address of the 500 domains that i have and need to contact.

    I need to shoot out these probable emails
    like

    info@domain.com
    sales@domain.com
    and hope for a response so i can store their contact information. either that or visit each site and try to find out their contact email, and then look like an idiotfor losing the contact list file.

  5. #5
    Join Date
    Feb 2005
    Location
    Tauranga
    Posts
    2,062
    PHP Code:
    $domain "webdeveloper.com";

    echo(
    "info@"$domain);
    echo(
    "contact@"$domain);
    echo(
    "a href=\"mailto:sales@"$domain ."\">sales@"$domain ."</a>); 
    Last edited by Sheldon; 03-06-2006 at 12:45 AM.

  6. #6
    Join Date
    Jan 2005
    Location
    Alicante (Spain)
    Posts
    7,736
    Quote Originally Posted by USER4FUN
    by no means am i going to spam.
    Quote Originally Posted by USER4FUN
    i go arround and find the email address of the 500 domains
    Quote Originally Posted by USER4FUN
    I need to shoot out these probable emails
    like

    info@domain.com
    sales@domain.com
    and hope for a response
    If it looks like a duck, walks like a duck and quacks like a duck, normally it's a duck.
    Last edited by bokeh; 03-06-2006 at 03:33 AM.

  7. #7
    Join Date
    Jan 2006
    Posts
    63
    i should have proof read my post, when i said i go arround
    i mean to say instead of going arround.

    i HAD a list of 500 domains that i deal with. their contact email was stored in a file that i lost.

    i still had a backup of the domain name and i did not want to have to visit each domain by itself and look up their contact information.

    with that being said, i dont think its a duck, nor does it quack like a duck therefore IT IS NOT A DUCK ( NOT SPAM) LOL

    thank you all for your help.

    incase any other readers have any other ideas, i will be checking this post again.

  8. #8
    Join Date
    Jan 2006
    Posts
    63
    sorry but this will not work
    quote

    $domain = "webdeveloper.com";

    echo("info@". $domain);
    echo("contact@". $domain);
    echo("a href=\"mailto:sales@". $domain ."\">sales@". $domain ."</a>);

    /quote


    it will not work beacause the result will be
    info@www.webdeveloper.com

    i need to replace the www. instead of add something infront of it.

    thankx

  9. #9
    Join Date
    Feb 2005
    Location
    Tauranga
    Posts
    2,062
    bull****

    PHP Code:
    $domain "webdeveloper.com"
    where is the www. in there?

  10. #10
    Join Date
    Jan 2006
    Posts
    63
    I GOT IT, THANK YOU ALL FOR THE HELP

    <html>
    <head>

    <title>Untitled</title>

    </head>
    <body>

    <?

    $replacer = 'www.';
    $first = 'info@';
    $second = 'sales@';
    $contact = str_replace("$replacer", "$first", "$Domain");
    $secontact = str_replace("$replacer", "$second", "$Domain");

    echo "$contact<br>";
    echo $secontact;




    ?>

    </body>
    </html>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles