Jump to content

CBaZ

Members
  • Posts

    128
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

CBaZ's Achievements

Member

Member (2/5)

0

Reputation

  1. wanted to thank you for telling me to go back to the original conflict issue somehow i've managed to solve it on the 2nd time around thank you so much!!!
  2. ok give me a bit I will reconfigure it and show you the code + error messages I receive with the JQUERY conflict.
  3. I would love to have it go from the first form however I have a jquery conflict which I've tried to solve but with no success. The action javascript:; goes to a jquery javascript which produces results when pressing submit on the 2nd form from the variable collected. But it makes no sense to have to click search submit on first page then push submit once again on the 2nd page to see the results as its currently doing. Anyway to have it do this without having to click would be best
  4. I have a form that gets its variable via local storage from another page when submitted (page1). I am retrieving the variable on (page2) just fine however I am presented with a submit button and I would like the visitor not to once again have to click on submit to retrieve results. Below is the page2 hidden form to post the request to the rest of the JQuery javascript. I have this search written in jquery and it conflicted with the website i am building therefore I am doing this as a work around. Any ideas if this is at all possible to do? Thanks in advance!!! Let me know if any additional code is needed to be able to figure this one out. <script type="text/javascript"> <!-- HIDE FROM INCOMPATIBLE BROWSERS if (window != top) top.location.href=location.href var res = localStorage.getItem('storageName'); document.write(res); document.write(' <form id="searchForm" name="form1" action="javascript:;" method="post" enctype="multipart/form-data">'); document.write('<input type="hidden" id="s" class="all_in_one_search" name="filelook" value="'+res+'"/>'); document.write('<input type="submit" value="Submit" id="submitButton" />'); document.write('</form>'); $(function() { $("#searchForm").submit(); }); </script>
  5. I made it a bit more simple. But one of the things I am dealing with now is that it also echo's out the directory I just want it to echo out the filename. <?php if (isset($_POST['filelook'])) { $filez = $_POST['filelook']; $filename = "/WinFiles/files/$filez"; if (file_exists($filename)) { echo '<a href="download.php?f='.$filename.'">'.$filename.'</a> <br/>'; } else { echo "The file $filename does not exist"; } } ?>
  6. Currently I am using a script that displays the entire directory. However I am trying to use preg_match to try and figure out how to just link to one file from the directory via a search string from a form. I am probably not even close so please bare with me <?php if (isset($_POST['filelook'])) { $filez = $_POST['filelook']; } /* edit $path to the directory you want to use edit $file_types to change the file types to show */ function file_type($file) { $searchString = $filez; $path_chunks = explode("/", $file); $thefile = $path_chunks[count($path_chunks) - 1]; $dotpos = strrpos($thefile, "."); return strtolower(substr($thefile, $dotpos + 1)); } $file_count = 0; $path = "./WinFiles/files"; $file_types = array('png', 'jpg'); $p = opendir($path); while (false !== ($filelook = readdir($p))) { $files[] = $filelook; } sort($files); echo "<b> Your file results:</b><br> "; if (file_exists($filez) && is_readable($filez) && preg_match($filez)) { echo '<a href="download.php?f='.$filez.'">'.$filez.'</a> <br/>'; //find filename like name searched for... if($file_count == 0) { echo "<b>No file match your file types</b>"; } } ?>
  7. It validates fine just doesn't send email and no errors. Totally stomped. <?php //simple captcha if(isset($_POST['answer']) && $_POST['answer']!='14') { echo "<script>alert('You provided a wrong answer for the Security Question')</script>"; echo "<a href='contact.php'>Please return to the Form and try again.</a><br /><br />\n"; //simple captcha $field_name = $_POST['name']; $field_email = $_POST['email']; $field_phone = $_POST['phone']; $field_preferred = $_POST['preferred']; $field_datepicker = $_POST['datepicker']; $field_passengers = $_POST['passengers']; $field_pickup = $_POST['pickup']; $field_drop = $_POST['drop']; $field_message = $_POST['message']; if(!ereg("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $field_email)) { echo "That is not a valid <b>email</b> address. Please return to the" . " <a href='contact.php'>previous page and try again.</a>"; exit; } if(empty($_POST['name']) || strlen(trim($_POST['name'])) ==0) { echo "Your <b>name</b> was not entered into the field. Please return to the" . " <a href='contact.php'>previous page and try again.</a>"; } else if(empty($_POST['email']) || strlen(trim($_POST['email'])) ==0) { echo "Your <b>email</b> was not entered into the field. Please return to the" . " <a href='contact.php'>previous page and try again.</a>"; } else if(empty($_POST['message']) || strlen(trim($_POST['message'])) ==0) { echo "You <b>message</b> was not entered into the field. Please return to the" . " <a href='contact.php'>previous page and try again.</a>"; } else if(empty($_POST['pickup']) || strlen(trim($_POST['pickup'])) ==0) { echo "Your <b>pickup</b> location was not entered into the field. Please return to the" . " <a href='contact.php'>previous page and try again.</a>"; } else if(empty($_POST['drop']) || strlen(trim($_POST['drop'])) ==0) { echo "Your <b>drop off</b> location was not entered into the field. Please return to the" . " <a href='contact.php'>previous page and try again.</a>"; } else { $mail_to = 'test@test.com'; $subject = 'New Message from '.$field_name; $body_message = 'From: '.$field_name."\n"; $body_message .= 'E-mail: '.$field_email."\n"; $body_message .= 'Phone: '.$field_phone."\n"; $body_message .= 'Preferred Method: '.$field_preferred."\n"; $body_message .= 'Appointment Date: '.$field_datepicker."\n"; $body_message .= 'Number of Passengers: '.$field_passengers."\n"; $body_message .= 'Pick Up Location: '.$field_pickup."\n"; $body_message .= 'Drop Off Location: '.$field_drop."\n"; $body_message .= 'Message: '.$field_message."\n"; $headers = 'From: '.$field_email."\r\n"; $headers .= 'Reply-To: '.$field_email."\r\n"; $mail_status = mail($mail_to, $subject, $body_message, $headers); if ($mail_status) { ?> <script language="javascript" type="text/javascript"> alert('Thank you for the message. We will contact you shortly.'); window.location = 'index.htm'; </script> <?php } else { ?> <script language="javascript" type="text/javascript"> alert('Message failed. Please, send an email to techsuppor'); window.location = 'index.htm'; </script> <?php } } } ?>
  8. totally confused now lol.
  9. ok the real thing i am missing is what to do if its actually set to the correct answer I am not doing. Am I seeing this correctly now?
  10. ok what am I missing here?
  11. I have this simple script I started but for some reason it doesn't continue even if the right answer is given. Also how would I go about adding multiple questions? <?php //simple captcha if(isset($_POST['answer']) && $_POST['answer']!='') { echo "<script>alert('You provided a wrong answer for the Security Question')</script>"; echo "<a href='cabbie.php'>Please return to the Form and try again.</a><br /><br />\n"; exit; } else if(isset($_POST['answer']) && $_POST['answer']!='blue') { //This is the problem script above of course my code continues here.
  12. hmm must be a server issue then i get 24:60 strange.
  13. <?php for($hour=0; $hour<=23; $hour++){ for($mins=0; $mins<60; $mins=$mins+15){ echo "{$hour}:{$mins}"; } } echo "<option value={$hour}:{$mins};>{$hour}:{$mins}</option>"; ?> produces the result of 24:60
  14. I need it to display like the followiong <option value="00:15">15mins</option> <option value="00:30">30mins</option> <option value="00:45">45mins</option> <option value="01:00">1Hr</option> <option value="01:15">1:15Hr</option> <option value="01:30">1:30Hr</option> and so on. Here is the code I've tried thus far not producing any of the right results. <?php $options = array(); $min15=array('00','15'); foreach (range(0,23) as $fullhour) { $parthour = $fullhour > 12 ? $fullhour - 12 : $fullhour; foreach($min30 as $int){ if($fullhour > 11){ $options[$fullhour.".".$int]=$parthour.":".$int." PM"; }else{ if($fullhour == 0){$parthour='12';} $options[$fullhour.".".$int]=$parthour.":".$int." AM" ; } } } echo '<option value="'.$options.'">'.$options.'</option>';[/background] ?>
×
×
  • 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.