Jump to content

bumba000

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by bumba000

  1. Thanks for the reply. This isn't gonna be used with a site or online in any way. Just for our local customers and for my own php practice. This is what I have so far for my Create_Invoice.php <table width="94%" border="0" align="center" cellpadding="2"> <tr> <td width="10%"> </td> <td width="63%"><div align="center">Customer Information </div></td> </tr> <tr> <td class="style1">Name </td> <td><form action="insert.php" method="post"> <label> First <input name="firstName" type="text" id="firstName" size="20" /> </label> Last <label> <input name="lastName" type="text" id="lastName" size="20" /> </label> </td> </tr> <tr> <td class="style1">Adderess</td> <td><label>Street <input name="street" type="text" id="address" value="" size="40"></label><br /> <lable>City <input name="city" type="text" id="city" value="" size="40"> </lable><br /> <lable>State <input name="state" type="text" id="state" value="" size="5"> </lable> <lable>Zip<input name="zip" type="text" id="zip" value="" size="8"> </lable></td> </tr> <tr> <td class="style1">Phone</td> <td><input name="phone" type="text" id="phone" size="20" /><br /><br /> </td> </tr> <tr><td><label> <input name="site" type="radio" value="12volt"> 12Volt</label><label> <input name="site" type="radio" value="stomp"> Stomp</label></td><td><input type="submit" name="Submit" value="Submit"></form></td></tr> </table> This is the insert.php <?php $con = mysql_connect("localhost","root","iforgot1"); if (!$con) { die('Could not connect: ' . mysql_error()); } $date = date("F j, Y"); // March 10, 2001 mysql_select_db("Invoicing", $con); $sql="INSERT INTO customer_invoice (FirstName, LastName, Street, City, State, Zip, Phone, Date, Site) VALUES ('$_POST[firstName]','$_POST[lastName]','$_POST[street]','$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[phone]', '$date','$_POST[site]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con) ?>
  2. Hi All, I have made a form, an "insert.php" and a DB to go along with it. For now my form has only Fname, Lname, Address and phone. I need to add fields for Model, Descrip, Qty and Price. My DB has two tables. One called customer_invoice and one called Orders. Both have an ID record as well. I would like to have my form (with the name and address. . .) also have multiple fields for product model, descrip. . . How can I have many fields (product area) input into the db and have the same ID as the customer? Also, how can many fields use the same name? Is there a better way to do what I'm trying to accomplish? Thanks in advance, John
  3. OMG what a jerk! I can't believe I did that. I am trying soooo hard and doing my absolute best to learn this stuff. Little things like this . . . ERRRRR. That's cool though. Thank you so much for seeing that. John
  4. That didnt work. On the bright side I am only getting results for those website id's that are in the marks table. So I know that the query is functioning properly. My code hasn't changed from above except for the addition of the commented out var_dump($array);. What am I missing here? Thank you, John
  5. Thanks for that. Here are my results. I'm not sure what to make of them. array( { [0]=> string(2) "22" ["website_id"]=> string(2) "22" [1]=> string(9) "BlinkList" ["network_name"]=> string(9) "BlinkList" [2]=> string(1) "1" ["partner_id"]=> string(1) "1" [3]=> string(10) "1220677200" ["date"]=> string(10) "1220677200" }
  6. Hi All, I have a db connection and am getting results here. The problem seems to be with my in_array. I have a table called marks. I have a record in there with the value of 22 in the website_id field. The network_name field of the record has the name Blinklist in it. Below is an example of my table and a single record. Below that is the code in question. As you can see, Blinklist is in the record but I get the echo response "Its Not Here". Why? Thanks in advance, John MARKS: website_id | network_name | date 22 | Blinklist | 1220677200 $webSiteID = $rowGetClient['website_id']; $getMarksList = mysql_query("SELECT * FROM marks WHERE website_id = 22"); if(!$getMarksList) { die("Get List Failed: " . mysql_error()); }?> <?php while ($array = mysql_fetch_array($getMarksList)){ if (in_array("Blinklist", $array)) { echo "Its Here";}else{echo "Its Not Here";} echo '<br>'."ID=:" . $webSiteID; } ?>
  7. genericnumber1 my line 25 is $clientCustomersID = $_SESSION['customer_id']); EDIT: Genericnumber1 Ohhhh. I see it. That is the right line. Thanks for that! Ken2k7 there is already a session started this is in a functional cart. $_SESSION['customer_id'] exists I can echo $_SESSION['customer_id'] . $_SESSION['customer_firstname']; and come up with the correct info. Will wrapping each variable in it's own single quotes fix where you are saying " SQL VALUES part of the line will be a syntax error"? Thank you for helping, John
  8. Hi All, I have built a form that shows up in my site until I add the php code below to inject it into my DB. As soon as I add the php for the injection I get a blank page. First of all please tell my why this is happening. Secondly please tell me if the way I am trying to write to my DB will work or not. This is loading in a page that already has a DB connection. If my injector is broken please tell me why. Okay to start with here is my table structure. websites: website_id is Primary customers_id is Index url description keywords <form method="POST"> <br><br>Your Website URL <br><br><input name="websiteUrl" type="text" size="40" maxlength="200"> <br><br>Keywords you would like help ranking for: <br><br><input name="keywords" type="text" value="Keyword, Keyword" size="40" maxlength="200"> <br><br>Enter a description of your website: <textarea name="description" cols="60" rows="4">Description of your website here. . .</textarea> <br><br> <input type="submit" name="send" value="Submit"/> </form> <?php $clientCustomersID = $_SESSION['customer_id']); $websiteURL = serialize($_POST['websiteUrl']); $keywords = serialize($_POST['keywords']); $description = serialize($_POST['description']); //Inject Customers website into client side DB if($_SERVER['REQUEST_METHOD']=='POST') { $qur="INSERT INTO websites (`customers_id`,`url`,`keywords`,`description`)values ('$clientCustomersID,$websiteURL,$keywords,$description')"; } ?> Thanks in advance, John <--- Super Newb!
  9. Okay! Got that too! single quotes not double. and I had to include this file above the doc type in my html_header.php not below the metas! Redirect on choice of no works and remove ip from db and redirect to homepage works on choice of yes. HELL YEAH! Thanks to all of you for your time. Also for putting up with this super newb! John
  10. I made it delete the IP from the DB!!!!!! Ha Ha! Still doesn't redirect with header("Location: http://www.google.com"); or header("Location: http://www.mydomain.com");tho. Please tell me why. <?php $myQuery = mysql_query("SELECT `banip` FROM `banedIPS`"); if(!$myQuery) { die("Database table Selection Failed: " . mysql_error()); } while ($row = mysql_fetch_assoc($myQuery)) { if($row['banip'] == $_SERVER['REMOTE_ADDR']) { if(!isset($_POST['submit'])){ echo "<form method=\"post\">"; echo "Are you a human?<br />"; echo "<select name=\"humancheck\">"; echo "<option value=\"no\">No</option>"; echo "<option value=\"yes\">Yes</option>"; echo "<input type=\"submit\" name=\"submit\" value=\"Submit\" />"; echo "</select></form>"; } //$check = $_POST['humancheck']; if($_POST['humancheck'] == "no"){ header("Location: http://www.google.com"); } esleif($_POST['humancheck'] == "yes"){ mysql_query("DELETE FROM `banedIPS` WHERE `banip` = '".$_SERVER['REMOTE_ADDR']."'"); header("Location: http://www.mydomain.com"); } } } ?>
  11. It does kinda work. If your ip is in my db list then you see the form if your ip is not in the list you don't see the form. The problem is when you do see the form and you make a selection nothing happens that's supposed to happen. The form simply goes away and lets you continue browsing. If you select no from the drop you should be taken to google but that doesn't happen. If you select yes then your IP should be removed from the db. Doesn't happen.
  12. its only supposed to delete your ip from the db when you select "yes" that you are a human. I didn't catch the $_GET REMOTE_ADDR. I did change it to $_SERVER but still the form doesn't remove anything from the db. If you select no you should be directed to google. if you select yes then your ip should be removed from the db and be redirected to my main page where you wouldn't see the form again because your ip has been removed from the db. Thanks , John
  13. This form will not redirect or update the db. What is wrong with it? <?php $myQuery = mysql_query("SELECT `banip` FROM `banedIPS`"); if(!$myQuery) { die("Database table Selection Failed: " . mysql_error()); } while ($row = mysql_fetch_assoc($myQuery)) { if($row['banip'] == $_SERVER['REMOTE_ADDR']) { if(!isset($_POST['submit'])){ echo "<form method=\"post\">"; echo "Are you a human?<br />"; echo "<select name=\"humancheck\">"; echo "<option value=\"no\">No</option>"; echo "<option value=\"yes\">Yes</option>"; echo "<input type=\"submit\" name=\"submit\" value=\"Submit\" />"; echo "</select></form>"; }else{ $check = $_POST['humancheck']; if($check == "no"){ header("Location: http://www.google.com"); }elseif($check == "yes"){ mysql_query("DELETE FROM `banip` WHERE `banip` = '".$_GET['REMOTE_ADDR']."'"); header("Location: http://www.mydomain.com"); } } } } ?> Thank you, John
  14. Argggg. I cant seem to get this to do what I want. I'm hacking away at this but cant make it work. I am trying to get this {exit;} in there to where after the form is displayed the visitor would see nothing until the question is answered. Everything I try either blocks the ip all together like the original or just breaks. This is driving me crazy. Is there something other than {exit;} that I should be using here? Thanks, John
  15. Okay. We were missing a }. This isn't removing the IP from DB and is not redirecting to google. There is a selection and a button tho and it is picking up on the list of ips. Will there be a way to not show the site until the question is answered? If a bot can choose to not answer and still see the page then this defeats the purpose. Thanks , John
  16. Not sure why yet but this gives me a blank page in my browser. My ip is not in the list of banned ips. I'll keep looking over it but if you see the problem please let me know. Thanks, John
  17. Thanks guys. I came up with another way. DB driven! <?php $myQuery = mysql_query("SELECT banip FROM banedIPS"); if(!$myQuery) { die("Database table Selection Failed: " . mysql_error()); } while ($row = mysql_fetch_assoc($myQuery)) { if (strstr($_SERVER["REMOTE_ADDR"], $row['banip'])) {exit;} } ?> Since ips change and a real person may end up with one of these ips one day I would also like to add a form to this. I would like to say something like if (strstr($_SERVER["REMOTE_ADDR"], $row['banip'])) radio_button are you human yes no; if (radio_button == yes) { load site & remove ip row from db } {else} {exit;} can you help me put this into code plesae? Thanks , John
  18. I haven't tested it yet. Would this work? <?php $IPS = array(83.41.85.224, 72.23.162.137); foreach ($IPS as $IPS_Return) { if (strstr($_SERVER["REMOTE_ADDR"], '$IPS_Return')) {exit;} } ?>
  19. Doesn't the in_array check for a specific value? If not how would I do this? I'm still a newb and php.net isn't helping much here. Thank you, John
  20. Hi All, I have found what I needed to block a bandwidth hog bot from spain but I get more than just that one. I found a way to get rid of it. I would like to add more IP's to the list though. How do I do this? Would it just be "IP"."IP"."IP". . . or will I have to build an array of IP's and then do a foreach? <?php if (strstr($_SERVER["REMOTE_ADDR"], "209.249.86.17")) {exit;} ?> Thanks in advance, John
  21. Thank you all for your help on this. In the end it was a little from each and my goofy way of hijacking php. $myQuery = mysql_query("SELECT website_url2 FROM url", $connection); if(!$myQuery) { die("Database table Selection Failed: " . mysql_error()); } while ($row = mysql_fetch_assoc($myQuery)) { //Filename: curl_test.php $ch = curl_init(); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Uncomment this for Windows. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_URL, $row['website_url2']); $result = curl_exec($ch); if (curl_errno($ch) == 0){ echo 'Good SSL '.$row['website_url2']; } else { echo 'bad ssl: '.$row['website_url2']; } curl_close ($ch); echo '<br>'.'EOF'.'<br>'; } ?> This gives me the result Once again, Thank you so much for your time and consideration with this super newb. Best Regards, John
  22. This give me Parse error: syntax error, unexpected ';' in /home/hackerse/public_html/sslTest4.php on line 33 which is : die("query found no results"; No way that I alter this makes the browser happy. Also. How will this make the good and the bad ssl urls show up in the browser. Basically in the end what I would like to do is if it's good (curl_errno ==0) I see Good SSL if (curl_errno > 1) I see Bad SSL.
  23. That does not appear to be the answer. WOW. This is worse than spanish! I need to see two things here in my browser. Good SSL and Bad SSL. For those that are good show Good SSL and for those that aren't good show Bad SSL. Why is this so complicated? If I wanted to go to the nearest city and take a php course which class would I ask for? Thanks, John
×
×
  • 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.