Jump to content

JonnoTheDev

Staff Alumni
  • Posts

    3,584
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by JonnoTheDev

  1. That wasn't a fix. print_r() prints the content of an array. Again if $fields is not an array you will receive the error you have when trying to use in a foreach() loop http://uk2.php.net/manual/en/control-structures.foreach.php
  2. Check the referrer $_SERVER['HTTP_REFERER'] Give each site an id of your own $referer[1] = "abc.com"; $referer[2] = "def.com"; $referer[3] = "ghi.com";
  3. Cookies or sessions. A cookie would be the preferred method IMO.
  4. $query = 'UPDATE site_user u, site_user_private_calender SET date_timestamp="'.mysql_real_escape_string($timestamp, $db).'", header="'.mysql_real_escape_string($header, $db).'", start_time_timestamp="'.mysql_real_escape_string($start_time_timestamp, $db).'", end_time_timestamp="'.mysql_real_escape_string($end_time_timestamp, $db).'", location="'.mysql_real_escape_string($location, $db).'", comment="'.mysql_real_escape_string($comment, $db).'" WHERE email ="'.$_SESSION['loginname'].'"';
  5. $fields must be an array!
  6. Thanks for the tip! No probs
  7. First of all you do not want to use a count of any post data for your loop as empty fields will mean it wont loop the required number of times. You need to count the number of rows displayed i.e 3 rows to use in the for loop. <?php $numRows = 3; for($x = 0; $x < $numRows; $x++) { if(!strlen(trim($_POST['brands'][$x]))) { $_POST['brands'][$x] = "n/a"; } if(!strlen(trim($_POST['items'][$x]))) { $_POST['items'][$x] = "n/a"; } if(!strlen(trim($_POST['prices'][$x]))) { $_POST['prices'][$x] = "n/a"; } } print_r($_POST['brands']); print_r($_POST['items']); print_r($_POST['prices']); ?>
  8. Only require 1 line. Make sure that you have validated that there is input in each of the textareas prior. <?php $content = implode("\r\n",array($_POST['textarea2'], $_POST['textarea3'], $_POST['textarea4'])); ?>
  9. because date is a function. It is for suggesting functions i.e type str then press CTRL+SPACE
  10. http://www.rdeeson.com/weblog/41/using-php-pspell-spell-check-functions-with-a-custom-dictionary.html
  11. I am still running DW MX. Auto code completion I find no help. Get used to writing code and not having an IDE do it for you. It will help you remember functions and how to use them correctly. As far as auto-completion of HTML open up a second page and create your HTML within, then copy into your code area. I prefer to use the smarty template engine to separate all presentation from logic. You will have no issues using tpl files in DW. http://smarty.net
  12. How many complete words in the english dictionary contain numbers or dashes?
  13. http://www.zend.com/products/studio/
  14. Here you go. In this example I am checking to see if www.mywebsite.com is found at http://www.abc.com <?php function checkRemoteValue($url, $value) { ob_start(); if(!@readfile($url)) { return false; } $body = ob_get_contents(); ob_end_clean(); if(stristr(htmlentities($body),$value)) { return true; } return false; } // usage if(checkRemoteValue("http://www.abc.com", "www.mywebsite.com")) { print "found"; } else { print "not found"; } ?>
  15. Thats because there is no set form. You dont need to do anything fantastic. Get clients to sign off a specification document including your terms (only you know what your terms are). Just lay it out simple i.e. Objective Specification Functionality Web Hosting Price Terms Cost of modifications, etc
  16. I would take a look at your CSS [attachment deleted by admin]
  17. Not really. All applications I develop I still maintain 100% ownership of the source code. The client is effectively purchasing a licence to use it. If you were to hand over the rights to the source code then your client could have the right to prevent you using that code in any other project you work on. Just like buying a copy of microsoft office. You have the licence to install and use the product but microsoft still owns the rights to the source code preventing you making modifications if it were available.
  18. You have no choice but to use HTTP headers. Add a link / button that the user can click to force download if easier.
  19. This must be at the top of all pages using sessions. i.e. place in a common include session_start(); http://www.sitepoint.com/article/users-php-sessions-mysql/
  20. http://wordpress.org/
  21. <div class="banner"> <?php $pages = array('includes/day.php', 'includes/seconds.php', 'includes/workshop.php', 'includes/road.php', 'includes/power.php', 'includes/outsourced.php'); $keys = array_rand($pages,3); foreach($keys as $key) { include($pages[$key]); } ?> </div>
  22. Read this http://www.ryboe.com/tutorials/php-headers-force-download
  23. Then please post the code parts you are having difficulty with and an explanation of what is going wrong.
  24. You need to learn the language yourself. If you have written your own code and are having trouble with something then you will receive help here without question. You must understand what you have written. What you will not get is somebody writing the script for you.
  25. And what do you have so far?
×
×
  • 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.