473,698 Members | 2,220 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting data out of <FORM> in php variable

Hi all - please help...

using <FORM> HTML tag for user input and need to get get data from it and
store in php variable...

<input type="text" name="user_name " size="18" maxlength="16"
class="input_le ft" tabindex="11" />

using the following to try and get user_name, but $user_name comes back
blank...

$user_name=$HTT P_POST_VARS['user_name'];


Jul 17 '05 #1
5 1892
On Mon, 13 Jun 2005 20:40:12 GMT, "Domestos" <ne*******@mind .net> wrote:
Hi all - please help...

using <FORM> HTML tag for user input and need to get get data from it and
store in php variable...

<input type="text" name="user_name " size="18" maxlength="16"
class="input_l eft" tabindex="11" />

using the following to try and get user_name, but $user_name comes back
blank...

$user_name=$HT TP_POST_VARS['user_name'];


Don't multipost. Post a minimal runnable script that demonstrates your
problem.

--
Andy Hassall / <an**@andyh.co. uk> / <http://www.andyh.co.uk >
<http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool
Jul 17 '05 #2
Try using $_POST['whatever']

Jul 17 '05 #3
Domestos (ne*******@mind .net) decided we needed to hear...
Hi all - please help...

using <FORM> HTML tag for user input and need to get get data from it and
store in php variable...

<input type="text" name="user_name " size="18" maxlength="16"
class="input_le ft" tabindex="11" />

using the following to try and get user_name, but $user_name comes back
blank...

$user_name=$HTT P_POST_VARS['user_name'];


What is the method attribute set to in your form tag? It should be set
to 'post' and defaults to 'get' if you don't specify it.

As an aside you should really be using $_POST instead of
$HTTP_POST_VARS which is deprecated.
--
Dave <da**@REMOVEbun dook.com>
(Remove REMOVE for email address)
Jul 17 '05 #4
heres the html code...

<?php
$user_name=' ';
require_once('i ncludes.php');
do_html_header( 'register');
?>
<form action="registe r_new.php" method="post" enctype="text/plain"
name="register" >
<fieldset><lege nd>Personal Details</legend>
<p>
<label for="user_name" class="label_le ft"> Login Username :</label>
<input type="text" name="user_name " size="18" maxlength="16"
class="input_le ft" tabindex="11" />
</form>
<?php
?>
and here is the file register_new.ph p
<?php
require_once('i ncludes.php');
//create short variable names
$user_name=$_PO ST['user_name'];

echo $user_name;

?>
And it leaves a blank screen !!!!
Jul 17 '05 #5


Domestos wrote:
heres the html code...

<?php
$user_name=' ';
require_once('i ncludes.php');
do_html_header( 'register');
?>
<form action="registe r_new.php" method="post" enctype="text/plain"
name="register" >
<fieldset><lege nd>Personal Details</legend>
<p>
<label for="user_name" class="label_le ft"> Login Username :</label>
<input type="text" name="user_name " size="18" maxlength="16"
class="input_le ft" tabindex="11" />
</form>
<?php
?>
and here is the file register_new.ph p
<?php
require_once('i ncludes.php');
//create short variable names
$user_name=$_PO ST['user_name'];

echo $user_name;

?>
And it leaves a blank screen !!!!


What happens if you remove the 'enctype="text/plain"' from your <form>?

If you change your register_new.ph p to

<?php
echo '<pre>';print_r ($_POST);echo '</pre>';
?>

What displays on the screen?

Ken

Jul 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
12926
by: Ben | last post by:
Here's my form: <form name="aForm" method='post'> <input type=file name=file1 onkeypress='KeyPress()'><br> <a id='attachMoreLink' href='javascript:AddFileInput()">Attach More Files </a> <input type=submit value='Done'> </form>
4
2535
by: Howard Jess | last post by:
In Opera 8.01 (Linux; Build 1204) and in Opera 7.54 (Windows XP; Build 3865), my form disappears from the HTML markup (below). To summarize: 1) In a <script> block in the <head> I create a form element (part of object/feature/bug detection). 2) There's a <form> element defined in the <body>, with the id 'theForm'. 3) The onload function tries to access that form, and also counts the total number of forms in the document. It fails to...
10
8937
by: Phlip | last post by:
HTMListas: (Apologies for I can't Google for this - too many common words.) I have a <form> tag. It thinks I want a <p> break before and after the form. I don't. (My forms are sneaky and inline.) How do I avoid paragraph breaks around a <form> tag?
6
3870
by: snacktime | last post by:
I've searched and searched and have not found a solution to suppress the margin on form or href tags so that there is no space before or after the tag. The only way I have found to do this is to place the tags one after another without any spaces between them. For example, a space gets rendered between these two href's when displayed in firefox or IE. <a href="#"><img border="0" height="10" src="test.gif" width="10" /></a>
4
3719
by: rob c | last post by:
This is a minor thing and only appears in IE (so far), but I'd like to know to correct it (if possible). Whenever I use a form on a webpage, Explorer always leaves a blank line following the </form> tag but Mozilla doesn't. Is there a way to supress the blank line? Thanks Rob www.rcp.ca
12
4565
by: David Thielen | last post by:
Hi; I have my <form> in the master page because the master page includes the menu for all pages. But I would like to set the default button and control to place the caret in for each page. Is there a way to do this? (My understanding is this has to be done in the form tag.) -- thanks - dave david_at_windward_dot_net
19
2143
by: Coward 9 | last post by:
HI, I saw in an example hello.aspx, there is a <form tagbeing used like <form runat="server> I search all html tag references and could NOT find "runat" attributes for <formtag. which reference should I use in order to find that?
5
13853
by: shotokan99 | last post by:
for instance i do have this element but i dont have a <form>: <input type="Text" name="myname" id="myname" size="30"...> then i have this link: echo'<a href="mypage.php?name='.$myname.'...>Save</a>'; i want that $myname will the value of myname textbox. something like this: $myname= <the value of the textbox>
10
14165
by: neverquit | last post by:
hi , Iam Nagesh,Begineer in using Ajax,well i have been using ajax in application, i have faced a problem while placing the responseTEXT into the <div> tag positioned inside the <form> tag iam able to get the response in the <div> tag in mozilla (im takingthe HTML response), <script> function confirm() { xmlHttp=GetXmlHttpObject(); if (xmlHttp==null)
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7734
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3051
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2332
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.