Jump to content

[SOLVED] get php variable fom html


cleary1981

Recommended Posts

I need to set a php variable to the same value as this line of php so I can pass it to the next page. How do I go about it?

 

<input type = "text" value = "" disabled name = "proj_id_edit" id = "proj_id_edit" onChange="setProject"></td>

 

$p_id = proj_id_edit.value

Link to comment
https://forums.phpfreaks.com/topic/117125-solved-get-php-variable-fom-html/
Share on other sites

using GET or POST

 

GET:

you can pass it in the url or through a form

url: <a href="page.php?argument=value"> ..

form: <form action="page.php" method="get"><input type="hidden" name="argument" value="value" />

 

POST:

only through a form

<form method="post"><input type="hidden" name="argument" value="value" />

 

type="hidden" does not necessarily be hidden, it also can be text, password, ..

 

download a html reference XHTML 1.0 by preference

i have tried it using url but whats wrong with my code

 

<table width=100% border=0>
<tr>
<td><label for="proj_id_edit">Project ID</label>
<input type = "text" value = "" disabled name = "proj_id_edit" id = "proj_id_edit" onChange="setProject"></td>
<td><label for="projName_edit">Project Name</label>
<input type = "text" value = "" disabled name = "projName_edit" id = "projName_edit"></td></tr>
<tr><td><label for="comp_edit">Company Name</label>
<input type = "text" value = "" disabled name = "comp_edit" id = "comp_edit"></td>
<td><label for="access_edit">Access</label>
<input type = "text" value = "" name = "access_edit" id = "access_edit"></td></tr>
<tr><td><label for="cable_edit">Cable Entry</label>
<input type = "text" value = "" name = "cable_edit" id = "cable_edit"></td>
<td><label for="ip_edit">IP Rating</label>
<input type = "text" value = "" name = "ip_edit" id = "ip_edit"></td></tr>
<tr><td><label for="fault_edit">Fault Rating</label>
<input type = "text" value = "" name = "fault_edit" id = "fault_edit"><span>KW/sec</span></td>
<td><label for="iform_edit">Form</label>
<input type = "text" value = "" name = "iform_edit" id = "iform_edit"></td></tr>
<tr><td><label for="pman_edit">Project Manager</label>
<input type = "text" value = "" name = "pman_edit" id = "pman_edit"></td>
<td><label for="deadline_edit">Tender Deadline</label>
<input type = "text" value = "" name = "deadline_edit" id = "deadline_edit"></td>
</tr>
<tr><td><input type="button" value="Update" name="update" onClick="updateProjectDetails()">
<div id="xx"></div></td></tr></table>
</fieldset>
<fieldset>
<legend>4. Proceed to Design Mode</legend>
<input type="button" value="Design Mode" onClick = "window.open('designmode.php?p_id = {document.getElementById("proj_id_edit").value}', '', 'width=1280, height=700, resizable=yes, statusbar=yes')">
</fieldset>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.