Search found 15 matches

by RICKYJ
Wed Apr 04, 2007 1:55 pm
Forum: PHP - Code
Topic: php, how to catch if a variable is never sent (post or get)
Replies: 4
Views: 458

ok so it looks like I can just use:

Code: Select all

If ( isset($_POST['myVar']) == TRUE) {
// var has been initialised
} else {// not initialised yet}
Cheers ears
by RICKYJ
Wed Apr 04, 2007 1:46 pm
Forum: PHP - Code
Topic: php, how to catch if a variable is never sent (post or get)
Replies: 4
Views: 458

wow you're fast, looking into it on the php manual now, thanks
by RICKYJ
Wed Apr 04, 2007 1:31 pm
Forum: PHP - Code
Topic: php, how to catch if a variable is never sent (post or get)
Replies: 4
Views: 458

php, how to catch if a variable is never sent (post or get)

Hi, I'm running into something that seems quite trivial. I'm primarily a java programmer, but am creating a web site that has a bit of php code. The problem is, I have created a search page in php that querries a db, and returns to self with the results. One of the problems im having is that if a us...
by RICKYJ
Mon Nov 20, 2006 8:26 am
Forum: PHP - Code
Topic: php after the page has loaded (post load php)
Replies: 13
Views: 761

anyone know if this is the method that i should be using in javascript? <BODY onLoad="javascript:sndReq()" > <script type="text/javascript" src="JSsource.js"></script> or should it be something like <BODY onLoad="javascript:sndReq()" type="text/javascript...
by RICKYJ
Mon Nov 20, 2006 7:09 am
Forum: PHP - Code
Topic: php after the page has loaded (post load php)
Replies: 13
Views: 761

works, but is it updating once the page is loaded (its hard to tell as my broadband is too fast, obvioulsy not everyones will be) this litle bit here: <BODY onLoad="javascript:sndReq()" > <script type="text/javascript" src="JSsource.js"></script> Does this run as on loa...
by RICKYJ
Mon Nov 20, 2006 6:46 am
Forum: PHP - Code
Topic: php after the page has loaded (post load php)
Replies: 13
Views: 761

almost there I think: Saved in the local file as JSsource.js: function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ro = new XMLHttpRequest();} return ro; } var ht...
by RICKYJ
Mon Nov 20, 2006 6:28 am
Forum: PHP - Code
Topic: php after the page has loaded (post load php)
Replies: 13
Views: 761

It doesnt download for each client, the php checks the modifaction of the local files (TempRssFeed) and only downloads if more than 7hrs old, or different day.

Still havent got it to work yet, but figuring it out
by RICKYJ
Tue Nov 07, 2006 3:33 pm
Forum: PHP - Code
Topic: php after the page has loaded (post load php)
Replies: 13
Views: 761

ok, Ive been reading a bit on ajax. It seems to run javascript like the onload function (once the page is loaded), but can you use javascript to call up a php function.

php is calculated before it reaches the browser, so im wondering if this is possible at all
by RICKYJ
Tue Nov 07, 2006 11:56 am
Forum: PHP - Code
Topic: php after the page has loaded (post load php)
Replies: 13
Views: 761

I have come across ajax, no idea what it is, Ill have a look at that link, thanks
by RICKYJ
Tue Nov 07, 2006 10:48 am
Forum: PHP - Code
Topic: php after the page has loaded (post load php)
Replies: 13
Views: 761

php after the page has loaded (post load php)

Is there a way of getting a page to do the php comand after the rest of the page has loaded and been diplayed. I have found refrenced to iframe and DHTML, but im not sure how to do this yet. Basicaly I have a stock ticker that downloads RSS feed to a local folder, this takes quite a while, how ever ...
by RICKYJ
Mon Nov 06, 2006 8:24 am
Forum: PHP - Code
Topic: php to check age of a file
Replies: 3
Views: 339

Thanks JAY that helped :D possibly unix, but mtime seemed to work for me I used : if ( (date('h') - date('h', filemtime("TempRSSFeed.txt")) ) > x) { // then do code all seems to work, obviously this wont work very well if ppl only use it once every 24hrs (difference will be 0), but expect ...
by RICKYJ
Mon Nov 06, 2006 6:47 am
Forum: PHP - Code
Topic: copying RSS feed / XML to local server (cloning to local)
Replies: 4
Views: 602

yes it all works now, thank you. My only problem is that its a bit slow, but Im playing around with it so it doesnt need to download the data every time the page is viewed. thanks for your help, I was completely new to php until last week and would have been stuck without your help Ill offer the sof...
by RICKYJ
Mon Nov 06, 2006 6:43 am
Forum: PHP - Code
Topic: php to check age of a file
Replies: 3
Views: 339

php to check age of a file

does anyone know how i can use php to check the age of a file

I have simple bit of code that downloads rss feed to my local host, but I only want it to run if
1. the downloaded file doesnt exist
2. the downloaded file is more than say 2 hours old
by RICKYJ
Sun Nov 05, 2006 11:16 am
Forum: PHP - Code
Topic: copying RSS feed / XML to local server (cloning to local)
Replies: 4
Views: 602

thanks, I had to use a small modification sice Im using php5: <?php function file_put_contents_php4 ($location, $whattowrite) { if (file_exists($location)) { unlink($location); } $fileHandler = fopen ($location, "w"); fwrite ($fileHandler, $whattowrite); fclose ($fileHandler); } echo file_...
by RICKYJ
Sun Nov 05, 2006 9:34 am
Forum: PHP - Code
Topic: copying RSS feed / XML to local server (cloning to local)
Replies: 4
Views: 602

copying RSS feed / XML to local server (cloning to local)

Hi there, Im very new to php, but have figured out it may be the solution to my problem I have created a java application that grabs RSS feed from a file, (say yahoo news) then displays it as a ticker (this works client side). The problem is that java applets arent allowed to read from non local fil...