Page 1 of 1
How to automatically append text to a form field?
#1
Posted 04 January 2012 - 10:55 PM
I'm creating a donation form with PayPal that I'm creating for help fund a game server. I need to record the users in-game username, I have setup the field that will record the name. Now how can I automatically append some text to that SAME field that the user won't be able to remove or see?
Thanks,
Thanks,
#2
Posted 05 January 2012 - 12:27 AM
How does your form work, do you have an example?
Do you simply want to know the html? If so use the following code for a hidden form input:
Do you simply want to know the html? If so use the following code for a hidden form input:
<input type="hidden" name="username" value="Echo username and text here"/>
#3
Posted 05 January 2012 - 12:23 PM
itodd, on 05 January 2012 - 12:27 AM, said:
How does your form work, do you have an example?
Do you simply want to know the html? If so use the following code for a hidden form input:
Do you simply want to know the html? If so use the following code for a hidden form input:
<input type="hidden" name="username" value="Echo username and text here"/>
Basically it uses a single text field that it passes to PayPal for the item description, I need to description to be "GAMEUSERNAME (Donation from site)" whereby the username is entered into the field by the user, and the text in brackets is somehow also added to the end of the video before it is submitted?
#4
Posted 05 January 2012 - 12:38 PM
Do you have a live example? You could process one form with the username & donation and then send the data to the paypal form and automatically submit
#5
Posted 05 January 2012 - 12:44 PM
How about you store all the information that you need in a $_SESSION[''].
For example
$_SESSION['user']=$_POST['user'];
On all pages the <?php session();?> must be at the top.
This is the only way to move data from 1 page to another.
But give us something of a live example cause it is quite confusing.
For example
$_SESSION['user']=$_POST['user'];
On all pages the <?php session();?> must be at the top.
This is the only way to move data from 1 page to another.
But give us something of a live example cause it is quite confusing.
This post has been edited by kensha: 05 January 2012 - 12:45 PM
#6
Posted 05 January 2012 - 12:53 PM
kensha, on 05 January 2012 - 12:44 PM, said:
This is the only way to move data from 1 page to another.
No it's not, $_POST["var"] (or $_GET["var"] although less preferred) can be used without worrying about sessions. Then send to a page which processes the data and automatically submits the second form possibly using something like:
<script LANGUAGE="JavaScript"><!--
setTimeout('document.paypal.submit()',1);
//--></SCRIPT>
Share this topic:
Page 1 of 1
Help


















