Reputation Activity
-
mealybar got a reaction from Major_Disaster in Help with PHP sessionsThe second line is:
header("Cache-control: private");
and fixes a bug in IE in certain situations on Windows XP.
-
mealybar got a reaction from Georgew in MySQL last_insert_idI'm guessing you're running this through mysql_query()?
If I remember rightly it will only execute one query per call, i.e. to your first ';'.
I'd split them out, and use mysql_insert_id().
And better still if you're using innodb additionally wrap all the queries in a transaction to ensure either they all work successfully or none of them do.
-
mealybar got a reaction from dany123 in Memorizing codesI wouldn't worry about memorising every tag, that's what the docs are for - and it's changing all the time anyway!
The main thing is to know when and where to use a tag, attribute, method or function.
Build your vocabulary, use a dictionary for the spelling
-
mealybar got a reaction from Synjyn in Jquery customise multi-step formSynjyn is on the money with the <a href='#' causing the scroll to top.
Try inserting a
e.preventDefault(); at the end of the click event function.
If that doesnt work try
return false; in the same place (sometimes the prevent default doesnt work for me).
Basically both those snippets stop the click event in it's tracks, which should stop it scrolling to the top.
Check out http://api.jquery.com/event.preventDefault/ in the jQuery docs.
-
mealybar got a reaction from lozenges in Jquery customise multi-step formSynjyn is on the money with the <a href='#' causing the scroll to top.
Try inserting a
e.preventDefault(); at the end of the click event function.
If that doesnt work try
return false; in the same place (sometimes the prevent default doesnt work for me).
Basically both those snippets stop the click event in it's tracks, which should stop it scrolling to the top.
Check out http://api.jquery.com/event.preventDefault/ in the jQuery docs.
-
mealybar reacted to Jock in Putting basic weather info on a commercial websiteThere are free API's available from weatherbug and wunderground. Also the iGoogle weather gadget uses XML which you can query, here is an example...
<?php $ch = curl_init("www.google.com/ig/api?weather=Linlithgow,Scotland"); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.2. Gecko/20100723 Linux Mint/8 (Helena) Firefox/3.6.8"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $output = curl_exec($ch); curl_close($ch); $xml = simplexml_load_string($output); echo '<img src="http://img0.gmodules.com/'.$xml->weather->current_conditions->icon['data'].'" /><br/>'; echo $xml->weather->current_conditions->condition['data'] . ' '; echo $xml->weather->current_conditions->temp_c['data'].'°C<br/>'; ?>
Assuming you have PHP5 + CURL.