4 Replies - 2862 Views - Last Post: 19 March 2012 - 05:45 AM Rate Topic: -----

#1 sandaruwanc  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 31-August 11

How can i get a Value from a TextBox to a php

Posted 18 March 2012 - 11:15 AM

<input type="text" class="w8em format-d-m-y highlight-days-67 range-low-today" name="start" id="sd" value="" maxlength="10" readonly="readonly" /></td>
<?php $dd1 = #### ;
     $date2 = date('Y-m-d',strtotime($dd1)); ?> 



I need to get textbox value to that #### and assign it to $dd1 in my php, these things are in the Same page... please Help me to do this

Is This A Good Question/Topic? 0
  • +

Replies To: How can i get a Value from a TextBox to a php

#2 CTphpnwb  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 3077
  • Posts: 10,789
  • Joined: 08-August 08

Re: How can i get a Value from a TextBox to a php

Posted 18 March 2012 - 11:19 AM

No, they're not in the same page. This is why embedding HTML and PHP is just plain wrong. It creates the absolutely false impression that they're on the same page.

  • User takes an action.
  • Browser sends a request to server.
  • Server runs PHP script.
  • Output (HTML, CSS, Javascript, etc.) is sent to browser.
  • Browser renders output.
  • Go to step 1.


Embedding languages does not change this order of operations.
Was This Post Helpful? 0
  • +
  • -

#3 tpowell  Icon User is offline

  • New D.I.C Head

Reputation: -11
  • View blog
  • Posts: 21
  • Joined: 05-March 12

Re: How can i get a Value from a TextBox to a php

Posted 18 March 2012 - 12:11 PM

if you want to insert the time into an <input> field, do something like <input type="text" value="<?php echo strftime(H:M:S); ?>" />. Also, If you want to use html and php on the same page, you can use the if(isset($variable)) to determine if the form is filled out, and then if it is filled out, submit it. If its not filled out, use else() to show the form. Good luck!
Was This Post Helpful? 0
  • +
  • -

#4 sandaruwanc  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 71
  • Joined: 31-August 11

Re: How can i get a Value from a TextBox to a php

Posted 18 March 2012 - 08:53 PM

View PostCTphpnwb, on 18 March 2012 - 11:49 PM, said:

No, they're not in the same page. This is why embedding HTML and PHP is just plain wrong. It creates the absolutely false impression that they're on the same page.

  • User takes an action.
  • Browser sends a request to server.
  • Server runs PHP script.
  • Output (HTML, CSS, Javascript, etc.) is sent to browser.
  • Browser renders output.
  • Go to step 1.


Embedding languages does not change this order of operations.


How ever MY SQL supports YYYY-mm-dd But my Date picker output, DD/MM/YYYY

I want to change the type when i Submitting it to next PHP... How can I do this??
Was This Post Helpful? 0
  • +
  • -

#5 rpgmaker  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 224
  • Joined: 02-October 11

Re: How can i get a Value from a TextBox to a php

Posted 19 March 2012 - 05:45 AM

You will need to make a html form make it post to it self then do a if iset then make the post into a virable after escaping it etc ( to make sure its safe )
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1