Jump to content

[SOLVED] action and submit


squiblo

Recommended Posts

my aim is to open a new window and put some information in the new windows url by using "method='GET'" but when i click the submit button i do not want the original page to redirect to any other page, how can this be done? i have tried doing these different things but none work...

 

this problem with this code is that the original page redirects and the new window does not have the information (pageid) in the url....

<?php if ($img1) 
      echo "<td width='33.3%' align='center'>
      <FORM action='images.php' method='GET'><input type='hidden' name='pageid' value='$pageid'>
<INPUT type='submit' name='images' value='Images' onClick=\"window.open('http://www.squiblo.com/images.php','mywindow','width=600,height=400,left=0px,top=0px,status=no,location=no,resizable=no,scrollbars=no')\">
        </FORM>
      </td>"; ?>

 

when i click submit with this code (with the action as current page) the original page stay the same but the new windows url does not hold the pageid

<?php if ($img1) 
      echo "<td width='33.3%' align='center'>
      <FORM action='' method='GET'><input type='hidden' name='pageid' value='$pageid'>
<INPUT type='submit' name='images' value='Images' onClick=\"window.open('http://www.squiblo.com/images.php','mywindow','width=600,height=400,left=0px,top=0px,status=no,location=no,resizable=no,scrollbars=no')\">
        </FORM>
      </td>"; ?>

Link to comment
https://forums.phpfreaks.com/topic/175283-solved-action-and-submit/
Share on other sites

sorry, ive just figured it out, im tired.

 

<?php if ($img1) 
      echo "<td width='33.3%' align='center'>
      <FORM action='' method='GET'><input type='hidden' name='pageid' value='$pageid'>
<INPUT type='submit' name='images' value='Images' onClick=\"window.open('http://www.squiblo.com/images.php?pageid=$pageid','mywindow','width=600,height=400,left=0px,top=0px,status=no,location=no,resizable=no,scrollbars=no')\">
        </FORM>
      </td>"; ?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.