Need to work in echo in PHP

Category: PHP Questions    |    2 views    |    Add a Comment
I have this script working and now i just need the alert to pop up when the field is in PHP.
But when i put it in echo"" the onBlur event wont work.

 function validate() {
      var valStreet = new RegExp("[pP]{1}[.]*[oO]{1}[.]*[ ]*[bB]{1}[oO]{1}[xX]{1}"); //Anything with "PO BOX" alerted

      if (form.Street.value.match(valStreet) != null) {
         alert("No P O Box Allowed in Shipping Address.");
      }   
   }
   </script>
</head>
<body><form name="test">
Street: <input type="text" name="street" value="" onBlur="validate();"><br>
<input type="button" name="test" value="test">
</form>

<?PHP echo"<input type='text' name='street' onBlur=\"validate();\" value=$street >"; ?>

//Something wrong with the onBlur Code!!!!

What is the correct way to get onBlur to work when in PHP?????

Share/Save/Bookmark

 

Php script for upload photos

Category: Web Questions    |    3 views    |    Add a Comment
Please need some help about uploading photos and determine its image size

Share/Save/Bookmark

 

Need urgent assistance with php date function and recoring it into MySQL

Category: PHP Questions    |    2 views    |    Add a Comment
Hi there.

I need assistance with, I guess, a PHP date function.

There is a way I can figure this, but its really not reliable and I guess it won’t even work. So all you guru’s, here is what I need to achieve;

I am just writing a simple reservation script in PHP. Now what I need to achieve, is this;

When someone wants to make a reservation, the interface will give the option where the user has to choose how many nights to sleep, and the check-in date, or, the check-in date and check-out date. Now this I can achieve. But here comes the, I guess, tricky part.

Lets say my check-in date is 1 Jan 2008. Check out date is 5 Jan 2008. Now when booking, the application has to reserve all the days, from the starting date, to the end date. With me? Now the other thing that I thought about, is when a user book at the end of a month until in the new month, or for example 28 Dec 2008 until 4 Jan 2009.

So I need to somehow calculate the dates inbetween, and then also it has to be recorded.

Since my English is probably not that good, I’ll try to find an example.

Please guys, assist me with this one.

Regards from South Africa.

Share/Save/Bookmark

 

here it’ the code..check it ouy.plzzz

Category: PHP Questions    |    3 views    |    Add a Comment
if($region==region){

$result = mysql_query("SELECT * FROM places");
$row = mysql_fetch_assoc($result);
 
echo "zone: ".$row[’zone’].";
}

Share/Save/Bookmark