PHP/MySQL Not Inserting to Database

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 2334 Views - Last Post: 25 February 2013 - 09:17 AM Rate Topic: -----

#16 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,439
  • Joined: 08-June 10

Re: PHP/MySQL Not Inserting to Database

Posted 25 February 2013 - 06:23 AM

what is the URL in the browser’s address bar?
Was This Post Helpful? 1
  • +
  • -

#17 bteeple  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 01-May 11

Re: PHP/MySQL Not Inserting to Database

Posted 25 February 2013 - 06:35 AM

file:///C:/wamp/www/reg.php?firstname=Blake&lastname=Teeple&age=20


That is the URL for when I enter data into my form. I tested the php file using localhost/reg.php giving values to firstname, lastname, and age and it worked fine with entering it into the database. But when I enter data into the form and click submit, the entries in the form are not getting passed over for some reason.
Was This Post Helpful? 0
  • +
  • -

#18 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,439
  • Joined: 08-June 10

Re: PHP/MySQL Not Inserting to Database

Posted 25 February 2013 - 06:38 AM

I should have known it ...

bring up the source code after you submitted the form and you should be enlightened.

when you submit a form through the file:// protocol, you have no server and hence no PHP to execute it.
Was This Post Helpful? 1
  • +
  • -

#19 bteeple  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 30
  • Joined: 01-May 11

Re: PHP/MySQL Not Inserting to Database

Posted 25 February 2013 - 09:15 AM

That made sense, I just saved it as a php file instead of html, and now everything works.


Sorry for being a burden. But thanks for the help! I know to just save them all as php from now on. :)
Was This Post Helpful? 0
  • +
  • -

#20 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3576
  • View blog
  • Posts: 10,439
  • Joined: 08-June 10

Re: PHP/MySQL Not Inserting to Database

Posted 25 February 2013 - 09:17 AM

rule of thumb: always always always run a web application from a server, even if it does not contain a server script.
Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2