Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo image buttons or two submits
    primarykey
    data
    text
    <p>I'm a .NET developer almost giving up on a personal project using PHP.</p> <p>I want the following PHP page:</p> <p>A form with two random images (identified by a code), where the user chooses between them, then the form refreshes, taking care of the choice. Simple.</p> <p>I've already done the random image part (stored URL's in a table. I plan on changing that in the future, but that's not an issue for now), so I've got to make the "choosing" part. I'd like to either make both the images clickable, or put two buttons below them with the same text.</p> <p>In PHP I can't figure this 'submit' way to work, mostly because I'm too used to ASP.NET.</p> <p>I've tried using two normal submit buttons, but I don't want them both to have different texts, but the very same property used to distinguish both buttons is also used to write the text of the button: value. Not to mention that this whole PHP_SELF along with checking the value at the beginning of the page load seems too hacky.</p> <p>Then I've thought about making two forms, each with an action that sends the code via querystring, but I don't want that. I don't want the (regular) user to be able to do the action just by typing in the URL.</p> <p><strong>Remember:</strong> since I lose the variable values when the page is refreshed, I have to send the selected image's code along (not via querystring).</p> <p>This kind of conflict is what is making me consider giving up this project. When I've learned ASP.NET by myself this was so easy, intuitive, and I've figured it out quickly. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload