php or javascript?
Moderator: General Moderators
-
shadow_blade47
- Forum Newbie
- Posts: 12
- Joined: Fri Nov 07, 2003 3:41 am
php or javascript?
hi there, I'm looking into various ways of validating a inputted e-mail address in a form. Should I use javascript or php to check things like whether it contains an '@' smybol? I was told javascript would do it faster, is this true? thanks,
james
james
javascript will prevent the user from having to submit the page and the php script running then passing it back to the browser, because it doesnt have a valid email address, so yes it will be faster. However, you will still need to do some checking in the php script as users may have turned off javascript.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
I came to the site ready to ask a question about php to javascript and here is the thread!
How the hell do I capture the VML code that is written to the window as PHP.
PHP is all I know - and not much of that - and so for my users to save the drawings I can only manipulate PHP .
Please, can I have a tip, a direction to help me capture the generated VML code as PHP.
This is not for profit...this is for a community site
unitedartcity
Code: Select all
function maak_code()
{
var raam = window.open('','vmlcode','height=600,width=600');
raam.document.open();
with(raam.document){
write('<html>\n');
write('<head>\n<title>VML code</title>\n</head>\n');
write('<body bgcolor="buttonface">\n');
write('<center>\n<form>\n');
write('<textarea style="width: 500px; height: 500px;">\n');
write('<html>\n<head>\n\n');
write('<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>\n');
write('<style type="text/css">\nv\\:* { behavior: url(#default#VML);}\n</style>\n\n');
write('</head>\n<body>\n\n');
write(document.framesї0].document.body.innerHTML.replace(/<br>/gi, '\n'));
write('\n\n</body>\n</html>\n');
write('</textarea>\n<br>\n');
write('<input type="button" value="Select" style="font-family: Verdana, Arial; font-size: 12px; width: 150px; margin-top: 8px;" onclick="document.formsї0].elementsї0].select()">\n');
write('</form>\n</center>\n');
write('</body>\n');
write('</html>');
}
raam.document.close();
raam.focus();
}PHP is all I know - and not much of that - and so for my users to save the drawings I can only manipulate PHP .
Please, can I have a tip, a direction to help me capture the generated VML code as PHP.
This is not for profit...this is for a community site
unitedartcity
-
php_wiz_kid
- Forum Contributor
- Posts: 181
- Joined: Tue Jun 24, 2003 7:33 pm