Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1109377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:13:26+00:00 2026-05-17T02:13:26+00:00

I am using PHP to generate 10 forms on a page which attach an

  • 0

I am using PHP to generate 10 forms on a page which attach an image as the button and POST hidden values to a _blank target. This works ok in Firefox, all 10 buttons submit and post to a new window. In Safari however only the first button i click will work (whichever one I choose) after that none of the buttons (forms) submit and POST to a new window (!!! whats going on??)

Heres the code –

$id=getId();
echo "<form name=\"clickthrough$id\" action=\"click_through.php\" method=\"POST\" target=\"_blank\"><input type=\"image\" src=\"images/buttons/buynow_a.gif\" name=\"buynow\"/><input type=\"hidden\" name=\"id\" value=\"".$id."\"/></form>";

Nothing strange here – the id is actually the id of a song in my database which i have simplified for showing here – but I included it on the end of the form name just incase this was causing the problem.

So to recap I end up with 10 buy now buttons on a page – all of which should post through to a PHP script. The scripts work fine. However in safari once i have pressed any buy now button all of the others stop working (until I refresh the page)

why is this?

— here is the final html that is generated for the buttons

<form name="clickthrough1728" action="click_through.php" method="POST" target="_blank"><input type="image" src="images/buttons/buynow_a.gif" name="buynow"/><input type="hidden" name="id" value="1728"/><input type="hidden" name="location" value="UK"/></form>

<form name="clickthrough1724" action="click_through.php" method="POST" target="_blank"><input type="image" src="images/buttons/buynow_a.gif" name="buynow"/><input type="hidden" name="id" value="1724"/><input type="hidden" name="location" value="UK"/></form>

<form name="clickthrough1718" action="click_through.php" method="POST" target="_blank"><input type="image" src="images/buttons/buynow_a.gif" name="buynow"/><input type="hidden" name="id" value="1718"/><input type="hidden" name="location" value="UK"/></form>

….

I have just tried copying this to a new html file and testing and the same thing happens – the first click will open a new window but no buttons after that will post the form

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:13:26+00:00Added an answer on May 17, 2026 at 2:13 am

    A Quick check with the following code works just fine
    (Safari 5 on Mac)

    for($id = 1; $id < 11; $id++) {
       echo "<form name=\"clickthrough$id\" action=\"sandbox/_TestServer.php\" method=\"POST\" target=\"_blank\">
       <input type=\"image\" src=\"images/buttons/buynow_a.gif\" name=\"buynow\"/>
       <input type=\"hidden\" name=\"id\" value=\"".$id."\"/>
       </form>";
    }
    

    so it could be your $id. Generate the html and show it like Pekka suggested

    Edit
    I can’t tell you what goes wrong in safari-windows-land
    but i’ve changed the code as follows an tested it on a VM (Win XP, Safari5) and it works:

    for($id = 1; $id < 11; $id++) {
       echo "<form name=\"clickthrough$id\" action=\"_TestServer.php?$id\" method=\"post\" target=\"_blank\">
       <input type=\"image\" src=\"add.png\" name=\"buynow\"/>
       <input type=\"hidden\" name=\"id\" value=\"".$id."\"/>
       </form>";
    }
    

    every form got its “unique” action target ?$id and this seams to do the trick

    Edit Link and Files removed

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PHP to generate feeds, which is working perfectly fine on my local
I am using the following code to generate excel from sql through php.this is
I've got this php page where I do a search which returns data from
I am using PHP to generate my page and CSS within the generated page
I'm using php to generate an html page that displays blog/thread items, and I
This piece of valid json (it has been generated using php's json_encode): {html:form is
I'm using a PHP script to generate an excel CSV file from a result-set
I actually want to generate random password using PHP uniqid() function $randomPassword = uniqid();
I am using CherryPy to generate and parse data for a php webpage, but
Im using http://www.ashberg.de/php-barcode/ scripts to generate a barcode. I now need to import the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.