Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. most web browsers will block that nowadays, and they should as its friggin annoying.
  2. Its a piece of cake using mootools. All you do is var smooth = new SmoothScroll(); and any named anchors on your page will use it.
  3. I looked in FF3 and IE7 on windows and they looked the same...no text running into the green border. You could try adding a little padding to your .bodytext class.
  4. Someone else posted this video earlier and Its pretty good. Its about 46 minutes long. Look for the PHP Security video.... http://videos.code2design.com/
  5. I use http://fpdf.org. Most other libraries use this package as the framework for theirs. It really depends on what you are trying to put in the pdf.
  6. This works... <?php $free_ship_postcodes = array('CV1','CV2','CV3','CV4','CV5','CV6','CV7'); $customer_postcode = $order->delivery['postcode']; $check3digitcode = substr($customer_postcode, 0, 3); $valid_digits = in_array($check3digitcode, $free_ship_postcodes); //added from here down...first check against valid digits, then invalid if passed first validation $invalid_digits = false; if($valid_digits){ $non_free_postcodes = array('CV10', 'CV11', 'CV12', 'CV13', 'CV21', 'CV22', 'CV23', 'CV31', 'CV32', 'CV33', 'CV34', 'CV35', 'CV36', 'CV37', 'CV47'); $check4digitcode = substr($customer_postcode, 0, 4); $invalid_digits = in_array($check4digitcode, $non_free_postcodes); } if ($valid_digits && !$invalid_digits) $this->enabled = true;
  7. <?php $free_ship_postcodes = array('CV1','CV2','CV3','CV4','CV5','CV6','CV7'); $customer_postcode = $order->delivery['postcode']; $check3digitcode = substr($customer_postcode, 0, 3); $valid_digits = in_array($check3digitcode, $free_ship_postcodes); //added from here down...first check against valid digits, then invalid if passed first validation $invalid_digits = true; if($valid_digits){ $non_free_postcodes = array('CV10', 'CV11', 'CV12', 'CV13', 'CV21', 'CV22', 'CV23', 'CV31', 'CV32', 'CV33', 'CV34', 'CV35', 'CV36', 'CV37', 'CV47'); $check4digitcode = substr($non_free_postcodes, 0, 4); $invalid_digits = in_array($check4digitcode, $non_free_postcodes); } if ($valid_digits && $invalid_digits) $this->enabled = true; Might not be the best, but should do what you want.
  8. Maybe just rewrite what you have and put all of those values in an array, then check the first 4 characters and if it finds them, its not free. Just the opposite of what you are doing....
  9. How many non free shipping postal codes are there?
  10. Anything that you grab from the url is a $_GET. The only time post is used is when it is in a form and the forms 'method' is set to use post instead of get.
  11. should be a button or something under the last post made.
  12. What I have done before in a nutshell: Both databases (on each server) have a simple salt table with id and value and the tables are identical. Before you send data from one site to the other, encrypt it with a randomly selected salt. Send the id of the salt along with the encrypted data and decrypt it on the other end by retrieving the salt value.
  13. I was also trying to point out that you already have a sleep() at the end of your send_msg() function, which is currently set to 4 seconds. So it will send a message, wait 4 seconds, send another message....until there are no more to send.
  14. and you are already have a 'wait' in your sleep(4); statement at the bottom of the script. It will put a 4 second delay at the very end of sending the message before it does anything else.
  15. maybe foreach ($msg as $key => $value) { print "$value\n"; } send_msg($msg); should be foreach ($msg as $key => $value) { print "$value\n"; send_msg($value); }
  16. $csv="dog,cat,baboon"; $where = ""; $animals = explode(",", $csv); $boundary=sizeof($animals); for($count = 0; $count < $boundary; $count++) { $where .= "animalType = '" . $animals[$count] . "'"; if($count < $boundary -1) $where .= " OR "; //I assume you wanted OR and not AND } $sql = "SELECT * from animals WHERE " . $where; echo $sql; I did this in a foreach loop the first time and for some reason it wasn't working properly and I didn't want to keep messing with it....but this outputs:
  17. Is this something that is viewed online or sent to the browser, like as a download?
  18. What the heck ya got in a 700k include file?
  19. should be easy... just add a submit button to your form.
  20. //assume the original post data contained [username="cronix"] $_SESSION['formdata'] = $_POST; //send user back to form if(isset($_SESSION['formdata')) { extract($_SESSION['formdata']); unset($_SESSION['formdata']); } else { $username=""; } //then in your form <input name="username" value="<?php echo $username; ?>" /> //... I didn't test it but it should be close
  21. In addition to what xtopolis wrote, I would also store the post/get data in a session variable so when you go back to the form you can repopulate the form with the users previous entries so they don't have to enter it all over again. Nothing bites more than taking time to fill out a form and forget one little thing only to have the form come up blank and have to re-enter all of the data. Not user-friendly.
  22. $movie_cat = isset($_POST['CategMen']) ? $_POST['CategMen'] : ""; Does this work? And I'm not sure what you mean by "i tried putting a variable to the query window, which had as runtime value $_POST['CategMen'] but it still doesn't work as its supposed to" What query window? Is that a dreamweaver thing?
  23. Now that you've gone through all of that, let me say it would be easier to use a link instead of a form If you replaced the whole form thing we were just working on with something like: echo '<a href="http://mysite.com/process.php?action=update&id=' . $row['id'] . '">Update</a>'; echo " &nbsp"; echo '<a href="http://mysite.com/process.php?action=delete&id=' . $row['id'] . '">Delete</a>'; Obviously process.php should be changed to your script name. Then in your process.php: $action = isset($_GET['action']) ? $_GET['action'] : ""; $id = isset($_GET['id']) ? $_GET['id'] : ""; if(!empty($action) && !empty($id)) //check to see if $action and $id have values { switch($action) { case "update": //grab the data from the db using the $id, create a form and populate the form 'values' with the data; //then when you submit the form have it 'UPDATE' the database where the id=$id break; case "delete": //prompt if user is sure they want to delete //then just DELETE it from the database using WHERE id=$id break; } } Those are the basics, I don't want to write it all out...
×
×
  • 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.