6 Replies - 276 Views - Last Post: 07 February 2012 - 07:20 AM Rate Topic: -----

Topic Sponsor:

#1 dbreezio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 16-November 10

html 'post' functions to php in dreamweaver

Posted 07 February 2012 - 05:58 AM

ive got a html file that uses a post function to a php file in dreamweaver. can anyone help in telling me how to send Post variables from the html file to the php file in dreamweaver.
					function get() {
						$.post('data.php', { name: form.name.value },
							function(output) {
								$('#age').html(output).show();
							});
						
					} 



how can i tell the webserver to connect to the data.php file from my html file in dreamweaver
thankyou

Is This A Good Question/Topic? 0
  • +

Replies To: html 'post' functions to php in dreamweaver

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2147
  • View blog
  • Posts: 5,430
  • Joined: 08-June 10

Re: html 'post' functions to php in dreamweaver

Posted 07 February 2012 - 06:02 AM

if you have set up your project correctly in Dreamweaver, there shouldn't be a problem. besides that, do you really need Dreamweaver to test it?
Was This Post Helpful? 0
  • +
  • -

#3 dbreezio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 16-November 10

Re: html 'post' functions to php in dreamweaver

Posted 07 February 2012 - 06:19 AM

i have two files one html and one php.
the html file is used for the testing and it does not pass to the php file that i have created. all of my coding has been created in dreamweaver and this is just a fraction of it

thank you
Was This Post Helpful? 0
  • +
  • -

#4 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2147
  • View blog
  • Posts: 5,430
  • Joined: 08-June 10

Re: html 'post' functions to php in dreamweaver

Posted 07 February 2012 - 06:22 AM

hm, do you have a web server set up?
Was This Post Helpful? 0
  • +
  • -

#5 dbreezio  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 16-November 10

Re: html 'post' functions to php in dreamweaver

Posted 07 February 2012 - 06:26 AM

im just using the live view and preview in firefox methods as the moment.
the html tags are being displayed on the webpage but Post method is not passing through to the php file.
i have used the same code in a ConText editor to check the code and it works fine, but just not in dreamweaver.
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 2147
  • View blog
  • Posts: 5,430
  • Joined: 08-June 10

Re: html 'post' functions to php in dreamweaver

Posted 07 February 2012 - 06:31 AM

usually, if I have to test HTML-PHP interactions I fire up a browser and test it on my local server (which also includes XDebug and a DBG client). there might be issues in Dreamweaver a browser has not and vice versa. and I am way more comfortable with Firefox' or Chrome's dev tools to check what's up on the HTML side than any IDE I've used.

Quote

Post method is not passing through to the php file.

PHP needs a webserver to run web applications properly

This post has been edited by Dormilich: 07 February 2012 - 06:32 AM

Was This Post Helpful? 0
  • +
  • -

#7 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 1942
  • View blog
  • Posts: 7,296
  • Joined: 08-August 08

Re: html 'post' functions to php in dreamweaver

Posted 07 February 2012 - 07:20 AM

This is the classic beginner error of thinking that PHP and HTML are processed on the same machine.

Here's the basic order of operations:
  • User takes an action.
  • Browser sends a request to server.
  • Server runs PHP script(s).
  • PHP outputs data (including HTML) to browser.
  • Browser renders the data.
  • See step 1.

Without step 3 or some emulator your PHP isn't going to work.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1