[PHP] Re: Can't Pass variable to other page
Jack wrote: Dear all I had write a script like this : $link = "page.php?day=$day&month=$month&year=$year"; when i click on the link, it should pass the parameter to "page.php" with $month and $year variables. It actually works fine in php4.2.1, but when i went to other office which got php5.0 above installed, using the same script, but it won't pass any parameters to page.php! How come? I heard there is something to set in the php5.0's php.ini before i can do so, is that right? Please could anyone give me a hand on this? IIRC, a default installation does not automatically make global variable ou of GET parameters. try: '; echo $_GET['month'].''; echo $_GET['year'].''; ?> I think it's called GPC in the php config file. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Determine OS and Java Ver
Alexandru-Vlad Badut wrote: Hya, Can someone give me a hand on how to determine if the client (the visitor) is java & java enabled and the os he's using in php? couldn't you just get the Java to request a PHP file with it's version as a GET parameter? that, along with the IP address, should tell you which browser is doing the reading (except behind large firewalls...), and allow you to set a variable in your database, or however you're doing it. the OS is usually included in the browser identification string. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Restricted access
Ciprian Trofin wrote: Hi All, I want to give access to resources (PDFs and some RTFs) only to registered users and I also want to deny that kind of access to people that "guess" the URL. I guess it is all about putting these files outside the web-tree and somehow putting PHP to work. Could you enlighten me ? :)) http://php.net/fpassthru is the answer to the web-tree problem. The authentication is a different matter. I have my own method - I'm sure others have other/better methods. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: searching date
[EMAIL PROTECTED] wrote: Hi , The user have to choose 2 date ($date_begin & $date_last) and i want to know howcan i make to find field in mysql where field included between ($date_begin & $date_last) "SELECT * FROM `news` WHERE `date` included in ($date_begin & $date_last)" $q=mysql_query('select * from news where `date` >= "'.$date_begin.'" and `date` < "'.$date_last.'" + interval 1 day'); you should rename the field you have called `date` - it's ambiguous. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: LAMP > I need a good tutorial on how to install and configureGD2
Matt Babineau wrote: Anyone have a good place to help with this... Google was seeming a bit light on good help. I tried to get it going but there seemed to be some dependant libraries tha tI could not build myself, they were erroring out..blah blah. Is there any easier way to do this? Thanks, Matt try rpm, or even better, apt-get (http://apt-rpm.tuxfamily.org, I think) - simply install, and type "apt-get update && apt-get install gd2" Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to Select
John Taylor-Johnston wrote: Ok, this is a basic MySQL question, but I don't know how to code it in PHP. I want to check in StudentId. If it exists, ... Anyone good humoured who would help me fill in the blank. Like I should know this, but haven't even thought of coding SQL in a while :) $myconnection = mysql_connect($server,$user,$pass); mysql_select_db($db,$myconnection); $news = mysql_query("select StudentId $table"); while ($mydata = mysql_fetch_object($news)) { } if exists {do this}else{do that} if(mysql_num_rows(mysql_query('select * from "'.$table.'" where StudentId="'.$studentid.'"')){ // do this }else{ // do that } Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: regex problem
Merlin wrote: Hi there, I have a regex problem. Basicly I do not want to match: /dir/test/contact.html But I do want to match: /test/contact.html I tryed this one: ^[!dir]/(.*)/contact(.*).html$ but it does not work and I tryed thousands of other ways plus read tutorials. Can anybody please help? ^\/test\/contact.html$ Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: images with gd for printing?
Merlin wrote: Hi there, I want to create images with GD and freetype ttf which are good enough for printing .. about 150 dpi. Does anybody know how to output the jpg with a higher resolution and a determined output size? Thanx in advance, merlin output an image with dimensions, say, 320x200, but in the HTML, write it as Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: regex problem
Merlin wrote: ^\/test\/contact.html$ does not work. I am sorry, I just found that it has to be: test/contact.html and not dir/test/contact.html there is no leading slash. Do you have any other suggestion? *sigh* ^test\/contact.html$ Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: regex problem
Jay Blanchard wrote: if($string == 'test/contact.html') it could be if($string == "test/contact.html") not to start a flame war or anything, but isn't the apostrophe version quicker, as it doesn't ask the server to parse the string? Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: regex problem
Merlin wrote: ufff.. sorry guys, but I have to explain that better. I appreciate your help, maybe I did not give enough info. I am trying to redirect with apache modrewrite. To do this you have to use regex (not if functions:-) My problem is, that there are member accounts which look like that: membername/contact.html and there are partner accounts which look like this: partner/name/contact.html The goal is to redirect only if it is a member account. If I put a (.*)/contact.html it also matches the partner/ I tryed putting a root / infront, but there is not / root for the url from apaches point of view. So I would need a regex which will match the member account, but if the first word is "partner" it should not terminate. This seems to be a tough one! ah - maybe a chain of rewrites would do? send all matches of /^partner\/(.*)\/contact.html$/ to partner\/\1\/blah send all matches of /^(.*)\/contact.html$/ to NEWLOCATION send all matches of /^partner\/(.*)\/blah$/ to partner\/\1\/contact.html Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help with parse error
James Johnson wrote: Hi, I'm trying to figure out this error I'm getting in my code: Parse error: parse error in /home/.paco/campuscb/AdPayment.php on line 9 This is the code on line 9: $sDate = date('Y-m-d',time()); if you're looking for the current time, then this is sufficient: $sDate=date('Y-m-d'); the error is most likely on a line above that one. I've never seen date() called in the way you did, though - the documentation (http://php.net/date) says that time() is the default for the second parameter, so is never actually needed. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Checking for Javascript funcionality
Hecchan wrote: I do something similar to this at http://contactjuggling.org/ if the server thinkks JavaScript is set, then it uses the above to make sure. Otherwise, it puts this in the header: document.location="/?s=1" Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: math functions?
Amanda McComb wrote: I am having trouble finding math functions on php.net. I am also getting "page not found" errors when trying to search. Basically, I'm looking for a mod or division function - something I can use to tell me when a number is evening divisable by a certain number. % is the mod operator in quite a few languages, and works in PHP as well. if(7%4), for example, will return true (3), while (12%6) will return false integers only, IIRC Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Image Magick
Mike At Spy wrote: Anyone here familiar with the installation of Image Magick and what files it installs on your machine? I had an admin put it on, and then took it off - but took it off by removing what she thought were all of the files related to it. I just found some files I think that are. They are located in the usr/local/bin directory and are called: animate composite convert display identify mogrify montage The date/time of the files being put there seems to correspond with when the admin put the program on, and names of the files seem to imply it to me. And I just wanted to make sure I'm not going to screw up something else by removing them. :) Thanks! the easiest way to remove them is to use RPM, if that was what was used to install them rpm -e ImageMagick if there are no dependency problems, then it will go ahead. make sure that you don't have any libraries that use it! I use ImageMagick in a PHP image-upload function that resizes to a maximum size. The RPM program would not tell you of that dependency. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date() doesn't return system date?
when I type "date" in a console on my server, it returns a different time than that returned by date() or gmdate() - any idea why? -- Kae Verens http://www.contactjuggling.org/users/kverens/ http://www.contactjuggling.org/ (webmaster) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() doesn't return system date?
adi wrote: > incorect sintax maybe I wasn't precise enough: when I place date("h:i a") in a page on my server, and view it in a browser, I am returned: "02:51 pm". According to the server itself, though (logged in through ssh), using "date", it is 3:51. gmdate("h:i a") returns the same 2:51 time. They are both one hour off from the server time. >>when I type "date" in a console on my server, it returns a different >>time than that returned by date() or gmdate() - any idea why? -- Kae Verens http://www.contactjuggling.org/users/kverens/ http://www.contactjuggling.org/ (webmaster) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date problem
when I place date("h:i a") in a page on my server, and view it in a browser, I am returned: "02:51 pm". According to the server itself, though (logged in through ssh), using "date", it is 3:51. gmdate("h:i a") returns the same 2:51 time. They are both one hour off from the server time. Any ideas of a solution to this? Anyone have a ready-to-use function which can add/subtract an hour or two to/from the date/time? -- Kae Verens http://www.contactjuggling.org/users/kverens/ http://www.contactjuggling.org/ (webmaster) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: parsing domains
Collegesucks.Com Mike wrote: Quick question... I parse domains in my scripts like this to get the .domain.com out of www.domain.com. However, if someone visits my site with just domain.com in the url, I get .com back as the parsed domain. How can I make it so I aways get the .domain.com no matter what they use? Here is an example of what I use now... $parseddomain = preg_replace('/.+?(\..+)/', '$1', $domain); this should do it: $parseddomain=preg_replace('/.*?([^.]*\.[^.]*)/','\\1',$domain); Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: converting gif to jpeg
Merlin wrote: Hello, I am wondering if it is possible and legal to convert gif to jpeg with php. This would be helpful for clients to upload their logo, since most have it as a gif document. Thanx for any comment on that. ImageMagick can read .gif, so you could filter the uploaded file through that and convert it to .jpg. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: GD & PHP
Mike At Spy wrote: Is there anything special I have to do to enable GD when using PHP 4.3.2? I'm getting an error of: Fatal error: Call to undefined function: imagecreatefromjpeg() in /home/sites/site37/web/photos/functions.php on line 594 When I use the imagecreatefromjpeg() function. Is it not usable with gd? Should I be using imagecreatefromgd()? not sure about this, but did you install PHP from source with --with-gd specified? if not, was PHP installed with an RPM? if so, try uninstalling, then reinstalling it. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: register globals question
Merlin wrote: Hello, I am wondering if an application written to work with register globals set to off ($_GET[variable] etc.) would work with a system, where register globals is set to on? yes. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Best Approach for Multiple Options
Ralph Guzman wrote: The second approach is to store amenities as a text delimited string for each property in the facilities table. So if a certain property has a pool, fireplace and fitness center, I would have 'pool|fireplace|fitness' in the amenities field. I can then use PHP to explode or create an array so that I can manipulate the string. Anybody have any thoughts or advice on this? my first thought is that it's not necessary to explode with PHP. this will return true for something like 'pool|fireplace|fitness' mysql_query('select id from theTable where amenities like "%pool%"') you could make it more efficient by using boolean logic: if 1=pool,2=fireplace,4=fitness, then 3=fireplace+pool, 5=fitness+pool, 7=fitness+fireplace+pool just thoughts. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem Coding a Tutorial
Stephen Tiano wrote: if ($submit == "Sign!") if($_POST['submit']=='Sign!') { $query = "insert into guest_info (name,location,email,url,comments) values <'$name', '$location', '$email', '$url', '$comments')" ('$_POST[name]','$_POST[location]','$_POST[email]','$_POST[url]','$_POST[comments]')" If the form's info isn't making it to the table, I'm thinking I need $_POST statements--as in $_POST["name"], $_POST["location"], etc.--somewhere to get each field's info into the table. But where do I put those lines and in which file: "create_entry.php" or "sign.php"? try echoing out what you think should be at different points in the file - "echo $_POST['submit'];" before the if statement, for example. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem Coding a Tutorial
Stephen Tiano wrote: Kae, Excuse my being dense, but I just want to get your meaning with the lines you added. You're saying to substitute if($_POST['submit']=='Sign!') for if ($submit == "Sign!") and to try ('$_POST[name]', ... (and not $_POST['name'])? in your code, the first variable was $submit. The $_POST version of this is $_POST['submit']. the second set of variables was /already within quotes/, therefore the quotes around the variable name should be left out. the best way to write quoted variables is probably to exit quote mode first, but I thought that might be too confusing for just a little code. For example: echo '$submit = '.$_POST['submit']; instead of: echo "\$submit = $_POST[submit]"; I hope that helps clarify it a bit. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Mail() question
Ryan A wrote: Hi everyone, I am trying to create a new newsletter software as the ones i found on hotscripts were just not good enough or mucho $$ which i dont have :-( Have finished the basics but need some advise now. I am using a mysql database instead of text files. I have a table with the fields "name" and "email", my questions are, 1:is it better to use a for loop and then send each mail? 2:should i first put all the names and addresses into an array? 3:Is it better to send each mail independantly or use BCC? (one mail blast., will it work?) For short lists of emails, yes, it should be fine to send them in one go (one after the other). However, it takes time to send an email, and you are usually allowed only about 30 seconds of CPU time for your script. How I do it is to make a file listing the ids of the users, and the ids of the emails they're to receive, then I have a cron job which sends out one a minute. For heavier loads, you could add another cron job to get two a minute, and so on. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail function
Deependra B. Tandukar wrote: Dear all, Recently installed PHP in my Linux server. It says, mail function is not enabled? How is turn this on? mail is handled by the server's smtp program. In Linux, this is sendmail, and should be installed by default. Haven't a clue about Windows (I don't do windows). check for SMTP on the server (assuming Linux) by using the mail command in the console to send yourself a test email ("man mail" for help) Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Do you really still pay for bandwidth?
Dougd wrote: Do you really still pay for bandwidth? I do. And that makes me very aware of bulky HTML and unnecessary images, which I believe improves my work by forcing me to be efficient. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Dynamic Drill down menus
Dan J. Rychlik wrote: Hello, I have created a db that holds specific information ie a business name. I am running into a problem on a form when you choose the business name another list is suppossed to populate the address or addresses, if multiple occur, and you can select the address. I am not able to sucessfully pull off this dynamic drill down list in my form because I do not know how to check data from a form field that hasnt been posted through $POST VARS array. My question is, is their a way to do this in PHP? Do I have to learn javascript in order to accomplish this task or will I have to have a submit button for each form element? Thanks in advance, Daniel I'm not sure if this will help, you, but I have a simple JavaScript application which may help. You would simply put your options in nested s, then put this in the of your page: http://kverens.contactjuggling.org/j/cm.js";> Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Quite a basic question
MÃrio Gamito wrote: > Hi, > > This is quite a very basic question, but i think the code following my > signature should work. > Instead, i get a > "Warning: Cannot modify header information - headers already sent by > (output started at /home/vhosts/dte/cv/register_action.php:10) in > /home/vhosts/dte/cv/register_action.php on line 12" > > and no redirection :( > > How can i solve this ? > Any help would be apreciated. > > Warm Regards, > MÃrio Gamito > > >$hostname = gethostbyaddr($_SERVER['REMOTE_ADDR']); >$sub_domain = explode (".", $hostname); >if ($sub_domain[1] != 'dte') { > echo" > > window.open (\"<a href="http://www.google.com\"">http://www.google.com\"</a>;, \"mywindow\", \"status=1, > toolbar=0, resizable=0, > width=200, height=200\"); > "; > } > header("Location: http://www.dte.ua.pt/cv/";); the answer is in the question. You cannot send the header() function, as you have already output some text to the browser. Move the header() call above the echo call, and it should work. btw: you should have at least "" for any HTML document. -- kae verens http://verens.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: using lists in php and sending
Ross Hulford wrote: > I have a list in php where the user can select 1 or more (rooms book in a > b&b). The following code is part of the form. > > > Single > Standard > Single > EnSuite > Double > EnSuite > Twin En > Suite > Family > Standard > Family > EnSuite > Tripple > EnSuite > > > > And then I send using the mail() functin in PHP using the following code > but the selected rooms do not display. I know it must be an array of sorts > please help!!! > > > msg .= "First Name: $firstname \n"; $msg .= "Second name: $surname \n"; > $msg .= "Email Address: $email \n"; $msg .= "Telephone: $telephone \n"; > $msg .= "Arrival Date: $arrival \n"; > $msg .= "Departure Date: $depart \n"; $msg .= "$adults Adults and > $kids Children will be staying \n"; > $msg .= "We will require the following rooms $rooms\n"; > $msg .= "Message: $addinfo \n"; > $msg .= "-\n\n"; you have no code written to build up $addinfo. first, let's optimise that HTML a bit: '.$a.''; ?> note the '[]' at the end of 'rooms[]'. that makes it an array. now, assuming you are sending as POST, the next bit builds up $addinfo: $arr=array(); foreach($_POST['rooms'] as $a=>$b)$arr[]=addslashes($a); $addinfo=(count($arr))? "Chosen Rooms:\n".join(',',$arr): 'No rooms chosen'; hope that's useful -- kae verens http://verens.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: how to get page count when uploading files
Jian Fu wrote: I really need help and after going through the help page, I don't know where I can post my question. When I upload a file (word or pdf), how can I know the page counts of that file immediately? Thank you, Jian http://ie.php.net/manual/en/function.pdf-get-pdi-value.php appears to have the answer for PDFs I don't know the answer for Word documents Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Frustrated trying to get help from your site
Richard Lynch wrote: In brief, to explain a snapshot in layman's terms: that's probably a bad idea. anyone that doesn't know what a snapshot is, probably shouldn't need to know - they are most likely working in a package-based environment (either Windows, or an RPM-based Linux), where it would be more beneficial to explain how they can upgrade their systems using packages. If you go down the route of explaining what a "snapshot" is, then you will find yourself being asked what "gcc" is, and where you can get it... Tim, you are better off asking one of your administrators for help. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: My apologies
Howard, Tim wrote: documentation on your site. When I find the solution to my problem, I will be sure to add comments to the appropriate page so that you will not have to endure the ranting of frustrated programmers. of course, you still haven't explained what the problem is, that you are having. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Most stable combination of AMP?
James Tu wrote: Hi: I'm trying to setup a dev environment using Apache, MySQL and PHP...to develop an application that will go to production. What is the most stable versions of the AMP components should I can install? The production environment will most likely live on a Linux machine. My dev environment will be on OS X. that's a religious question. some people advocate some distributions over others. Personally, I recommend Fedora - it's easy to install, and you can use "yum" and "yumex" (graphical yum) for package management. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: storing function names in db and running them as row is output?
blackwater dev wrote: First, the example I have is not the real situation, just an example so I don't want to get into why are you doing it like that, etc. Just want to see if it's possible. Basically, I want to store stuff in a text field in a db like this "johns name is ucfirst('john adams') ". When I cycle through that row for output in my php script, I want it to not see ucfirst as text but as the php function and run ithow is the possible? Thanks. use Smarty for that? http://smarty.php.net/crashcourse.php Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: web browser shows blank page when accessing *.php file
Anna Barnes wrote: [Tue Sep 19 15:53:57 2006] [error] PHP Fatal error: Maximum execution time of 60 seconds exceeded in /websites/ical/functions/ical_parser.php on line 494 Not quite sure where to go from here. "ical_parser" sounds like it is a function which sucks in information from other computers. if one of those computers is down, then your program will probably timeout while waiting for the information. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Fatal error: session_start(): Failed to initialize storage module
[EMAIL PROTECTED] wrote: Hi, "Fatal error: session_start(): Failed to initialize storage module in /home/vernoncompany.biz/includes/validations.php on line 2" validation.php: #1 possibly. or it could be a disk-space problem. what does your server's error_log say? Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Download files outside DocumentRoot Dir
Ramiro wrote: Hi, i'm trying to find a good solution to this problem. I want download files from a directory outside DocumentRoot. This files cannot be downloaded through direct url like http://site/test.zip. It must be downloaded after user login. I know i can do that using some functions like fread() + fopen() or readfile(), than i would echo file buffer to browser with correct headers. But, reading then dumping file to browser is a big problem to server. http://ie2.php.net/fpassthru Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Alternative to FCKeditor
John Taylor-Johnston wrote: Anyone know of a good alternative to FCKeditor? Or a decent file uploader? Even after paying for a little help, I get zip for FCK. I need another solution, another editor with an active forum or support, John try my KFM addon for FCKeditor (http://kfm.verens.com/) use the stable release for now, as the nightly release is being converted to use SQLite at the moment. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How would you do this ?
Jad madi wrote: I'm building an RSS aggregator so I'm trying to find out the best way to parse users account feeds equally so Lets say we have 20.000 user with average of 10 feeds in account so we have about 200.000 feed How would you schedule the parsing process to keep all accounts always updated without killing the server? NOTE: that some of the 200.000 feeds might be shared between more than one user this is just an idle thought, but could you base it on prime numbers? for instance, let's say you have 6 feeds which in the last week have generated (a=10, b=8, c=5, d=7, e=13, f=2) articles. order them by article amount descending in last week: e, a, b, d, c, f assign primes to them: e=1, a=2, b=3, d=5, c=7, f=11 let $i=1 every 6 hours, check feeds who's primes are divisible by $i, then add 1 to $i at the end of the week, recalculate the primes. in this example, the feed checks would be: monday(1,2,3,4) = (e), (e,a), (e,b), (e,a) tuesday (5,6,7,8) = (e,d), (e,a,b), (e,c), (e,a) wednesday (9,10,11,12) = (e,b), (e,a,d), (e,f), (e,a,b) thursday (13,14,15,16) = (e), (e,a,c), (e,b,d), (e,a) friday(17,18,19,20) = (e), (e,a,b), (e), (e,a,d) saturday (21,22,23,24) = (e,b,c), (e,a,f), (e), (e,a,b) sunday(25,26,27,28) = (e,d), (e,a), (e,a,b), (e,a,c) in this example, at most three out of six are being checked for at a time, but everything gets at least a chance. e had 13 articles, is checked 28 times a had 10 articles, is checked 14 times b had 8 articles, is checked 9 times d had 7 articles, is checked 5 times c had 5 articles, is checked 4 times f had 2 articles, is checked 2 times Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How would you do this ?
Kae Verens wrote: every 6 hours, check feeds who's primes are divisible by $i, then add 1 to $i of course, this should be "check feeds where $i%(the prime) is 0" Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] manage/modify linux file/folder structure...
bruce wrote: i should state... while i've seen different apps... i'm more interested in any that have actually been used by you, or someone you know!! an app that comes with references! try this? http://kfm.verens.com/ I'm biased, though - I wrote the thing. Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: reading a remote directory
Jay Blanchard wrote: I have to read a directory (on a windows machine) from another box (a linux machine) and I thought that I could set the handle to the IP address of the windows box, but that does not work. Do I have to open a socket or is there another way? the directory must be explicitly shared by the Windows box. I'm really a Linux guy, but I think you do this by right-clicking on the folder icon and clicking "share...". then, make sure that the Windows machine's firewall allows Samba connections. then, mount the Samba share using Linux. (for more info, search for "linux samba mount") Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Various errors being generated from an apache/php combo
Steve Walker wrote: [client 80.58.205.38] PHP Fatal error: Call to undefined function: cleanupbynode() in /var/www/vhosts/demos.oneworldmarket.co.uk/httpdocs/gems/kernel/classes/ezco ntentobjecttreenode.php on line 2684 could be that the function cleanupbynode() is defined in the wrong place (ie; after it is actually needed) [client 80.58.205.38] PHP Warning: fopen(../configuration.php): failed to open stream: Permission denied in /var/www/vhosts/oneworldmarket.co.uk/httpdocs/demo_business/administrator/co mponents/com_config/admin.config.php on line 463 could be that configuration.php is saved using your oneworldmarket username instead of the httpd's username. What seems very odd is that with all these problems hitting refresh on the browser then takes you to the point the script would have ended up at if it hadn't errored... it might be that there is a redirect happening, so refreshing the page doesn't send data to the same location as before. just a few thoughts, Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Logical OR in assignment
Jason Karns wrote: I once saw the use of OR (|) in assignment. $x = $y | $z; Does this use bitwise OR? I'm trying to see if I could use the above expression in place of: $x = is_null($y) ? $z : $y; yes, '|' is bitwise OR, but that is /not/ a ternary operator. it's not safe to just replace the ternary operation with the bitwise operation. for example, if $y=5 and $z=9, then: $x=$y|$z; -> $x=13 $x=is_null($y)?$z:$y; -> $x=5 Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: want to create new format for fckeditor's combo box...
Bipul Dobhal wrote: Hi, How can i create my own formats for fckeditors combo box.. I found the line FCKConfig.FontFormats='p;dic'pre;address;h1;h2;h3;h4;h5;h6'; in fckconfig.js file. I think by setting my own format in this line may handle this problem because when I added any word or letter in this line like this FCKConfig.FontFormats='p;dic'pre;address;h1;h2;h3;h4;h5;h6;Temp'; it creates a new format in combo box with named "Undefined".. If i will get the source where these formats ('p;dic'pre;address;h1;h2;h3;h4;h5;h6' ) are defined then I will solve my problem. Can any one shed some light on where and how to define the formats so that it will be rendered on the fckeditor's format combo box..? Thanks, Bipul Dobhal that's a javascript question, and should be asked in FCKeditor's forums - see under Support at http://fckeditor.net/ Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Miserable escape string problem
[EMAIL PROTECTED] wrote: Using this string: "{$var1: $var2}" of course it doesn't work as some might expect. But why in the name of [whatever, too many to list] doesn't this one below work? "\{$var1: $var2}" If \ is an escape character why does it also appear in the string output? Why does the above \ escape {$var1 and not only the {? Miserable. because {$var1} is a valid syntactical construct? try this instead: '{'.$var1.': '.$var2.'}' Kae -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php