Jump to content

[SOLVED] php + javascript


phorcon3

Recommended Posts

i need this one function which should be written in php and javascript

 

php:

$text = $_POST['text'];

 

javascript:

var text = document.getElementById('text').value;

 

so, "text":

 

1) may contain a-zA-Z0-9 as well as a period "."

2) first letter must be alphanumeric, so ".text" would result in an error

3) there should be no consecutive periods allowed, so "text..text" would result in an error

4) last letter must be alphanumeric as well, so "text." would also result in an error

 

does anyone know how to do this with just on line of code (regex) in both, php and javascript?

 

thanks in advance

 

 

Link to comment
https://forums.phpfreaks.com/topic/176713-solved-php-javascript/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.