I did a quick ebay store integration here:
http://www.bowralmotorcycles.com.au/parts_accessories.php
The ebay store products now display on the website.
PHP code and instructions coming soon.
Got an email with this question:
What I am seeking is an equally easy PHP inclusion that retains drop down and radio button entries when a form has an error on submission.
Continue Reading »Simple script to create randomised background text with customised colours.
When spitting out images with php the browser doesn't seem to cache the resulting image.
because the browsers were no caching the images.
Continue Reading »How to change the default image size on product images.
Continue Reading »Here's how to make the browser store cookies across multiple sub domains.
Continue Reading »Sometimes it's handy to have the browser cache an entire page including anything that is entered into a form. What if a user has filled out an entire form but accidently clicks refresh or another link, and when they click back the form is empty. Anoying! This also works if you submit to an error checking page, and you want the browser to remember the form data instead of writing something in PHP. How to do this is below.
The easiest way to tell the browser that they can cache the page is by doing this:
header("Cache-Control: private, max-age=10800, pre-check=10800");
header("Pragma: private");
header("Expires: " . date(DATE_RFC822,strtotime("+2 day")));
Only do this on pages that are not dynamic, as the browser will keep this page in cache for 2 days.
Put the above code AFTER any session_start(); if you are using sessions.
And that's how to control cache when back button clicked.
I installed suPHP on a plesk box, works great for all the client vhost websites, all their PHP scripts run with their respective user account privellages.
However, suPHP was enabled for every PHP script which ran under apache. This caused a few issues ...
Continue Reading »Here's a useful bit of code for resizing an uploaded image and also creating a thumbnail.
It currently supports png/jpg/gif. Could do with some improvements in the error handling department.
http://examples.dtbaker.com.au/view/simple_image_thumbnail_resize_example
Here's a different way to generate forms using PHP, and to take care of all the required field validation too. It might help someone:
Here's how to upload files using curl in php: (it's very easy)
Continue Reading »Here's how to force the browser to download a file:
Continue Reading »Spent ages trying to get this working.
The problem was the carriage return in the stored procedure sql code.
$sql = preg_replace('/\r/','',$sql);
fixed the problem.
Hi search engines!
Gold Coast PHP Programmer needed
I am looking for a computer nerd who knows his PHP inside out and is very familiar with Linux.
To immediately take on some exciting projects with the possibility of joining a well paid team of programmers here on the Gold Coast.
Experience with Oracle or any sort of multilingual programming would be nice. You must know what json is, used web services before and not be scared of getting dirty with some ajax. Must be able to debug with firebug and the web developer toolbar
Email me your details and we can have a chat.
All oci8 PHP test's fail when building php-5.2.5
# make test TESTS=ext/oci8Continue Reading »
Running selected tests.
FAIL oci_bind_array_by_name() and invalid values 1 [ext/oci8/tests/array_bind_001.phpt]
FAIL oci_bind_array_by_name() and invalid values 2 [ext/oci8/tests/array_bind_002.phpt]
FAIL oci_bind_array_by_name() and invalid values 3 [ext/oci8/tests/array_bind_003.phpt]
FAIL oci_bind_array_by_name() and invalid values 4 [ext/oci8/tests/array_bind_004.phpt]
Distributing PHP code with RPM's
Continue Reading »Here's a bit of PHP showing how to use pcntl_fork();
useful if you need your script to do more than one thing at the same time.
Continue Reading »
When playing around and helping some guys at work learn more PHP I thought I would keep a record of some things we discussed.
Continue Reading »Here's how to do php preg_match multi line
Say you have this html:
<select name="foo">
<option value="1">asdfa</option>
<option>asd</option>
</select>
and you want everything between the <select> box, use this php code:
preg_match('/<select name="foo">(.*)<\/select>/msU',$html,$matches);
print_r($matches);
This usually means your phpMailer class cannot find the language file when it is trying to spit out a message.
eg: Language string failed to load: from_failed
easiest way to fix this is to set the language manually including the path to the language folder:
$mail = new PHPMailer();
$mail->SetLanguage("en", 'includes/phpMailer/language/');
Google login class:
If you have a script that runs for a long time and you would like to update the browser with some progress reports here is a very simple way of doing it:
script.php:
<html>
<body>
<div id="messages"></div>
</body>
<?php
function w($message){
?> <script language="javascript">
document.getElementById('messages').innerHTML =
document.getElementById('messages').innerHTML + "<?=$message;?>";
</script> <?php
@ob_flush(); @flush();
}
//example:
w("Here is a message");
sleep(5);
w("And another message");
sleep(5);
w("And yet another message");
?>
</html>
View an example here: click
Ran into a problem trying to use mod_rewrite in .htaccess on a Melbourne IT hosting account.
They seem to run PHP as CGI instead of an Apache module. Read the differences here: http://blog.dreamhosters.com/kbase/index.cgi?area=2933
Here's the rewrite script that worked in the end:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php [L,QSA]
The problem was a missing / before the index.php
|
Collector Comics is THE place to buy, sell, and research comics online. Launching soon.
Launch »
Screenshot »
|
|
Webitor is a kick-ass easy to use, easy to extend, non-database driven Content Management System. Version 2 with reseller plan coming soon.
Launch »
Version 1 »
|
|
GC Lounge is my own pet social network and test bed for social related code. Made by locals for locals.
Launch »
|
|
GG has indexed over half a million recent Trade Mark applications. This revolutionary tool is extremely valuable for industry experts.
Launch »
|
|
GCWiFi is the hub for techies interested in joining a ad-hoc wireless mesh spread across the Gold Coast
Launch »
|
|
Web based financial client management system
Launch »
|
|
OS Commerce modules and template modification
Launch »
|
| View More Projects » | |