• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

HTML button submit not activating php code

 
Greenhorn
Posts: 3
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having an issue with my html forms not submitting properly. I am new to forms and have been trying to get a login script going but it has been failing. I am using chrome mostly. Here is the super dumbed down code that hopefully demonstrates my issue. This is the website I used for my login coding: reference

The php output when the first button is pressed is:

array(0) { } submit=Submitarray(0) { } something

then is followed by the html.

From another site a commenter noted that I should look at my ini file.
The following line has always been present:

variables_order = "GPCS"

This all still does not work. The $_POST is still empty after all of the buttons are pressed.



The first button predictably reloads the page, while the others do nothing. $_POST remains empty. Does this work on anyone else's computer?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This question was cross-posted on StackOverflow.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jose Livens,

First of all, a warm welcome to CodeRanch!

Jose Livens wrote:Does this work on anyone else's computer?


I have tried the code you have provided as-is and when I click the first button (with name="submit"), the form is submitted and the page is reloaded printing something 5 times. When I click on any of the other buttons, nothing happens.

When I change the type attribute of the buttons to submit, the form is submitted every time when I click one of the buttons. To make it more distinctive, I made some small changes to the echo statements

Hope it helps!
Kind regards,
Roel

PS. Here at CodeRanch we are fine with cross-posting, however we ask you to disclose this. Otherwise some people (who want to help you) might waste their time and effort answering a question that has already been answered. And that might cause a (very) big annoyance.
 
Jose Livens
Greenhorn
Posts: 3
1
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will make sure to disclose that in the future, however it was never answered anyways. From you saying that it works on your computer I determined it must be how my system is set up. This is my answer thatI also put on my other post:

So after some searching I forgot to disclose that I was using PHPstorm. The reason why this did not occur to me is that PHPstorm is not installed on another computer that I have been using, however since I use Intellij on both computers, this bug in PHPstorm transferred regardless since Intellij will use PHPstorm pluggins. It seems that 10.1-10.3 this bug persists where POST remains empty. I am not sure if it was fixed so I moved over to Apache and have it doing the web serving instead. Everything works, or at least works better. The 2 solutions are either wait for PHPstorm to fix this bug, or better move over to Apache.
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Jose Livens wrote:This is my answer thatI also put on my other post


Thanks for coming back and sharing your solution! That might be very helpful for other ranchers having a similar issue. Have a cow!
 
I found a beautiful pie. And a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic