PHP, Hidden Fields and Strings
Posted: Tue Oct 13, 2009 11:41 am
Hi there,
I'm passing values from one form to another using php. However, although the information is transferred, in some cases the text is stripped down to the first word only. I'm a bit of an amatuer and imagine it's an easy solution and would welcome some assistance.
These are the hidden fields bieng transferred. At this stage the information displays fine...
I then use the following to preview the information being submitted...
Thanks in advance!
I'm passing values from one form to another using php. However, although the information is transferred, in some cases the text is stripped down to the first word only. I'm a bit of an amatuer and imagine it's an easy solution and would welcome some assistance.
These are the hidden fields bieng transferred. At this stage the information displays fine...
Code: Select all
<?php
include("frontend_scripts/connect_course.php");
$eventNumber=$_GET['eventNumber'];
$result = mysql_query("select * from events WHERE eventNumber='$eventNumber' ");
while($r=mysql_fetch_array($result))
{
$eventName=$r['eventName'];
$eventLocation=$r['eventLocation'];
$eventDate=$r['eventDate'];
$eventCity=$r['eventCity'];
echo '<table width="500" border="0" align="center" cellpadding="5" cellspacing="0" class="underline">
<tr>
<td width="184" height="18" valign="top"><span class="bodybold">'.$r["eventName"].' </span>
<input type="hidden" value='.$r["eventName"].' name="title" />
<input type="hidden" value='.$r["eventLocation"].' name="location" />
<input type="hidden" value='.$r["eventCity"].' name="city" />
<input type="hidden" value='.$r["eventDate"].' name="cdate" />
<td width="85" valign="top"><div align="center"><span class="bodytext">'.$r["eventLocation"].'</span>
</div>
<td width="85" valign="top"><div align="center"><span class="bodytext">'.$r["eventCity"].'</span>
</div>
<td width="121" valign="top"><div align="right"><span class="bodytext"></span>
<span class="bodytext">'.$r["eventDate"].'</span>
</div>
</table>';
}
?>I then use the following to preview the information being submitted...
Code: Select all
<?php
echo '<input type="hidden" value='.$_REQUEST["title"].' name="title" />
<input type="hidden" value='.$_REQUEST["location"].' name="location" />
<input type="hidden" value='.$_REQUEST["city"].' name="city" />
<input type="hidden" value='.$_REQUEST["cdate"].' name="cdate" />
<input type="hidden" value='.$_REQUEST["name"].' name="name" />
<input type="hidden" value='.$_REQUEST["company"].' name="company" />
<input type="hidden" value='.$_REQUEST["email"].' name="email" />
<input type="hidden" value='.$_REQUEST["telephone"].' name="telephone" />
<input type="hidden" value='.$_REQUEST["address"].' name="address" />
<input type="hidden" value='.$_REQUEST["people"].' name="people" />
<input type="hidden" value='.$_REQUEST["questions"].' name="questions" />';
?>Code: Select all
<?
$courseTitle=$_REQUEST["title"];
$courseLocation=$_REQUEST['location'];
$courseCity=$_REQUEST['city'];
$courseDate=$_REQUEST['cdate'];
$name=$_REQUEST['name'];
$company=$_REQUEST['company'];
$email=$_REQUEST['email'];
$telephone=$_REQUEST['telephone'];
$address=$_REQUEST['address'];
$people=$_REQUEST['people'];
$questions=$_REQUEST['questions'];
echo "<span class='titles'>Course Title:$courseTitle<span><br>
<span class='bodybold'>Course Location:</span><span class='bodytext'>$courseLocation</span><br>
<span class='bodybold'>Course City:</span><span class='bodytext'>$courseCity</span><br>
<span class='bodybold'>Course Date:</span><span class='bodytext'>$courseDate</span><br><br>
<span class='bodybold'>Your Name:</span><span class='bodytext'>$name</span><br>
<span class='bodybold'>Company Name:</span><span class='bodytext'>$company</span><br>
<span class='bodybold'>Your Email Address:</span><span class='bodytext'>$email</span><br>
<span class='bodybold'>Your Telephone Number:</span><span class='bodytext'>$telephone</span><br>
<span class='bodybold'>Your Address:</span><span class='bodytext'>$address</span><br>
<span class='bodybold'>Number of People Attending:</span><span class='bodytext'>$people</span><br>
<span class='bodybold'>Your Questions:</span><span class='bodytext'>$questions</span>";
?>Thanks in advance!