Reload page when link is clicked

Discussion in 'HTML & Website Design' started by dafuqjoe, Apr 11, 2013.

  1. #1
    Hey guys!

    First of all: NO JAVASCRIPT!

    I got a link. This link opens a site in a new tab. But also onclick the site should be reloaded!
    Solution to reload would be turn the link into a submit button, but then the submit button can't open a site in a new tab....

    How could I solve this? With PHP and HTML only.

    Thank you!
     
    dafuqjoe, Apr 11, 2013 IP
  2. rolodex

    rolodex Well-Known Member

    Messages:
    364
    Likes Received:
    37
    Best Answers:
    5
    Trophy Points:
    175
    #2
    Why do you say submit button can't open in new page? Just use _target=blank. For example;
    <form action="#" method="post" target="_blank">
      <input type="submit">
    </form>
    HTML:
     
    rolodex, Apr 12, 2013 IP
  3. dafuqjoe

    dafuqjoe Member

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    But then the actual site doesn't reload :(
     
    dafuqjoe, Apr 13, 2013 IP
  4. rolodex

    rolodex Well-Known Member

    Messages:
    364
    Likes Received:
    37
    Best Answers:
    5
    Trophy Points:
    175
    #4
    Fiddle with Form action. Request php to reload the page.
     
    rolodex, Apr 13, 2013 IP
  5. dafuqjoe

    dafuqjoe Member

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    I don't understand...


    This opens my link : an extern website which I can't modify.

    But how to reload the actual site? How with Request?
     
    dafuqjoe, Apr 13, 2013 IP
  6. rolodex

    rolodex Well-Known Member

    Messages:
    364
    Likes Received:
    37
    Best Answers:
    5
    Trophy Points:
    175
    #6
    May I ask why do you want to avoid javascript?

    Here's the php for reload.
        if(isset($_POST['Submit']))
        {
        header("Location: http://yourpagehere.com");
        }
    PHP:
     
    rolodex, Apr 13, 2013 IP
  7. dafuqjoe

    dafuqjoe Member

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    Because some people are still surfing with JS disabled...

    I think you missunderstood what I want to realize...

    I want a button. This button opens onclick a website in a new tab. But also it refreshes the actual site.

    I think I will just use JS, and add a

    notice.


    Well nevermind, thanks anyway :)!
     
    dafuqjoe, Apr 13, 2013 IP