Jump to content

[SOLVED] why wont my form pass a space?


wmguk

Recommended Posts

<?php
echo "<td width='30'><form name='editdetails' action='editpage/";
echo "$editpage" ;
echo "' method='POST'><input type='hidden' name='login' value=" . $row['login'] . "><input type='submit' class='main' name='Submit' value='Edit' /></form></td>"; ?> 

 

then in the top of the page pulling the info out

 

<?php
$login = $_POST['login'] ;
?>

try this ;)

 

<?php
echo "<td width='30'><form name='editdetails' action='editpage/";
echo "$editpage" ;
echo "' method='POST'><input type='hidden' name='login' value='" . $row['login'] . "'><input type='submit' class='main' name='Submit' value='Edit' /></form></td>"; ?> 

 

 

you need the quote the value

it works like this (from IE)

 

example 1

<input type='hidden' name='login' value=hello>

Works

example 2

<input type='hidden' value=hello name='login'>

Works

example 3

<input type='hidden' value=hello world name='login'>

technically it still works.. if you look back at example 2 it sends "hello" not "hello name="

so to tell the form its sending the correct data you enclose it in quotes.. like this

 

<input type='hidden' value='hello world' name='login'>

 

 

as a side note i don't think the examples above will work in firefox but will in IE

 

also all of these were  untested..

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.