-
Posts
3,584 -
Joined
-
Last visited
-
Days Won
3
Everything posted by JonnoTheDev
-
Warning: Invalid argument supplied for foreach()
JonnoTheDev replied to jonlim's topic in PHP Coding Help
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 -
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";
-
Cookies or sessions. A cookie would be the preferred method IMO.
-
$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'].'"';
-
Warning: Invalid argument supplied for foreach()
JonnoTheDev replied to jonlim's topic in PHP Coding Help
$fields must be an array! -
Thanks for the tip! No probs
-
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']); ?>
-
[SOLVED] Multiple Textareas into one mysql prep splitted by an "enter"
JonnoTheDev replied to Rub's topic in MySQL Help
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'])); ?> -
[SOLVED] Fundamental issue with coding in dreamweaver cs3
JonnoTheDev replied to isbhenrylu's topic in PHP Coding Help
because date is a function. It is for suggesting functions i.e type str then press CTRL+SPACE -
http://www.rdeeson.com/weblog/41/using-php-pspell-spell-check-functions-with-a-custom-dictionary.html
-
[SOLVED] Fundamental issue with coding in dreamweaver cs3
JonnoTheDev replied to isbhenrylu's topic in PHP Coding Help
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 -
How many complete words in the english dictionary contain numbers or dashes?
-
[SOLVED] Fundamental issue with coding in dreamweaver cs3
JonnoTheDev replied to isbhenrylu's topic in PHP Coding Help
http://www.zend.com/products/studio/ -
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"; } ?>
-
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
-
I would take a look at your CSS [attachment deleted by admin]
-
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.
-
Using Php to automatticly download a file
JonnoTheDev replied to bigboyfuge's topic in PHP Coding Help
You have no choice but to use HTTP headers. Add a link / button that the user can click to force download if easier. -
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/
-
http://wordpress.org/
-
<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>
-
Using Php to automatticly download a file
JonnoTheDev replied to bigboyfuge's topic in PHP Coding Help
Read this http://www.ryboe.com/tutorials/php-headers-force-download -
Then please post the code parts you are having difficulty with and an explanation of what is going wrong.
-
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.
-
And what do you have so far?