Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Posts posted by phpretard

  1. Only the last row will update when I submit.

     

    I have this form (and one nerve left):

     

    <form action="" method="post" >
    
    echo"
    <input style=\"text-align:center\" type=\"text\" name=\"linkorder\" value=\"".$row['order']."\" />
    <input type=\"hidden\" name=\"id\" value=\"".$row['id']."\"/>
    ";
    <input type="submit" name="updateorder" value="Save Order" />
    </form>
    

     

    On Submit:

    
    if (isset($_POST['updateorder'])){
    
    connect();
    $changeorder = mysql_unbuffered_query("update links set `order` = '".$_POST['linkorder']."' where id = '".$_POST['id']."'") or die(mysql_error());
    
    }
    
    

     

    I was going put my fist through the monitor but then I remembered I could get help here.

     

    Thank you!

     

     

  2. When a person visits my site I would like for the form on the page to submit and reload with the predetermined search criteria.  Is this possible?

     

    So for example...if you visited my site as soon as you entered the from would submit and display Google search results for "php freaks"

     

    I tried header("location: mysite.com?q=php+freaks"); but that is a continuous loop.

     

     

     

    -Any thoughts

     

  3. I am trying to block a specific site from referring traffic.  The only way I know of is $_SERVER['HTTP_REFERER']...

     

    I could say if $_SERVER['HTTP_REFERER'] is empty but that would block direct traffic

     

    Any other ideas?

     

     

  4. How is it that a site can forward to my site without a trace?

     

    www.2mysite.com is forwarding traffic to www.mysite.com but

     

    $page_name = $_SERVER['HTTP_REFERER'];

    echo $page_name;

     

    does not show www.2mysite.com as the referring site...how does one hide this?

     

    Help?

  5. You mean this?

     

    
    <?php
    function BBCodechat($BB)
       {
         $str = trim($BB);
         $str = htmlspecialchars($BB);
         $str = preg_replace('#(.*)\@(.*)\.(.*)#','<a href="mailto:\\1@\\2.\\3">Send email</a>',$BB);
         $str = preg_replace('=([^\s]*)(www.)([^\s]*)=','<a href="http://\\2\\3" target=\'_new\'>\\2\\3</a>',$BB);
         return $BB;
       }
    ?>
    
    

  6. This one in particular looked fitting to me.

     

    <?php
    function change_string($str)
       {
         $str = trim($str);
         $str = htmlspecialchars($str);
         $str = preg_replace('#(.*)\@(.*)\.(.*)#','<a href="mailto:\\1@\\2.\\3">Send email</a>',$str);
         $str = preg_replace('=([^\s]*)(www.)([^\s]*)=','<a href="http://\\2\\3" target=\'_new\'>\\2\\3</a>',$str);
         return $str;
       }
    ?>
    

  7. That site looks fine to me. There's really no telling why they're seeing something different. Is it only that site, or do they get the same result with any site they try to access?

     

    As far as I know it's only that one. 

     

    I just spoke to someone else on the same network as the original person seeing it and they see the same. 

     

    Could their network server have a problem?

  8. The actual site I am referring to isn't the one I listed above

     

    Then how do you know the actual site has a problem or how would anyone here be able to tell you anything specific about anything you are trying to find out about.

     

    I just googled "::Silic Group :: hacked by YoCo Smart From:China"  that is how I found it.

  9. I'm guessing if you clear your cache, you'll be able to see it.

     

    I don't see it through megaproxy or any other PC either...just one person (that I know of)

     

    The actual site I am referring to isn't the one I listed above.  It is just an example of a site that's got it bad...

  10. Has anyone ever heard of this?

     

    hacked by YoCo Smart From:China

     

    www[.]camptheworld[.]com <-- this site got it.

     

    My customer can see it but I can't.  I don't know if it's a local virus or a server virus...

     

    I don't know what it is

  11. I am working on an "online employment application".  Consequently it has about 83 fields.  Rather than $name=$_POST['name']; 83 times ... is there a way to get everything that is posted as an array and store it in a database accordingly?

     

    ("insert into apps ONE ARRAY") as opposed to:

     

     

    
    if (isset($_POST['application'])){ // put all into an array
    
            $_POST['FnameTxt'];
            $_POST['LnameTxt'];
            $_POST['AddressTxt'];
            $_POST['CityTxt'];
            $_POST['StateTxt'];
            $_POST['ZipTxt'];
            $_POST['CountryLst'];
            $_POST['EmailTxt'];
            $_POST['PhoneNum'];
            $_POST['FaxNum'];
            $_POST['desiredPosition'];
            $_POST['otherPosition'];
            $_POST['StartofWork'];
            $_POST['Employer'];
            $_POST['employerAddressTxt'];
            $_POST['From'];
            $_POST['To'];
            $_POST['Supervisor'];
            $_POST['Salary'];
            $_POST['Work'];
            $_POST['Reason'];
            $_POST['Employer2'];
            $_POST['employerAddressTxt2'];
            $_POST['From2'];
            $_POST['To2'];
            $_POST['Supervisor2'];
            $_POST['Salary2'];
            $_POST['Work2'];
            $_POST['Reason2'];
            $_POST['Employer3'];
            $_POST['employerAddressTxt3'];
            $_POST['From3'];
            $_POST['To3'];
            $_POST['Supervisor3'];
            $_POST['Salary3'];
            $_POST['Work3'];
            $_POST['Reason3'];
            $_POST['HSName'];
            $_POST['HSLocation'];
            $_POST['HSMajor'];
            $_POST['HSDiploma'];
            $_POST['HSYear'];
            $_POST['UnivName'];
            $_POST['UnivLocation'];
            $_POST['UnivMajor'];
            $_POST['UnivDiploma'];
            $_POST['UnivYear'];
            $_POST['UnivName1'];
            $_POST['UnivLocation1'];
            $_POST['UnivMajor1'];
            $_POST['UnivDiploma1'];
            $_POST['UnivYear1'];
            $_POST['TradeName'];
            $_POST['TradeLocation'];
            $_POST['TradeMajor'];
            $_POST['TradeDiploma'];
            $_POST['TradeYear'];
            $_POST['Q1'];
            $_POST['Q2'];
            $_POST['Q3'];
            $_POST['Q4'];
            $_POST['Q5'];
            $_POST['Q6'];
            $_POST['Q7'];
            $_POST['Q8'];
            $_POST['Q9'];
            $_POST['Q10'];
            $_POST['Q11'];
            $_POST['refName'];
            $_POST['occupation'];
            $_POST['refAddressTxt'];
            $_POST['refPhone'];
            $_POST['Relationship'];
            $_POST['Known'];
            $_POST['refName1'];
            $_POST['occupation1'];
            $_POST['refAddressTxt1'];
            $_POST['refPhone1'];
            $_POST['Relationship1'];
            $_POST['Known1'];
            $_POST['gender'];
            $_POST['ethnic'];
            $_POST['howrefered'];
    
    } // seems like a lot of redundant typing
    
    

     

    Any suggestions would be greatly appreciated.

     

    -Ant

  12. This work for adding 18 years but not subtracting...

     

    function select_yr(){ // WORKS
    $stopy = (int)date('Y') + 18;
    for($y = date('Y'); $y < $stopy; $y++){
      echo '<option value="'.$y.'">'.$y.'</option>';
    
    }
    }
    
    
    function select_yr(){ // DOES NOT WORK
    $stopy = (int)date('Y') - 18;
    for($y = date('Y'); $y < $stopy; $y++){
      echo '<option value="'.$y.'">'.$y.'</option>';
    
    }
    }
    

     

    Any help?

     

    Thank you

  13. Would this work?

     

    $month = date("m");

    $day = date("d");

    $year = date("Y") - 18;

     

    $date = $year.'-'.$month.'-'.$day;

     

     

    Thank you!!!

     

    function age_limit(){

    $month = date("m");

    $day = date("d");

    $year = date("Y") - 18;

     

    $date = $year.'-'.$month.'-'.$day;

     

    return $date;

    }

     

     

  14. I have the date stored in a database as: $date = 2010-05-25 07:43:35

     

    I had a function but I can't find it now.

     

    <? readDate($date); ?>

     

    It returned this: 05-25-2010 07:43:35

     

    Does anyone have something like this?

     

    -Ant

  15. I am trying to force a download.  It seams to only work with images.  When I try with a pdf the file type is always reads  "application/octet-stream" and is not recognized ... Here is my code.

     

    <?php 
    
    $path = $_GET['path'];
    $file = "../$path"; // path to file
    $ext = $_GET['ext'];  //file extension
    
    
    if ($ext =="jpg" || $ext =="jpeg"|| $ext =="gif"|| $ext =="png"|| $ext =="psd"|| $ext =="ai"|| $ext =="tif" || $ext =="bmp" || $ext =="zip"|| $ext =="rar"|| $ext =="gzip"|| $ext =="pdf"){
    $appType = header('Content-Type: image/$ext');
    }else{
    $appType = header('Content-Type: application/pdf');
    //$appType = header('Content-Type: application/octet-stream');
    }
    
    if (file_exists($file)) {
        header('Content-Description: File Transfer');
        echo $appType;
        header('Content-Disposition: attachment; filename='.basename($file));
        header('Content-Transfer-Encoding: binary');
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
        header('Content-Length: ' . filesize($file));
        ob_clean();
        flush();
        readfile($file);
        exit;
    }
    
    ?>
    

     

    Thank you for looking!

  16. A picture might help?

     

    row "math_cat" is the number in the form.

     

    WRONG "checkbox" has a value of 1

     

    	
    foreach($_POST['catID'] as $key => $catID){    
    
    	if ($_POST['score'][$key] == "1"){ 
    		$insert = mysql_unbuffered_query(" insert into test_results values('".$_POST['id']."', '$catID', '1', '', '', '') ");       
    
    	}else{   
    		$insert = mysql_unbuffered_query(" insert into test_results values('".$_POST['id']."', '$catID', '0', '', '', '') "); 
    
    	}
    }
    }

     

    [attachment deleted by admin]

  17. I am posting...

     

    I just realized the checkboxes ("1") are not being inserted with the right catID.

     

    I checked numbers 1, 3, 5, 7

     

    
    Here is the actual output from the code:
    
    1 = 1
    2 = 1
    3 = 1
    4 = 1
    5 = 0
    6 = 0
    7 = 0
    8 = 0
    9 = 0
    10 = 0
    up to 45
    
    It should be:
    
    1 = 1
    2 = 0
    3 = 1
    4 = 0
    5 = 1
    6 = 0
    7 = 1
    8 = 0
    9 = 0
    10 = 0
    up to 45
    
    

     

    any thoughts?

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