Jump to content

AyKay47

Members
  • Posts

    3,281
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by AyKay47

  1. not exactly sure what you are trying to do here, can you give me an example please?
  2. I'm feeling kind of lazy right now so I won't write the code but i'll tell you how it can be done..create an onclick function that will disable the rest of the radio buttons so they cannot be clicked after one is clicked..something like <script type="text/javascript"> function disableField() { document.form1.address2.disabled=true; } </script>
  3. you defined the $img variable inside of the if else statement, and only there can it be called without redefining it
  4. okay here we go..say you have a folder that you will store your images in named "images" located under the root directory..."http://host.com/images" Okay now say you uploaded a picture into the "images" directory named "test.jpg" What you would insert into the database field where your image paths are stored is "/images/test.jpg" Then when you are ready to extract that image path you would do something like this.. $query = mysql_query("SELECT image_path FROM table_name WHERE something = 'something'"); //insert correct table/field names $row = mysql_fetch_array($query, MYSQL_ASSOC); $image_path = $row['image_path']; print "<img src='$image_path' />"; If you want to display more then one image, use a while loop...
  5. 1. please don't display your mysql information on here...this is sensitive data.. 2. Instead of storing blobs inside of a database..which in my opinion is the harder/less inefficient way to do this...what I would recommend is that you store the image(s) inside of a directory, store the image path inside of your database, then use that as your img source..
  6. almost sounds like a BOM is being inserted, but I have not known it to output... Edit: as wildteen88 suggested, I would contact your host provider about this issue
  7. on a blank page with the 0 output, what does a "view source" show?
  8. foreach($array as $value){ print "$value <br />"; //format it however you want }
  9. just wanted to make sure that you didn't miss it somehow...
  10. $string = "this is a sample string for learning"; $exp = explode(" ",$string); foreach($exp as $value){ if(strlen($value) >= 10){ //do something }else{ // do something else } } since I do not fully understand what exactly you are wanting to do to the strings if they are under 10 chars and above 10 chars, I can't quite finish this code...if you need further help let me know. Edit: wordwrap could be what you want here yes..
  11. the code I posted will work if used correctly, and will certainly not cause your target.php page to return blank...what errors do you receive in your error.log? make sure your error_reporting is set to 1
  12. refer to my post
  13. use realpath
  14. I see your point, in your case then perhaps we should revert back to what we were doing before..let's try this.. $list[] = $row['Host']; $array = urlencode(serialize($list); $body .= "Please click on link: <a href = \"http://xx.xx.xx.xx/reg.php?array=$array \">click</a>"; target page ( clicked on email ) $array = (isset($_GET['array'])) ? unserialize($_GET['array']): array(); //unserialize only print_r($array);
  15. didn't I already direct you to the AJAX website that you should look into?
  16. try this if(!empty($productImage)) { $sql = mysql_query("UPDATE products SET product_name = '$productName', image = '$productImage', price = '$productPrice', description = '$productDetails', category_id = '$producteCagegory', subcategory_id = '$productSubcategory' WHERE id_product = '{$_POST[idProduct]}'") or die(mysql_error()); move_uploaded_file($_FILES["productImage"]["tmp_name"], IMG_UPLOAD . $_FILES["productImage"]["name"]); }else{ $sql = mysql_query("UPDATE products SET product_name = '$productName' ") or die(mysql_error()); } redirect_to("inventory_edit.php?pid=$_POST[idProduct]");
  17. with this function, simply place your array where $args is...it does the work for you, it will return the variable $out which will be the query string with your keys and values...so say you have an array like this.. $arr = array('apple' => 'red', 'orange' => 'round', 'blueberry' => 'blue'); you pass it through the function that I have previously posted like so encode_array($arr); you should receive something like this $out = "apple=red&orange=round$blueberry=blue"; then you will simply add this to your url.. $body .= "Please click on link: <a href = \"http://xx.xx.xx.xx/reg.php?$out \">click</a>"; then use $_GET to extract the array values like you would any other query string
  18. if you use the absolute path, what errror(s) are you receiving then? the same ones?
  19. you should be able to use a simple preg_match here to isolate the state name in each radio button value.. $event = $_POST['event']; $pattern = '~([A-Z]{2})~'; preg_match($pattern, $event,$matches); $state_abbrev = $matches[0];
  20. ohh you are using windows.. :-\ you will want to change the "upload_tmp_dir" in your php.ini file and make it a directory near your website directory.
  21. AyKay47

    newbe

    nope, not really at all
  22. $filename = ../../../tmp or you can use an absolute path
  23. here's an interesting function that I found on php.net that creates a GET query from an array function encode_array($args) { if(!is_array($args)) return false; $c = 0; $out = ''; foreach($args as $name => $value) { if($c++ != 0) $out .= '&'; $out .= urlencode("$name").'='; if(is_array($value)) { $out .= urlencode(serialize($value)); }else{ $out .= urlencode("$value"); } } return $out . "\n"; } ?>
  24. the variable $SM that you have made should contain the array in its original form..why aren't you using that variable instead of $s1 which is your encoded array?
  25. I would recommend using AJAX here https://developer.mozilla.org/en/AJAX
×
×
  • 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.