Thanks for the article. Actuall this deals with passing parameters from an HTML page to PHP and we are looking for the opposite. Passing parameters from a URL link TO an HTML form. Here is the code for the form we are trying to update and it is the hidden value of LEAD ID that we want passed to the form from the URL link.
How could this be accomplished?
Here is the HTML of our form: -
<HTML>
-
-
<body>
-
<input type="hidden" value="xxxxx" name="Lead ID">
-
<input type="hidden" value="John Doe" name="Rep">
-
-
<div align="left">
-
<table border="0" cellpadding="0" cellspacing="1" width="98%" height="246">
-
<tr>
-
<td width="106%" align="center" height="30" colspan="2"><b><font face="Arial" size="3">CALL
-
REPORT</font></b></td>
-
</tr>
-
<tr>
-
<td width="29%" align="right" height="25"><font face="Arial"><b>Contact:</b></font></td>
-
<td width="77%" height="25"> <input type="text" name="Contact" size="32">
-
</td>
-
</tr>
-
<tr>
-
<td width="29%" align="right" height="25"><font face="Arial" color="#FF0000"><b>Date Contacted:</b></font></td>
-
<td width="77%" height="25"> <input type="text" name="Date_Contacted" onfocus="showCalendarControl(this);" size="20" />
-
</td>
-
</tr>
-
<tr>
-
<td width="29%" align="right" height="81"><font face="Arial"><b>Comments/
-
Interests:</b></font></td>
-
<td width="77%" height="81"> <textarea rows="3" name="Comments" cols="69"></textarea></td>
-
</tr>
-
<tr>
-
<td width="29%" align="right" height="25"><font face="Arial" color="#0000FF"><b>Next Action Date:</b></font></td>
-
<td width="77%" height="25"> <input type="text" name="Next_Action_Date" onfocus="showCalendarControl(this);" size="20" />
-
</td>
-
</tr>
-
<tr>
-
<td width="29%" align="right" height="25"><font face="Arial" color="#0000FF"><b>Next
-
Action Comment:</b></font></td>
-
<td width="77%" height="25"> <input type="text" name="Next_Action_Step" size="61">
-
</td>
-
</tr>
-
</table>
-
</div>
-
<p style="margin-top: 15; margin-bottom: 10" align="center"><input type="submit" value="Send"></p>
-
</form>
-
<p style="margin-top: 15; margin-bottom: 10" align="center"> </p>
-
</body>
-
</HTML>
-
13 9654 Atli 5,058
Expert 4TB
Hi Steve.
I moved your question into it's own thread in the PHP forum, where it is more likely to be read by our Experts.
I've also added [code] tags to your post. All code should be encapsulated in code tags.
Atli 5,058
Expert 4TB
Using PHP, you could change your hidden <input> tag to look something like the this: -
<input type="hidden" value="<?php echo $_GET['leadID']; ?>" name="Lead ID">
-
This is assuming that your URL contains the GET variable 'leadID'. So your URL string would have to look something like this: -
http://myserver.com/mypage.php?leadID=valueOfLeadID
-
I am using this also to pull a field called contact which contains the full name of a person. When it places the value in the text box, it only puts the first name and not the full name. Here is the code I am using for this: - <p><input type="hidden" value=<?php echo $_SERVER['QUERY_STRING']; ?></p>
-
Contact: <input type="text" name="Contact" value=<? echo $_GET['contact'] ?>>
Using PHP, you could change your hidden <input> tag to look something like the this: -
<input type="hidden" value="<?php echo $_GET['leadID']; ?>" name="Lead ID">
-
This is assuming that your URL contains the GET variable 'leadID'. So your URL string would have to look something like this: -
http://myserver.com/mypage.php?leadID=valueOfLeadID
-
Can you post the full URL string you used for this?
Variables1.php?contact=Mark%20Twain
Can you post the full URL string you used for this?
Try urlencode() first. if not working please post back.
Try urlencode() first. if not working please post back.
Is this the correct syntax: -
<input type="text" name="Contact" value=<? echo $_GET[urlencode('contact')] ?>>
-
Try urlencode() first. if not working please post back.
I only get the problem of truncation when the variable is passed to a text field. It does not truncate when I just display the value on the screen. What would be the difference?
Atli 5,058
Expert 4TB
How is the URL string being generated?
Are the values being passed from a HTML form?
Or are you generating the URL with some PHP code and echoing it as a link? (Or redirecting perhaps?)
If it is being generated from a HTML form, consider changing the 'method' to POST, which is a far better method for passing on detailed information, such as full names.
You can access those values just like you would the GET values by using the $_POST array.
How is the URL string being generated?
Are the values being passed from a HTML form?
Or are you generating the URL with some PHP code and echoing it as a link? (Or redirecting perhaps?)
If it is being generated from a HTML form, consider changing the 'method' to POST, which is a far better method for passing on detailed information, such as full names.
You can access those values just like you would the GET values by using the $_POST array.
The URL string is being placed as a hyperlink in an E-mail message. Once this link connects to the page, it displays information including the contact full name in a text box. For some reason, when I do this as just a display without populating a text box, all is fine.
Atli 5,058
Expert 4TB
I see.
This would be the line that is causing the problem? -
<input type="text" name="Contact" value=<? echo $_GET['contact'] ?>>
-
Try putting the value inside quote marks and see what that does. (And to follow the standards, close the tag as well). -
<input type="text" name="Contact" value="<? echo $_GET['contact']; ?>" />
-
If that doesn't work, you can try running it through the urldecode() function: -
<input type="text" name="Contact" value="<? echo urldecode($_GET['contact']); ?>" />
-
I see.
This would be the line that is causing the problem? -
<input type="text" name="Contact" value=<? echo $_GET['contact'] ?>>
-
Try putting the value inside quote marks and see what that does. (And to follow the standards, close the tag as well). -
<input type="text" name="Contact" value="<? echo $_GET['contact']; ?>" />
-
If that doesn't work, you can try running it through the urldecode() function: -
<input type="text" name="Contact" value="<? echo urldecode($_GET['contact']); ?>" />
-
That did the trick...Thanks!!
Atli 5,058
Expert 4TB
That did the trick...Thanks!!
Glad to hear it :)
Good luck with your project!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: newbie_mw |
last post by:
Hi, I need urgent help with a novice problem. I would appreciate any
advice, suggestions... Thanks a lot in advance! Here it is:
I created a sign-up sheet (reg.html) where people fill in their...
|
by: newbie_mw |
last post by:
Seems my post was buried in more cries for help :-) I will try again.
It's probably a very novice question so please take a look! Thanks!...
|
by: Venus |
last post by:
Hi all,
Newbie here!!
I have 4 forms(A,B,C,D) and a thank you page for my questionnaire.
People will be redirected to B or C depending on the last question's
answer. B or C will redirect to D...
|
by: Jack |
last post by:
I have a text file of data in a file (add2db.txt) where the entries are
already entered on separate lines in the following form:
INSERT INTO `reviews` VALUES("", "Tony's", "Lunch", "Great...
|
by: Robert |
last post by:
Hello,
Can anyone help with this?
On my online order form, I need to send a few variables to my
credit-card processor. These variables are for non-secure customer
comments, and will be sent...
|
by: PT |
last post by:
I got a problem. And thats.....
First of all, I got these three tables.
------------------- ------------------ ----------------------
tblPerson tblPersonSoftware ...
|
by: ak1dnar |
last post by:
There is a Error getting while i am entering records using this jsp file.
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ include...
|
by: idorjee |
last post by:
hello,
i'm trying to write a perl cgi script to insert some values that i get from the my html form. i could manage to get the params from the html and process them (that part is not included in...
|
by: adamace5o |
last post by:
When i try to use post variables with php and mysql i can't get the insert into statement to accept varibles as values. If i use 'test' instead of $test it does work. I suspect it is something to do...
|
by: brianrpsgt1 |
last post by:
I am attempting to insert data from a HTML form using a .psp script.
I can not find how to link the data that is inserted into the form to
the variables in the .psp script to then insert into the...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |