| | |
making sure a textbox starts with http:// ?
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Apr 2009
Posts: 119
Reputation:
Solved Threads: 0
Hi,
me again,
I have a textbox that users can enter a url of there website.
I have default value at http:// so when page loads the text box alreay displays http://
I am not sure what i do in PHP to check to make sure that the url starts with http://
can someone tell me what i use in PHP so it checks that the textbox starts with http:// ?
Thank you,
genieuk
me again,
I have a textbox that users can enter a url of there website.
I have default value at http:// so when page loads the text box alreay displays http://
I am not sure what i do in PHP to check to make sure that the url starts with http://
can someone tell me what i use in PHP so it checks that the textbox starts with http:// ?
Thank you,
genieuk
php Syntax (Toggle Plain Text)
if (!strpos(#_post['textbox'],'http://') == 0) { return false}
or javascript can check similarly in the
<form onsubmit='javascript'> before submission Last edited by almostbob; May 11th, 2009 at 5:09 pm.
Failure is not an option It's included free, you don't have to do anything to get it
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it
Please mark solved problems, solved
•
•
Join Date: Apr 2009
Posts: 257
Reputation:
Solved Threads: 37
you can check with javascript
apply string function to check if the first 7 characters are "http://"
apply string function to check if the first 7 characters are "http://"
•
•
Join Date: Apr 2009
Posts: 257
Reputation:
Solved Threads: 37
or there is an other option use http:// outside text field and let the users just enter url like www.test.com and you concatenate http:// with url
![]() |
Similar Threads
- designing an operating system (Computer Science)
- Need help urgent! Is this possible ? (Java)
- Checkbox value appended to textbox (JavaScript / DHTML / AJAX)
- irc bot help (Python)
- Image in Textbox? (HTML and CSS)
- U.S. residents worried about the Draft (Geeks' Lounge)
- need criticsm and help with fireworks page design (Site Layout and Usability)
- Syntax for deleting specified file ( in C++) (C++)
Other Threads in the PHP Forum
- Previous Thread: plzzz...help...upload & displaying image
- Next Thread: Porblem in UTF-8 support on CSV/EXCEL
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube






