[PHP] How do I produce a random database query for each day or week?
Hi, My brain is working very slowly this morning (maybe that is because of having 5hrs sleep...) Could someone help me with this problem. I would like to show a different CD with information on it, on the home page each week- a kind of 'recording of the week' and I would also like to have on the same page something that changes every day. The recordings are in a MYSQL database and I would like all of them (there are 29 at present) to be shown over how ever long it would take to get through them (in this case 29 weeks) and then once they have all been shown this would then repeat. I would like them to be shown in a random order and make sure that the recording hasn't been shown within the 29. The same goes for the other project which uses a mysql database which I would like to rotate daily (in this case there are 103 items) Obviously if I use PHP random functions this will always return a random number, but how do I produce a random number which relates to the day or week of the year? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple POP3 mailbox checker script
Hi all, Is there are a simple way of checking quickly using PHP: 1) How many email messages on a POP3 mailbox 2) How many new email messages on a POP3 mailbox 3) The amount of memory in Kb or Mb used up on the POP3 mail box I want to be able to show these on our customer control panel. Also I want to use cron and a php script to be able to regularly check our customers haven't exceeded their mail quota. At the moment we don't have our own server and use a multiweb hosting account. Many thanks, I. Gray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple POP3 mailbox checker script
Jason Wong said [With your posting style you successfully torpedoed this useful feature; your posting shows up within an existing thread it has nothing to do with.] Sorry- I didn't realise this happened. Why can't things be easy in life? I have posted this again as a new message. Hope you will all forgive me... = Hi all, Is there are a simple way of checking quickly using PHP: 1) How many email messages on a POP3 mailbox 2) How many new email messages on a POP3 mailbox 3) The amount of memory in Kb or Mb used up on the POP3 mail box I want to be able to show these on our customer control panel. Also I want to use cron and a php script to be able to regularly check our customers haven't exceeded their mail quota. At the moment we don't have our own server and use a multiweb hosting account. Many thanks, I. Gray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Simple POP3 mailbox checker script
Thanks- I will take a look. But (sigh) my hosting company doesn't have PEAR. Sob, sob... -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: 14 July 2004 14:39 To: [EMAIL PROTECTED] Subject: [PHP] Re: Simple POP3 mailbox checker script Hi all, Is there are a simple way of checking quickly using PHP: 1) How many email messages on a POP3 mailbox 2) How many new email messages on a POP3 mailbox 3) The amount of memory in Kb or Mb used up on the POP3 mail box I want to be able to show these on our customer control panel. Also I want to use cron and a php script to be able to regularly check our customers haven't exceeded their mail quota. At the moment we don't have our own server and use a multiweb hosting account. Many thanks, I. Gray Take a look at PEAR's Net_POP3 package: http://pear.php.net/package/Net_POP3 Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] get_browser and $_SERVER info from an IFRAME
Hi, I have a php webstats script that puts info into a MYSQL database. I include it at the top of each page that I have. I recently put a php built forum (PHPBB) on our website and wanted to include the php script at the top of that. Unfortunately as it already uses sessions, I kept on getting 'headers already sent' error messages for obvious reasons- I was using sessions and so was PHPBB. I thought a good way round this would be to have an IFRAME on each of the forum pages where the IFRAME would be the PHP webstats page. The only problem with this is that it logs the information of the IFRAME and not the main page. I use get_browser and $_SERVER to log things such as the IP address, browser, os, and work out the country and the name of the page being looked at. $browser = get_browser(); $parenty = $browser-parent; $browsery = $browser-platform; $crawlery = $browser-crawler; $cookiesy = $browser-cookies; $pathy = $_SERVER['REQUEST_URI']; $ipy = $_SERVER['REMOTE_ADDR']; $hosty = gethostbyaddr($_SERVER['REMOTE_ADDR']); All these will return details for the IFRAME. How do i get details of the main page? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Web Mail
Hi everyone, I use UebiMiau for our web mail service, but to be honest I haven't been particularly happy with it. It's ok, but what I find frustrating is that if our customers click the back button on their browser it always gives the 'this page has expired' message. I assume it is using sessions, but still- does this message always have to be displayed? It always seems to log you out quite easilly. Web mail services such as hotmail or yahoo don't do this. Does anyone know a good PHP-based (free if possible) web mail other than UebiMiau that they would recommend? Best wishes, Ian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Web Mail
Thanks- looked at Squirrel Mail. Looks really good, however we use POP3- I don't think Squirrel Mail uses POP3 does it? -Original Message- From: Jose Leon [mailto:[EMAIL PROTECTED] Sent: 05 July 2004 12:09 To: I.A. Gray Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP Web Mail Hello, Does anyone know a good PHP-based (free if possible) web mail other than UebiMiau that they would recommend? Why not Squirrel Mail? http://www.squirrelmail.org Regards. -- qadram :: software development http://www.qadram.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP Web Mail
Hi all, Thanks for all your info. The hosting company I use gives us POP3 accounts. To be honest I don't have a clue about IMAP- I've only heard the name, and don't understand the way it works. I assume because we only have POP3 accounts, we have to use a POP3 webmail service. We want all our customers to be able to have a webmail service so that they can check their POP3 accounts from any computer round the world. And, of course it has to be in PHP- what other language is there? Thanks again, Ian -Original Message- From: John Hicks [mailto:[EMAIL PROTECTED] Sent: 05 July 2004 18:01 To: I.A. Gray; Jose Leon; [EMAIL PROTECTED] Subject: Re: [PHP] PHP Web Mail On Monday 05 July 2004 07:33 am, I.A. Gray wrote: Thanks- looked at Squirrel Mail. Looks really good, however we use POP3- I don't think Squirrel Mail uses POP3 does it? Most if not all web-based mail clients use IMAP since a web-based (i.e. browser-based) client can't store the received mail on the local computer the way a POP3-based email client does. Besides, the whole reason for using a web-based client is to be able to log in from various computers. Why would you not want to store the mail back on the server the way IMAP does. POP3 delivers the mail to the client and then drops it. --John -Original Message- From: Jose Leon [mailto:[EMAIL PROTECTED] Sent: 05 July 2004 12:09 To: I.A. Gray Cc: [EMAIL PROTECTED] Subject: Re: [PHP] PHP Web Mail Hello, Does anyone know a good PHP-based (free if possible) web mail other than UebiMiau that they would recommend? Why not Squirrel Mail? http://www.squirrelmail.org Regards. -- qadram :: software development http://www.qadram.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting query string from referer website
Hi all, When I use the $_SERVER to get a query string it doesn't ever seem to return me anything: $queryy = $_SERVER['QUERY_STRING']; In my webstats script, 790 are blank and 2 give the value of loc=uk and currentID=6 - not very satisfactuary! Why is this happening? Could I get the search string from the referer web site? It sounds like a bit of a faff, but is this what I have to do? Say a referer website is http://www.google.co.uk/search?q=web+design+for+performersie=UTF-8hl=enme ta= is there a good way of getting the query string web design for performers ? for Yahoo it is different: http://search.yahoo.com/search?p=biography+examplesei=UTF-8fr=fp-tab-web-t n=20fl=0x=wrt the search string is followed by p= I'd like to list the top ten search keywords and the top ten search phrases. Any ideas? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting query string from referer website
Hi all, When I use the $_SERVER to get a query string it doesn't ever seem to return me anything: $queryy = $_SERVER['QUERY_STRING']; In my webstats script, 790 are blank and 2 give the value of loc=uk and currentID=6 - not very satisfactuary! Why is this happening? Could I get the search string from the referer web site? It sounds like a bit of a faff, but is this what I have to do? Say a referer website is http://www.google.co.uk/search?q=web+design+for+performersie=UTF-8hl=enme ta= is there a good way of getting the query string web design for performers ? for Yahoo it is different: http://search.yahoo.com/search?p=biography+examplesei=UTF-8fr=fp-tab-web-t n=20fl=0x=wrt the search string is followed by p= I'd like to list the top ten search keywords and the top ten search phrases. Any ideas? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: getting query string from referer website
Thanks- didn't realise that $_SERVER['QUERY_STRING'] was the query string for the actual page. In that case what is the easiest way to extract the search string from the referer web site? I would like to add this string to the MYSQL database. -Original Message- From: Aidan Lister [mailto:[EMAIL PROTECTED] Sent: 28 June 2004 11:47 To: [EMAIL PROTECTED] Subject: [PHP] Re: getting query string from referer website $_SERVER['QUERY_STRING'] has nothing to do with the refering website. foo.php?bar=6 The QUERY_STRING for the above example is: bar=6 When someone visits your page, they visit foo.php (for example), thus your QUERY_STRING will always be blank. I believe you're looking for HTTP_REFERER I.A. Gray [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, When I use the $_SERVER to get a query string it doesn't ever seem to return me anything: $queryy = $_SERVER['QUERY_STRING']; In my webstats script, 790 are blank and 2 give the value of loc=uk and currentID=6 - not very satisfactuary! Why is this happening? Could I get the search string from the referer web site? It sounds like a bit of a faff, but is this what I have to do? Say a referer website is http://www.google.co.uk/search?q=web+design+for+performersie=UTF-8hl=enme ta= is there a good way of getting the query string web design for performers ? for Yahoo it is different: http://search.yahoo.com/search?p=biography+examplesei=UTF-8fr=fp-tab-web-t n=20fl=0x=wrt the search string is followed by p= I'd like to list the top ten search keywords and the top ten search phrases. Any ideas? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: getting query string from referer website
I think I managed to do it myself- ?php $referer = http://search.yahoo.com/search?p=pianist+web+sites+designei=UTF-8fr=fp-ta b-web-tcop=msstab=; if (strpos($referer, q=) != FALSE) { $query = q=;} else if (strpos($referer, p=) != FALSE) { $query = p=;} $searcharray = explode(, substr($referer, (strpos($referer, $query)+2))); $searchstring = urldecode($searcharray[0]); echo Your search words are: $searchstringbr /br /; ? Hurrah! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Running a PHP script on an automated regular schedule
Hi. I am wanting to use a PHP script to check on an hourly/daily basis on a few things- ie links on my sites, whether the sites are up and running and also to send an e-mail to me. I know how to do this using PHP but my problem is how to have this running 24/7. I can't really have this on a web page as wouldn't it time out? I don't have my own server and so use a hosting company. Is there a way of running a PHP script on a regular basis (say every 10 or 30 mins, or hourly or daily)? Would I have to set up my own server to do this? I just the simplest way of acheiving this. Any ideas? Does anyone know of any decent link checkers written in PHP that I could implement? Many thanks, Ian Gray
[PHP] Changing variable names in a while loop
Hi all, Easy question (I hope). My brain seems not be working today, so could someone help me with this one? I have a while loop outputting part of an html form which inputs track information for CDs: $countything = 1; while ($countything !=31) { echo tr td$countything./td tdinput name='fcomposer$countything' type='text' id='fcomposer$countything' size='20' maxlength='60'//td tdinput name='fsubheading$countything' type='text' id='fsubheading$countything' size='20' maxlength='80' //td tdinput name='fmovementno$countything' type='text' id='fmovementno$countything' size='3' maxlength='3' //td tdinput name='ftracktitle$countything' type='text' id='ftracktitle$countything' size='20' maxlength='60' //td tdinput name='ftracksubtitle$countything' type='text' id='ftracksubtitle$countything' size='20' maxlength='80' //td tdinput name='ftracklength$countything' type='text' id='ftracklength$countything' size='5' maxlength='8' //td tdinput name='fextrainfo$countything' type='text' id='fextrainfo$countything' size='20' maxlength='80' //td /tr\n; $countything++; } How can I get the value to change in each form? The name and id for each input field will change from (for example) fcomposer1 to fcomposer30 but how do I change the value for each input to show the variables taken from the database which will be $composer1 to $composer30 ? Obviously if I put in $composer$countything that will just output the value of $composer followed by the value for $countything, but I want it to output the value for $composer1 if $countything=1 or $composer10 if $countything=10 . Is there something I can do with variable variables? I couldn't see any examples in the PHP manual. Many thanks, Ian Gray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Changing variable names in a while loop
Thanks, Torsten. That clears things up quite a bit. I do find the PHP manual a little heavy going sometimes. Does this mean then that I have to do this: $tempcomposer = 'composer' . $countything; $tempsubheading = 'subheading' . $countything; $tempmovementno = 'movementno' . $countything; etc... as I have about 8 variables to change? Best wishes, Ian Gray -Original Message- From: Torsten Roehr [mailto:[EMAIL PROTECTED] Sent: 28 May 2004 12:30 To: [EMAIL PROTECTED] Subject: [PHP] Re: Changing variable names in a while loop I.A. Gray [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all, Easy question (I hope). My brain seems not be working today, so could someone help me with this one? I have a while loop outputting part of an html form which inputs track information for CDs: $countything = 1; while ($countything !=31) { echo tr td$countything./td tdinput name='fcomposer$countything' type='text' id='fcomposer$countything' size='20' maxlength='60'//td tdinput name='fsubheading$countything' type='text' id='fsubheading$countything' size='20' maxlength='80' //td tdinput name='fmovementno$countything' type='text' id='fmovementno$countything' size='3' maxlength='3' //td tdinput name='ftracktitle$countything' type='text' id='ftracktitle$countything' size='20' maxlength='60' //td tdinput name='ftracksubtitle$countything' type='text' id='ftracksubtitle$countything' size='20' maxlength='80' //td tdinput name='ftracklength$countything' type='text' id='ftracklength$countything' size='5' maxlength='8' //td tdinput name='fextrainfo$countything' type='text' id='fextrainfo$countything' size='20' maxlength='80' //td /tr\n; $countything++; } How can I get the value to change in each form? The name and id for each input field will change from (for example) fcomposer1 to fcomposer30 but how do I change the value for each input to show the variables taken from the database which will be $composer1 to $composer30 ? Obviously if I put in $composer$countything that will just output the value of $composer followed by the value for $countything, but I want it to output the value for $composer1 if $countything=1 or $composer10 if $countything=10 . Is there something I can do with variable variables? I couldn't see any examples in the PHP manual. What you want is this: $temp = 'composer' . $countything; Then use ${$temp} - it will efectively be $composer1. Take a look here: http://de2.php.net/manual/en/language.variables.variable.php Regards, Torsten Roehr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Finding Screen Size
Hello. I know it's easy to find the screen res of a user from javascript- but I want to let my PHP script know what the resolution is. Is this possible? I would like the easiest way possible- I'd rather not resort to sessions/cookies. Is there a way to make a variable available to PHP? I find the get_browser function really useful for the browser info but it doesn't tell me the res. many thanks, Ian Gray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_GET, expressions and conditional statements
Hi everyone, I know this is probably really simple, but I am not very good at expressions and conditional statements. I am wanting to show a list from a MYSQL database. I am using the URL to store the variables that control the output. The variable $ORDER can be set to ASC (Ascending), DESC (Descending and RAND (Random). What I want the script to do is set $SPORDER to this value. If $_GET['ORDER'] is not set then it gets the default value (ASC), if this is any other than ASC, DESC or RAND (ie. someone has messed with the variables in the URL) then it also gets the default (ASC). Finally if $_GET['ORDER'] is set to RAND then I want $SPORDER to equal RAND() so that I can use the value in the SQL query. Here is part of the script: ?php if (!isset($_GET['ORDER'])) { // Checks if the 'ORDER' variable from the URL is set. If it is NOT set the following happens... $SPORDER = ASC; // The variable $SPORDER is given the value ASC, since ASC (Ascending Order) is the default value. } else { // The following happens if the 'ORDER' variable IS set... $SPORDER = $_GET['ORDER']; // The variable $SPORDER is given the value of the variable 'ORDER' taken from the URL. if ( (($SPORDER !== ASC) ($SPORDER !== DESC)) ($SPORDER !== RAND)) { // If the variable $SPORDER does NOT have the value of either ASC (Ascending), DESC (Descending) or RAND (Random) then the following happens... $SPORDER == ASC; // The variable $SPORDER is given the default value ASC } else { // If the variable $SPORDER DOES have the value of either ASC, DESC or RAND then the following happens... if ($SPORDER == RAND) { // If $SPORDER has the following of RAND (Random Order) then... $SPORDER == RAND(); // $SPORDER is given the value RAND() which is the correct value for submission to the MYSQL query. } } } // End of the Conditional Statements regarding the ORDER variable. ? I think the problem part could be: if ( (($SPORDER !== ASC) ($SPORDER !== DESC)) ($SPORDER !== RAND)) I am trying to say if $SPORDER does not equal ASC, DESC or RAND then do the following. There maybe other problems in my code as well that are not making this work. I would be grateful if you could shed some light on it! Best wishes, Ian Gray -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php