1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing mailto button to a link button

Discussion in 'PHP & Perl' started by GustavNovak, Jun 8, 2012.

  1. GustavNovak

    GustavNovak Newbie

    Joined:
    Jun 7, 2012
    Messages:
    35
    Likes Received:
    5
    Occupation:
    Fries fryer
    Location:
    Potatogonia
    Hello everyone, I have posted this today to one newbie dedicated forum, to get some help, but I guess that it is as stupid question that it is not worth answering there. I really dont have anyone who would help me with this and it is really one and only thing I need to do with one of my sites in php. I am sure it would take 1 minute to read, facepalm and reply, so if anyone would help, I would remember his name until the Armageddon. (And believe me, I am still crying when watching Bruce pushing that button.)

    Back to the problem: I have a button: (the comail variable is email adress now, I ll be adding links then)

    button.jpg

    and I would love to make it into a link: (this is my solution which obviously is not working)

    link.jpg

    Ok this looks ridiculous, but I am really lost. This forum hates me also, even though I put it in code, this forum thinks it is a link. So well, there you go I ll be praying. Thanks in advance, have fun.
     
  2. skrode

    skrode Junior Member

    Joined:
    Nov 13, 2011
    Messages:
    103
    Likes Received:
    16
    change your code to this: onclick="window.location.href=.....

    edit:
    Code:
    <input type="button" class="apply" name="apply" value="Apply Now!" onclick="window.location.href='<?php echo get_post_meta($post->ID, 'wtf_comail', true); ?>'" />
    
     
    Last edited: Jun 8, 2012
  3. GustavNovak

    GustavNovak Newbie

    Joined:
    Jun 7, 2012
    Messages:
    35
    Likes Received:
    5
    Occupation:
    Fries fryer
    Location:
    Potatogonia
    Thank you a lot for your response, but this does not solve my problem.

    Let's say that the button is on a page www page/hello, after clicking the button it redirects me to www page/hello/$comail
     
  4. BlackIrish

    BlackIrish Junior Member

    Joined:
    Jun 14, 2008
    Messages:
    106
    Likes Received:
    54
    I would just forget about the stubborn thing, and leave the forum to think it's a link :D
     
  5. GustavNovak

    GustavNovak Newbie

    Joined:
    Jun 7, 2012
    Messages:
    35
    Likes Received:
    5
    Occupation:
    Fries fryer
    Location:
    Potatogonia
    I am an idiot and you are my hero. The next time I ll cry because of you pushing the button, thanks, it is not worth it, talking about relative and absolute paths i guess.
     
  6. GustavNovak

    GustavNovak Newbie

    Joined:
    Jun 7, 2012
    Messages:
    35
    Likes Received:
    5
    Occupation:
    Fries fryer
    Location:
    Potatogonia
    Maybe you could, but I can't post links so far. :) I know the post looks ridiculous with the images, but I got my answer and thanks.