Jump to content

CBaZ

Members
  • Posts

    128
  • Joined

  • Last visited

Posts posted by CBaZ

  1. 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 :)

  2. 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>
    
  3. 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";
    }
    }
    ?>
    
  4. 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>";
       }
    
         
        	   
               
    			  
    			   
    			   
    		   
    		   }
     
    ?>
    
  5. 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
    }
    }
    }
    ?>
    

     

     

  6. 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.
    

     

     

  7. 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]
    
    
    ?>
    

  8. I am getting the value but with too much info for the URL string.

    <form method="get" action="<?php echo $SERVER_['PHP_SELF'] ?>"> 
      <select name="brand">
         <option value="Acer">Acer</option>
    </select>
    <select name="device">
         <option value="Audio">Audio</a></option>
    </select>
    <input type="image" src="images/submit.jpg" width="95" height="89" onclick="<?php $_POST['brand']; $_POST['device']; ?>" /></div><br>
    </form>
    

     

    This will output this URL

    index.php?brand=Acer&device=Audio&x=35&y=31

     

    I need it to be in this format

    index.php?Acer&Audio .. if possible if not I would need to rewrite my other script.

  9. this so far works for index.php?brand it will let me echo out the $params in my text i just need one extra

    like this index,php?brand&device but I am not sure I can do it with the multiple parameters script i posted in here earlier or if it can be done period.

    hope that clears up why i am trying to do this it has its purpose.

    <?php
    $protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') 
                   === FALSE ? 'http' : 'https';
    $host     = $_SERVER['HTTP_HOST'];
    $script   = $_SERVER['SCRIPT_NAME'];
    $params   = $_SERVER['QUERY_STRING'];
    
    $currentUrl = $protocol . '://' . $host . $script . '?' . $params;
    ?>
    

  10. here's my code thus far I am stuck

    <?php
    $protocol = strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') 
                   === FALSE ? 'http' : 'https';
    $host     = $_SERVER['HTTP_HOST'];
    $script   = $_SERVER['SCRIPT_NAME'];
    
    
    $query  = explode('&', $_SERVER['QUERY_STRING']);
    $params = array();
    
    
    foreach( $query as $param )
    {
        list($name, $value) = explode('=', $param);
        $params[urldecode($name)][] = urldecode($value);
    }
    
    
    
    $currentUrl = $protocol . '://' . $host . $script . '?' . $query . '&' . $name . $value;
    ?>
    

  11. I have here a dilemma.  I can't seem to get my map into the slider.  I have seen it work for another website but on mine it just won't happen no matter what i do.

     

         <div style="width: 768px; height: 196px;">
    <map id="categorieshtml" class="hidden">
    <div class="categoryPanel" style="display:block; width:768px; height:196px; background:url(a shape=); position:relative; margin:2px auto 2px auto;">
         <div class="categoryRow"><a style="left:460px; top:23px; background:transparent; display:block; width:303px; height:0; padding-top:20px; overflow:hidden; position:absolute;" title="driver / firmware assistance." href="http://malent.com/cart/order.php?o=3wqcapqd"></a></div>
    <div class="categoryRow"><a style="left:460px; top:49px; background:transparent; display:block; width:303px; height:0; padding-top:20px; overflow:hidden; position:absolute;" title="anti-malware / virus assistance" href="http://malent.com/cart/order.php?o=slgekdze"></a></div>
    <div class="categoryRow"><a style="left:460px; top:76px; background:transparent; display:block; width:303px; height:0; padding-top:20px; overflow:hidden; position:absolute;" title="archive / windows password recovery" href="http://malent.com/cart/order.php?o=yr8kirep"></a></div>
    <div class="categoryRow"><a style="left:460px; top:105px; background:transparent; display:block; width:303px; height:0; padding-top:20px; overflow:hidden; position:absolute;" title="data recovery (images, documents, etc.)" href="http://malent.com/cart/order.php?o=tllfdssq"></a></div>
    <div class="categoryRow"><a style="left:460px; top:133px; background:transparent; display:block; width:303px; height:0; padding-top:20px; overflow:hidden; position:absolute;" title="hot sync service (usb connectivity problems)" href="http://malent.com/cart/order.php?o=slgekdze"></a></div>
    <div class="categoryRow"><a style="left:460px; top:163px; background:transparent; display:block; width:303px; height:0; padding-top:20px; overflow:hidden; position:absolute;" title="assistance with other issues!" href="https://www.crossloop.com/helpeechatnew.htm?helperid=8e60448bb157891e951d8f7c09bae0e5"></a></div> 
            </div>
    </map>
            <div class="theme-default">
               
                <div id="slider" class="nivoSlider" style="height: 0px; display:inline-block">
                    <a href="/search.htm?src=hp&pane=howitworks"><img src="images/seniorcpl.jpg" width="768" height="196" alt="" /></a>
    	<img overhtml="categorieshtml" src="images/onthego.jpg" alt="How it works" /></a>                
    		<a href="#" class="nivo-imageLink" style="display: block; "><img src="images/support.jpg" width="768" height="196" alt=""  /></a>
                    
                </div>
    
        </div> 

  12. I need some tips on a chat module.  I have a lounge and form with button setup but without a chat module for it it's going to be useless

    if you are willing to help me or guide me so it can be built would be great.  I have source and screenshots of how it looks.

    I am just needing to host this on another site and need a chat module written that doesn't require anyone to be logged in.  Maybe some sort of security for the lounge so that admins can securely login.. regular users only need a spam protection. I can send you the files if interested. 

     

    Thanks.

×
×
  • 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.