Jump to content

Sedona

Members
  • Posts

    19
  • Joined

  • Last visited

Posts posted by Sedona

  1. I placed your code into the top of the 'catch' page, here is the output:

     

    array ( )array ( 'DOCUMENT_ROOT' => '/home/sedoyrzi/public_html', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, sdch', 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8', 'HTTP_CACHE_CONTROL' => 'max-age=0', 'HTTP_COOKIE' => 'ips4_recentEmoticons=%5B%7B%22src%22%3A%22http%3A//www.sedonaconnect.com/uploads/monthly_2015_02/wink.png.7b86830064549519834fb1d05cbb24c2.png%22%2C%22text%22%3A%22%3B%29%22%7D%2C%7B%22src%22%3A%22http%3A//www.sedonaconnect.com/uploads/emoticons/boom.jpg%22%2C%22text%22%3A%22%3Aboom%3A%22%7D%5D; ips4_IPSSessionFront=6ppd6f8napglgug5q5piuf2380; ips4_IPSSessionAdmin=irkfvp01nrn6181usi1d1kv0u4; ips4_acpTabs=%7B%22core%22%3A%5B%5D%2C%22community%22%3A%5B%5D%2C%22members%22%3A%5B%5D%2C%22nexus%22%3A%5B%5D%2C%22content%22%3A%5B%5D%2C%22stats%22%3A%5B%5D%2C%22customization%22%3A%5B%5D%7D; ips4_member_id=1; ips4_pass_hash=617a52a733d824d430498409d94f93b9; ips4_ipsTimezone=America/Phoenix', 'HTTP_DNT' => '1', 'HTTP_HOST' => 'www.sedonaconnect.com', 'HTTP_REFERER' => 'http://www.sedonaconnect.com/Ads/createAd.php' 'HTTP_UPGRADE_INSECURE_REQUESTS' => '1', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36', 'HTTP_X_FORWARDED_FOR' => '24.121.198.152', 'PATH' => '/bin:/usr/bin', 'PATH_INFO' => '/', 'PATH_TRANSLATED' => '/home/sedoyrzi/public_html/Ads/placeAd.php', 'QUERY_STRING' => '', 'REDIRECT_STATUS' => '200', 'REMOTE_ADDR' => '24.121.198.152', 'REMOTE_PORT' => '37962', 'REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/Ads/placeAd.php/', 'SCRIPT_FILENAME' => '/home/sedoyrzi/public_html/Ads/placeAd.php', 'SCRIPT_NAME' => '/Ads/placeAd.php', 'SERVER_ADDR' => '192.64.112.59', 'SERVER_ADMIN' => 'webmaster@sedonaconnect.com', 'SERVER_NAME' => 'www.sedonaconnect.com', 'SERVER_PORT' => '80', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'UNIQUE_ID' => 'VeOtEse8yGQABz7Zpi8AAAAV', 'PHP_SELF' => '/Ads/placeAd.php/', 'REQUEST_TIME_FLOAT' => 1440984338.9681270122528076171875, 'REQUEST_TIME' => 1440984338, )string(0) "" array(0) { } 


  2. <?php
    $servername = "localhost";
    $username = "";
    $password = "";
    $dbname = "";
    global $mysqli;

    ini_set('display_errors', 'On');
    error_reporting(-1);

    // Create connection
    $conn = new mysqli($servername, $username, $password, $dbname);

    // Check connection
    if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
    }

    var_dump(file_get_contents('php://input'));
    var_dump($_POST);

    // Setup the collection of the POST variables


    if (isset($_POST["bold"])) {
    $_POST["bold"]="1";
    } else {
    $_POST["bold"]="0";
    }

    $Line1=$_POST["Line1"];
    $Bold=$_POST["bold"];
    $Line2=$_POST["Line2"];
    $Line3=$_POST["Line3"];
    $Line4=$_POST["Line4"];
    $Line5=$_POST["Line5"];
    $Line6=$_POST["Line6"];
    $NumOfWeeks =$_POST["weeks"];
    $Email=$_POST["email"];
    $Comment=$_POST["comment"];


    $sql = "INSERT INTO SSCAds (`Line1`, `Line2`, `Line3`, `Line4`, `Line5`, `Line6`, `NumOfWeeks`, `Email`, `Comment`, `Bold`)
    VALUES ('$Line1', '$Line2', '$Line3', '$Line4', '$Line5', '$Line6', '$NumOfWeeks', '$Email', '$Comment', '$Bold')";

    if ($conn->query($sql) === TRUE) {
    echo "New record created successfully";
    } else {
    echo "Error: " . $sql . "<br>" . $conn->error;
    }

    //Close this down
    mysqli_close($conn);


    ?>

  3. This is the output:

     

    array ( )array ( 'DOCUMENT_ROOT' => '/home/sedoyrzi/public_html', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, sdch', 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.8', 'HTTP_CACHE_CONTROL' => 'max-age=0', 'HTTP_COOKIE' => 'ips4_recentEmoticons=%5B%7B%22src%22%3A%22http%3A//www.sedonaconnect.com/uploads/monthly_2015_02/wink.png.7b86830064549519834fb1d05cbb24c2.png%22%2C%22text%22%3A%22%3B%29%22%7D%2C%7B%22src%22%3A%22http%3A//www.sedonaconnect.com/uploads/emoticons/boom.jpg%22%2C%22text%22%3A%22%3Aboom%3A%22%7D%5D; ips4_IPSSessionFront=6ppd6f8napglgug5q5piuf2380; ips4_IPSSessionAdmin=irkfvp01nrn6181usi1d1kv0u4; ips4_acpTabs=%7B%22core%22%3A%5B%5D%2C%22community%22%3A%5B%5D%2C%22members%22%3A%5B%5D%2C%22nexus%22%3A%5B%5D%2C%22content%22%3A%5B%5D%2C%22stats%22%3A%5B%5D%2C%22customization%22%3A%5B%5D%7D; ips4_hasJS=true; ips4_member_id=1; ips4_pass_hash=617a52a733d824d430498409d94f93b9; ips4_ipsTimezone=America/Phoenix', 'HTTP_DNT' => '1', 'HTTP_HOST' => 'www.sedonaconnect.com', 'HTTP_REFERER' => 'http://www.sedonaconnect.com/Ads/createAd.php' 'HTTP_UPGRADE_INSECURE_REQUESTS' => '1', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.157 Safari/537.36', 'HTTP_X_FORWARDED_FOR' => '24.121.198.152', 'PATH' => '/bin:/usr/bin', 'PATH_INFO' => '/', 'PATH_TRANSLATED' => '/home/sedoyrzi/public_html/Ads/placeAd.php', 'QUERY_STRING' => '', 'REDIRECT_STATUS' => '200', 'REMOTE_ADDR' => '24.121.198.152', 'REMOTE_PORT' => '49994', 'REQUEST_METHOD' => 'GET', 'REQUEST_URI' => '/Ads/placeAd.php/', 'SCRIPT_FILENAME' => '/home/sedoyrzi/public_html/Ads/placeAd.php', 'SCRIPT_NAME' => '/Ads/placeAd.php', 'SERVER_ADDR' => '192.64.112.59', 'SERVER_ADMIN' => 'webmaster@sedonaconnect.com', 'SERVER_NAME' => 'www.sedonaconnect.com', 'SERVER_PORT' => '80', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'SERVER_SIGNATURE' => '', 'SERVER_SOFTWARE' => 'Apache', 'UNIQUE_ID' => 'VeOPi8e8yGQABOTYpTgAAACM', 'PHP_SELF' => '/Ads/placeAd.php/', 'REQUEST_TIME_FLOAT' => 1440976779.364756107330322265625, 'REQUEST_TIME' => 1440976779, )string(0) "" array(0) { } 

  4. string(0) "" array(15) { ["Line1"]=> string(22) "ttp://www.mariposa.com" ["countDisplay1"]=> string(1) "6" ["Line2"]=> string(0) "" ["countDisplay2"]=> string(2) "28" ["Line3"]=> string(0) "" ["countDisplay3"]=> string(2) "28" ["Line4"]=> string(0) "" ["countDisplay4"]=> string(2) "28" ["Line5"]=> string(0) "" ["countDisplay5"]=> string(2) "28" ["Line6"]=> string(0) "" ["countDisplay6"]=> string(2) "28" ["weeks"]=> string(0) "" ["email"]=> string(0) "" ["comment"]=> string(0) "" } New record created successfully

  5. This is the full error:

    string(0) "" array(0) { } 
    Notice: Undefined index: Line1 in /home/sedoyrzi/public_html/Ads/placeAd.php on line 29
    
    Notice: Undefined index: Line2 in /home/sedoyrzi/public_html/Ads/placeAd.php on line 31
    
    Notice: Undefined index: Line3 in /home/sedoyrzi/public_html/Ads/placeAd.php on line 32
    
    Notice: Undefined index: Line4 in /home/sedoyrzi/public_html/Ads/placeAd.php on line 33
    
    Notice: Undefined index: Line5 in /home/sedoyrzi/public_html/Ads/placeAd.php on line 34
    
    Notice: Undefined index: Line6 in /home/sedoyrzi/public_html/Ads/placeAd.php on line 35
    
    Notice: Undefined index: weeks in /home/sedoyrzi/public_html/Ads/placeAd.php on line 36
    
    Notice: Undefined index: email in /home/sedoyrzi/public_html/Ads/placeAd.php on line 37
    
    Notice: Undefined index: comment in /home/sedoyrzi/public_html/Ads/placeAd.php on line 38
    New record created successfully
    
  6. The php code to insert the POST data is:

     

    Database connection routine

     

    $Line1=$_POST["Line1"];

     

    $sql = "INSERT INTO SSCAds (`Line1`) VALUES ('$Line1')";
     
    if ($conn->query($sql) === TRUE) {
        echo "New record created successfully";
    } else {
        echo "Error: " . $sql . "<br>" . $conn->error;
    }
  7. Input form

    <form action="/Ads/placeAd.php" method="post" enctype="multipart/form-data" id="formAd">
     
    Line 1: <input type="text" placeholder="Remaining Characters" autofocus style="width: 250px;" name="Line1" maxlength="28" onKeyDown="textCounter1(this.form.Line1,this.form.countDisplay1);" onKeyUp="textCounter1(this.form.Line1,this.form.countDisplay1);"/><input readonly type="text" style="width: 35px;" name="countDisplay1" size="2" maxlength="2" value="28"/><input type="checkbox" name="bold" value="1"/> <strong> Make the first line bold.</strong><br>
    
    

    Javascript for that input box:

    var maxAmount = 28;
    function textCounter1(textField, showCountField) {
        if (textField.value.length > maxAmount) {
            textField.value = textField.value.substring(0, maxAmount);
    	} else { 
            showCountField.value = maxAmount - textField.value.length;
    	}
    }
    
  8. I have an HTML form using an input box, the form calls a php form to grab the POST contents.  

     

    It will save any data as long as a URL (http://) is not the first characters in the input box.   

     

    Http, HTTP:, http:/ all will save fine, but http:// will cause the POST array to be nulled out.  

     

    Any ideas?

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