- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 48
- Posts with Upvotes
- 41
- Upvoting Members
- 36
- Downvotes Received
- 4
- Posts with Downvotes
- 4
- Downvoting Members
- 3
Re: line 73 is missing a semi-colon | |
Re: Just came across my first daniweb google hit. Searched on "Coldfusion wamp" past year. 8th link on page. | |
...was asked for some php file upload code, so I thought I would post some stripped down, barebones code that I use in admin/dashboard pages to add/change images associated with products. Please see attached image for folder setup. The code uses the [jQuery Form](http://malsup.com/jquery/form/) plugin by Mike Alsup. **index.php** has … | |
Re: Hi James, I think your second listing should actually be coded:- $listing = [ 'one' => $x, 'two' => $y, 'three' => $z ]; | |
Re: Hi, Try not to use for loops to iterate an array. I'm not sure what you are trying to achieve, but i've constructed similar data and looped through it. Hope it helps. $array = array( '798D25C0DEABD' => array('quantity' => 1, 'price' => 20.5), '40B2B0FA3D222' => array('quantity' => 1, 'price' => … | |
Re: Hi James, $response[] = will create (if it doesn't exist) or append the right-hand value to the $response array. So if $html->data->identifier is a simple string, e.g. 'Price', then a new array would be ['Price'] or array(0=>'Price') $order->get_items() appears to be a nested object not an array. I've created a … | |
Re: <style>.selected {background: yellow}</style> <?php $menu[] = array('menu_id' => 1, 'menu_text' => 'Home'); $menu[] = array('menu_id' => 2, 'menu_text' => 'Service'); $menu[] = array('menu_id' => 3, 'menu_text' => 'About Us'); $menu[] = array('menu_id' => 4, 'menu_text' => 'Contact Us'); $selected = (isset($_GET['side']) and !preg_match('/\D/',$_GET['side'])) ? $_GET['side'] : 0; $i = 0; … | |
Re: If your checkboxes are there to purely signify that there will be content in a corresponding text field, then I would lose the checkboxes and simply check for form field content in your form handler. You have too any forms. "There can only be one" (Highlander) :D | |
Re: What is part ? is it a string of html or a numeric ? | |
Re: Hi, .val() is for form values. you need to use .text() | |
Re: dhani09 are you open to using jQuery? | |
Re: Hi, Syntax error :-) `setTimeout(function(){alert("my message");location.replace("/new-page.php");},1000);` | |
| Re: <img src="" id="pics"> <script> var m=new Date(); var imageArray = [ "Holiday/HolidayDesktops/Newyear.jpg", "Holiday/HolidayDesktops/Vday.jpg", "Holiday/HolidayDesktops/St.Patday.jpg", "Holiday/HolidayDesktops/Easter.jpg", "Holiday/HolidayDesktops/MemorialDay.jpg", "Holiday/HolidayDesktops/NatFlagDay.jpg", "Holiday/HolidayDesktops/July4.jpg", "Holiday/HolidayDesktops/WomensEqualityDay.jpg", "Holiday/HolidayDesktops/LaborDay.jpg", "Holiday/HolidayDesktops/Halloween.jpg", "Holiday/HolidayDesktops/Thanksgiving.jpg", "Holiday/HolidayDesktops/Christmas.jpg", ]; document.getElementById("pics").src=imageArray[m.getMonth()]; </script> |
Re: It's actually an HTML form. :-) You will need to use JavaScript and Ajax (jQuery make things easier). Your JavaScript will be called by your main file (the one with the form) and will simply run Ajax code to post all your form variables to a form handler. The form … | |
Re: Can you show the HTML form code? | |
Re: Very happy with CodeIgniter 2+ May attempt to learn Laravel 4 some time in the future. | |
Re: Can you post some of the table, including the select. | |
Re: Hi, I would hope that you have some PHP knowledge. If so, here is some very basic code to save your uploaded file to the server. You will need to substitute your own $dest value. post-cv-action.php <?php $filename = $_FILES['attachment']['name']; $source = $_FILES['attachment']['tmp_name']; $dest = $_SERVER['DOCUMENT_ROOT'].'/test/'; move_uploaded_file($source,$dest.$filename); ?> | |
Re: It would help if the CSS page were available. | |
Re: Instead of this route, you could allow the user to enter two recipients separated by either a comma or semi-colon - similar to how many email clients work. | |
Re: What is it's purpose in refreshing every 10 seconds? Do you record the amount of times it's reloaded? | |
Re: IF you are emailing the contents of a form. In your form handler:- $this->load->library('email'); $this->email->from('your@example.com', 'Your Name'); $this->email->to('someone@example.com'); $this->email->cc('another@another-example.com'); $this->email->bcc('them@their-example.com'); $this->email->subject($yourFormSubject); $this->email->message($concatOfFormFieldsYouWantToSend); $this->email->send(); | |
Re: What are you trying to achieve? I can understand reloading a page every x seconds, but why would you display a page and then x seconds later reload the page just once? | |
Re: overwrite line 16 (above) with this:- $id = 1000; $key = array_search($id, $cart['data']['product_id']); if($key!==FALSE) { unset($cart['data']['product_id'][$key]); unset($cart['data']['quantity'][$key]); } print_r($cart); die; | |
Re: Using your original code and looking at header in the php.net documentation I've constructed this:- if(file_exists($filename)) { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$filename.'"'); readfile($filename); } else { die('not ok'); } | |
Re: You just need to read a little more. Here's one [article](http://www.phphaven.com/article.php?id=65) from a google search. I've picked mysqli rather than mysql as mysql is so last year :-) | |
Re: Are you saying that none of your pages are displaying $_SESSION['username'] ? |