bodyland Posted December 12, 2006 Share Posted December 12, 2006 Hi:I've made a php form that enters various bits of information into a mysql database. Part of the info I put into this form is included in the URL to the form. ie http://www.mysite.com/archives/bio.php?id=561&name=dick%20tracy Is there a way - and how do I do it - of using the id# from the URL and entering it into a blank in the form as as as the name - dick tracy - and capitalizing the first letters. Thanks Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 12, 2006 Share Posted December 12, 2006 I don't know about captilizing the first letters of the two words. But, you can easily snag that name by using the $_GET statement.$name = $_GET['name'];This will set that variable value for you from the 'name' segment of the URL coming to the form. Then, when they land on the form page you'd do this in that field:<input type='text' size='20' name='name' value='$name'>That will put 'dick tracy' into that spot. If you want caps for those then there may be some string code for it but I'm not aware. Might be easier to pass it with caps in the URL. Quote Link to comment Share on other sites More sharing options...
trq Posted December 12, 2006 Share Posted December 12, 2006 Yes, the value of id will be in $_GET['id'] and name in $_GET['name']. Use [url=http://php.net/ucwords]ucwords[/url] to capitalize ase required. Quote Link to comment Share on other sites More sharing options...
simcoweb Posted December 12, 2006 Share Posted December 12, 2006 Cool. I'll put ucwords in my bookmarks! Quote Link to comment Share on other sites More sharing options...
bodyland Posted December 13, 2006 Author Share Posted December 13, 2006 thanks guys - much appreciated Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.