Re: [PHP] displaying information
Hello, if you use mysql as a database, see the function Limit For exemple: if ( !isset( $start ){ $start = 0; } $total = 10; // total amount to grab in database $sql = "SELECT * FROM my_table ORDER BY field Limit $start, $total"; $start += 10; // increment your start You display those fields, and you show a next link: Next But if you do not use mysql, I do not know... py Nick Davies wrote: > On Fri, 9 Mar 2001, Jason Stechschulte wrote: > > > On Thu, Mar 08, 2001 at 09:32:25PM -, george wrote: > > > I am building a site which pulls FAQ's out of the database onto a page,but > > > having just finished reading the FAQ's I realise that they will have to be > > > spread over a few pages, > > > how to I get the new page to take over where the old page finished. > > > > I would try programming, that usually works for me. > > > > You will have to let the program know where you left off, you could pass > > it in the url, set a cookie, or put it to the session. Either way, just > > do a little programming and voila. > > Or you could just pass the offset in the url and use SQL to limit the > search. > > I can't remeber the exact stuff but all you need to do is write the select > with an offset (where to start the select) and a limit (10 results > perhaps). You will then only get that data set. > > Just add limit to the offset and pass that onto the next instance of the > page to use as the next offset. > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] phpize ??
Hello, I am trying to install apc php cache. When I try to run phpize, I get: unable to find config.m4 make shure you run phpize in the top level directory of the module Can somebody tell me how to run phpize and by the way, what is phpize ?? py -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] updating flash file with php
Hello, any of you has a tutorial/info on how to update a flash file (swf) with a php script ? (data coming from a text file and a database) py
[PHP] class inheritance question
Hello, Class A{ function aa(){} } Class B extends A{ function bb(){ $this->aa();// I know this is ok } } Class C extends B{ function cc(){ $this->bb();// Will this work ? } } py
Re: [PHP] php site hacked?
You are not the only one, this is strange indeed, I would not believe it is a hacked tho. Maybe a technicien mixed up the dns db, or something like that ! Go to: http://uk2.php.net/ wich is fine, py - Original Message - From: sunny hundal <[EMAIL PROTECTED]> To: Altunergil, Oktay <[EMAIL PROTECTED]>; 'Philip Olson' <[EMAIL PROTECTED]>; Don Pro <[EMAIL PROTECTED]> Cc: php list <[EMAIL PROTECTED]> Sent: Saturday, May 12, 2001 2:31 PM Subject: RE: [PHP] php site hacked? > ok, i just clicked on the uk.php.net/mirrors.php and i got nothing. > so i went to uk.php.net and i get some wierd "online.co.uk" corporate > site which has no relation to php at all. > > am i the only one who gets this feeling someone's replaced the > uk.php.net files?? > > /sunny > > > --- "Altunergil, Oktay" <[EMAIL PROTECTED]> wrote: > I hate the > fact that php.net, phpbuilder.com are down very > > frequently and > > mysql.com is slow usually.. > > > > It's too bad for our image. > > > > Oktay Altunergil > > > > -Original Message- > > From: Philip Olson [mailto:[EMAIL PROTECTED]] > > Sent: Friday, May 11, 2001 1:26 PM > > To: Don Pro > > Cc: php list > > Subject: Re: [PHP] Documentation > > > > > > > > > > http://uk.php.net/mirrors.php > > > > > > regards, > > philip > > > > On Fri, 11 May 2001, Don Pro wrote: > > > > > Does anyone know alternative sites for PHP documentation? > > > > > > www.php.net seems to be down. > > > > > > Thankls, > > > Don > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > > > Do You Yahoo!? > Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk > or your free @yahoo.ie address at http://mail.yahoo.ie > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sending attachements with mail
Here is a nice class that handles e-mail attachment. Works fine for me. py // == // start code // == subject = $subject; $this->addr_to = $to; $this->smtp_headers = $this->write_smtpheaders($from); $this->text_body = $this->write_body($msg); $this->text_encoded = $this->attach_file($filename,$mimetype,$mime_filename); $this->mime_headers = $this->write_mimeheaders($filename, $mime_filename); } function attach_file($filename,$mimetype,$mime_filename) { $encoded = $this->encode_file($filename); if ($mime_filename) $filename = $mime_filename; $out = "--" . $this->mime_boundary . "\n"; $out = $out . "Content-type: " . $mimetype . "; name=\"$filename\";\n"; $out = $out . "Content-Transfer-Encoding: base64\n"; $out = $out . "Content-disposition: attachment; filename=\"$filename\"\n\n"; $out = $out . $encoded . "\n"; $out = $out . "--" . $this->mime_boundary . "--" . "\n"; return $out; // added -- to notify email client attachment is done } function encode_file($sourcefile) { if (is_readable($sourcefile)) { $fd = fopen($sourcefile, "r"); $contents = fread($fd, filesize($sourcefile)); $encoded = chunk_split(base64_encode($contents)); fclose($fd); } return $encoded; } function sendfile() { $headers = $this->smtp_headers . $this->mime_headers; $message = $this->text_body . $this->text_encoded; mail($this->addr_to,$this->subject,$message,$headers); } function write_body($msgtext) { $out = "--" . $this->mime_boundary . "\n"; $out = $out . "Content-Type: text/plain; charset=\"us-ascii\"\n\n"; $out = $out . $msgtext . "\n"; return $out; } function write_mimeheaders($filename, $mime_filename) { if ($mime_filename) $filename = $mime_filename; $out = "MIME-version: 1.0\n"; $out = $out . "Content-type: multipart/mixed; "; $out = $out . "boundary=\"$this->mime_boundary\"\n"; $out = $out . "Content-transfer-encoding: 7BIT\n"; $out = $out . "X-attachments: $filename;\n\n"; return $out; } function write_smtpheaders($addr_from) { $out = "From: $addr_from\n"; $out = $out . "Reply-To: $addr_from\n"; $out = $out . "X-Mailer: PHP3\n"; $out = $out . "X-Sender: $addr_from\n"; return $out; } } // usage - mimetype example "image/gif" // $mailfile = new CMailFile($subject,$sendto,$replyto,$message,$filename,$mimetype); // $mailfile->sendfile(); // Splits a string by RFC2045 semantics (76 chars per line, end with \r\n). // This is not in all PHP versions so I define one here manuall. function my_chunk_split($str){ $stmp = $str; $len = strlen($stmp); $out = ""; while ($len > 0) { if ($len >= 76) { $out = $out . substr($stmp, 0, 76) . "\r\n"; $stmp = substr($stmp, 76); $len = $len - 76; } else { $out = $out . $stmp . "\r\n"; $stmp = ""; $len = 0; } } return $out; } // end script ?> // == // end code // == - Original Message - From: Tolga "thorr" Orhon <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, May 21, 2001 3:47 PM Subject: Re: [PHP] sending attachements with mail > Yes you can do it, but it takes some time as you need to know MIME > extensions. It took 2 hours to implement just picture attachments. It will > surely be easier to use some kind of script but I couldnt find any that gets > attachments direcly (as I am getting attachments from MySql DB) so I did my > own. > > -- > Tolga 'thorr' Orhon > > "Mark Wouters" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Nobody knows if it's possible to send attachements with mail()?? > > > > Thanks, > > > > -- > > Mark Wouters > > eXpanded Media > > Web Designer > > Parijsstraat 74, B-3000 Leuven - Louvain > > Tel: +32 (16) 31.10.12 > > Fax: +32 (16) 31.10.19 > > E-mail: [EMAIL PROTECTED] > > URL: http://www.expandedmedia.be > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Job listings DB
> Hi, > > I am designing a system for my company to get employee resumes via the Web, > rather than paper. All resumes now go into a mySQL DB, which can be > searched by HR (at least that's the theory :) [I would do it like that also] > > My questions: > > For job listings - how do I design the tables? Can I dump all job listings > into a single table, and all applications/resumes into another one? Or > should they be normalized? [They should be normalized] > If normalized - how much? For example, in a listing, I have job code, > department, location, salary range, etc. - should I have separate tables > for each of these? Like [Yes, I would say so] > jcode dept loc > 1 213 2 > 2 77 3 > > where dept and loc are FKs to other tables? Or is this taking it too far? [It is not a necessity, but it would be easier to modify or upgrade later, wich we always do] > Same for application form. All this information that I am getting - should > I put into a single table, or split across separate tables? I do plan to > search by differenet criteria later. > > What about items in drop-downs? For example, if I have a drop-down for > salary ranges or countries - should this information come from a table, or > should I hard-code into the form itself? How do I make the decision as to > which is appropriate? [I would never hard code anything that can change, salary ranges can changes, country can change too :) ] [Besides, in what I call Code Table like country I would have 3 fields: country_id, country_name, country_zorder, you increment country_zorder by 5 The reason: You can later order by country table by name, by id or by a specific order that you defined (putting more popular country on top)] > Any assistance much appreciated. TIA, > > Vikram > -- > Give a homeless man a bundle of firewood, and he'll be warm for one day. > Douse him with a gallon of gasoline and set him on fire, and he'll be warm > for the rest of his life! [ouch!] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] About MySQL Recordset pagination...
I wrote a simple class to do that, it can be modified quite easily. http://www.pywebsolutions.com/source.php Hope this is what you are looking for... py - Original Message - From: Hassan Arteaga <[EMAIL PROTECTED]> To: Php (E-mail) <[EMAIL PROTECTED]> Sent: Tuesday, May 22, 2001 8:39 PM Subject: [PHP] About MySQL Recordset pagination... Hi all !! I'would like to know if exist in MySQL or PHP functions to implement pagination like ADO (This is for WINDOWS PHP programmers) thanks in advanced !! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] file download
Hello, I had the same problem as you for months! until someone post this a couple of weeks ago: header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=file.txt"); include("file.txt"); py - Original Message - From: Aleksey Yarilovets <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, May 23, 2001 9:44 AM Subject: [PHP] file download > Hi everyone! > > I need user to dowload a file from my server ( Apache ), what i do is: > header("Content-Type: application/download"); >header("Content-Disposition: attachment; filename='report.txt'"); > echo "file contents"; > ?> > > It was working till now but sudenly i start recieve the message from > iexplorer: > > IE can not download ScriptName.php file from the server. > IE was not able to open this site. The requested site either unavailable or > can not be found. > > :( > > Does somebody knows what is going on? > > Thanks, Alexey. > > Email: [EMAIL PROTECTED] > ICQ# 101975252 > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] encrypting passwords etc..
"security is measured by the weakest link in the chain" so I would say that the database needs to be well protected and the password encrypted. py At 12:14 PM 1/17/2002 -0800, you wrote: >We had a client who wanted us to encrypt their >passwords. Our argument was that maybe their database >is not well protected. Only the dba and the >application should have access to the database. >No-one else should be able to view their data anyways. >We didn't see any need to encrypt the passwords. > >Any thoughts... > > > >--- Hawk <[EMAIL PROTECTED]> wrote: > > Ok I got it working now, with the update and > > database connect etc.. thanks > > guys :) > > this is not a problem(yet), more a thought.. is it > > really necesary to > > encrypt passwords, I mean, what does it prevent, me > > from seeing them using > > mysql.exe ? :p > > I tried and it worked fine to almost all points.. > > worked with the user info > > update and so on.. but I seem to do something wrong > > and can't log back on > > since I encrypted the password... :p > > I used UPDATE users SET > > password=password('$password') but by some reason I > > can't seem to decrypt it on the login page.. any > > help would again be > > appreciated.. :) > > > > Hawk > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > >= >Anas Mughal >[EMAIL PROTECTED] >[EMAIL PROTECTED] >Tel: 973-249-6665 > >__ >Do You Yahoo!? >Send FREE video emails in Yahoo! Mail! >http://promo.yahoo.com/videomail/ > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Computer Science and PHP
Do you guys really think PHP should be in computer science curriculum? In my curriculum (in canada) I learned C/C++, Software Design (database architecture and OO Design), SQL, Unix and Networks (OSI, TCP-IP and HTTP mainly) There was no Perl, Python, PHP, ASP, JSP and even no VB... I think it's more important to learn Programming than it is to learn PHP. I know for a fact that some of our teachers knew about PHP, but still they decide to teach the class in C. And I happy they did. Now if your school has no PHP server, why don't you suggest and offer to install it? That's what we did, we made it run on a small machine on Linux first than with the help of the university sys admin, we installed it on a Unix server. The sys admin is now very happy to do his web stuff in PHP instead of Perl :) just my canadien 2 cents... (1.14 cent US ;) ) py At 03:46 AM 1/18/2002 -0200, you wrote: >Hello, > >Francesco Gallarotti wrote: > > > > I am a student in a college in NY state. Here we have several servers and > > dozens of courses on computer science. No server is PHP ready and no course > > instructor knows anything about PHP. Why do you think this is happening? I > > really like PHP and I am using it in my personal website to work with some > > text files and a small database. Why PHP is so not popular in the computer > > science teaching area? > >IMHO, that is there no marketing effort behind PHP, meaning there is no >Microsoft nor Sun nor any strong brand behind PHP to advertise it. > >Even in the Open Source world the PHP credit is relative. For instance >well known publishers on the field like O'Reilly don't seem to care much >about publishing PHP books. I don't know why. > >O'Reilly seems to give more credit to Perl and Python than to PHP, but >it is also true that such languages have well organized advocacy groups >while there seems to be no organized advocacy for PHP at all. > >Also PHP is only known to be adequate for Web programming niche market >although it can be used as a general purpose programming language. Since >Computer Science courses are for much more than Web programming, >colleges do not see PHP as a good bet for the future of their students. > >Unfortunately, in this world when somebody does not know about >something, what is important is not what that "is" but what "seems to >be". So humans seem to give more credit to something that appears often >in many places than something that appears not very much in only one >place. PHP popularity seems to be limited to what it is advertised for >which isn't much as I mentioned above. > >So, if you care about PHP credit and consequent success in the Computer >Science world, what shall you do about it? > >Well, as an individual you may not be able to do much. But I think there >is plenty of things that can be done to better market PHP so it gets the >necessary recognition to appear in Computer Science curriculum. > >In the past I made several suggestions to PHP developers in order to >improve PHP recognition not only in colleges but also in companies that >are not aware of the capabilities of PHP. If companies are not made >aware of PHP capabilities, that reduces the chances of employment of >people like everybody here that would like to keep working on PHP and >you may be forced by the circumstances to work with other more accepted >languages in the labour market. > >Unfortunately, my suggestions were not considered seriously, meaning >either people present then either not agree with the suugestions or >simply nothing seems to have been done in that direction. > >I don't want to bring back the discussion of the merits of the >suggestions, but rather to remind them for people that were not present >or not paying attention to consider them and maybe who knows does >something about it. So what I suggested was something more os less like >this: > >- Promote contests of PHP applications or components. The Python >community does this and it seems to be getting the attention of the >computing media. This leads to an obvious greater exposure of the >language to the computing community that does not know it while it >promotes the development of more and better applications and components. > >- Promote a banner exchange/Web ring between all sites that promote PHP >related materials: articles, components, applications, etc.. This would >give a greater sense of the wide support that users that adhere to PHP >may find. Somebody objected because it would be hard to tell which sites >provide a reasonable level of quality. I think this could be sorted by >providing a way for users to vote on each of the sites. The results of >the votes would be shown in t
[PHP] date conversion and calculation problem...
Hello, I have 2 date string like this $t1 = "2001-11-12 17:30:10"; $t2 = "2001-11-12 17:15:32"; I need to substracts the number of seconds from $t2 from $t1 (because after I have another script thats converts the number of seconds to minutes, hours or days if necessary) I tried: (but it does not give me something rigth) $t1 = explode( " ", $t1 ); $t2 = explode( " ", $t2 ); // now $t1[0] contains date $t1[1] contains hours $arr_date1 = explode( "-", $t1[0] ); $arr_date2 = explode( "-", $t2[0] ); $arr_time1 = explode( ":", $t1[1] ); $arr_time2 = explode( ":", $t2[1] ); // now $arr_time1[0] contains the hour, $arr_time1[1] contains minute, $arr_time1[2] contains second $t1 = mktime( $arr_time1[0], $arr_time1[1], $arr_time1[2], $arr_date1[1], $arr_date1[1], $arr_date1[0] ); $t2 = mktime( $arr_time2[0], $arr_time2[1], $arr_time2[2], $arr_date2[1], $arr_date2[2], $arr_date2[0] ); print "$t2 - $t1 = ". ( $t2 - $t1); hope you can help me, py -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Flash and PHP loadvariablesnum
Hello, this question should be ask to a flash forum, php would never open a window!! I used this class to achieve what you asked (http://www.hotscripts.com/Detailed/8970.html) but I know nothing about flash... py - Original Message - From: "dharvell" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 12, 2001 11:13 PM Subject: [PHP] Flash and PHP loadvariablesnum > I have a flash movie that is submitting to a PHP page using loadvariablenum > but after being submitted it opens a new window that displays the "print" > line that was supposed to go back to flash. does anyone have any ideas?? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Reading the value of a serialize object in session
Hello, How do you read back the value of a serialize object that you put into a session variable? My exemple: page1.php --- session_start(); include( "myObject.php" ); $o = new myObject(); $o->load_variable( "100", www.domain.com); $o = serialize( $o ); session_register( "o" ); Header("Location:page2.php"); exit; page2.php --- session_start(); include( "myObject.php" ); print $HTTP_SESSION_VARS['o'];// prints the line ok print "". $o->var1; // nothing... print "". $o->var2; It does not work event when I do $o = unserialize( $o ) before displaying.. py -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Need advide on partnership agreement for a php application...
Hello, I have an application wich I maintained on my servers (PHP, Apache, MySQL). I have a client that is already using the application trought a secure link directly from his web site. But he would like to have my application update a database directly on his server (Oracle) in order to protect the statistical data collected trought the application, wich is a lot... I see no problem to open a connection to update his Oracle database on his server. I use phplib so it would not be a major modification. But some questions remains: - Opening a connection directly to his oracle database is not really more secure in any way. (If I get hacked, he get's hacked...) - It seems to me a false security since the data are manipulated by the PHP engine on my server anyway... - Creating a database (in order to replicate mine) would tell him a lot about how I do my stuff... (but I do not really care tho) My solution was to provide all statistical data to him with a secure (SSL) link and give him everything in XML so he could update his database just the way he want's it. What do you think? What sould I tell him? I really need advice since this is a field unknown to me... py p.s. I do not really know where to post a question like this one wich is not really related to PHP directly... Sorry... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] ASP and PHP
Hello, Please make searchs in the archives of this newsgroup as this was discussed many many times before. The bottom line is always that both language are valuable and will do the job. But PHP will do the job on both MS and Linux, Unix, *BSD... That in itself is the biggest Yippers for PHP ;) py - Original Message - From: "Luis Espinosa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, November 28, 2001 11:43 AM Subject: [PHP] ASP and PHP > Hi! > > I have been using ASP for some time, and now I am beginning with PHP. I > would like to know which > are the main differences between both languages. I'd appreciate if you can > give the advantages and disadvantages > of both languages. > > Thanks > > Luis Espinosa > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] database question
In the following: select whatever from articles where textlines regexp "^\Sbingo\S$" what does \S means? py - Original Message - From: "Jon Farmer" <[EMAIL PROTECTED]> To: "Warren Vail" <[EMAIL PROTECTED]>; "Michael Hall" <[EMAIL PROTECTED]>; "PHP List" <[EMAIL PROTECTED]> Sent: Thursday, November 29, 2001 9:54 AM Subject: Re: [PHP] database question > Actually the sql statement you want is > > select whatever from articles where textlines regexp "^\Sbingo\S$" > > regards > > Jon > -- > Jon Farmer > Systems Programmer, Entanet www.enta.net > Tel 01952 428969 Mob 07763 620378 > PGP Key available, send email with subject: Send PGP Key > > > - Original Message - > From: "Warren Vail" <[EMAIL PROTECTED]> > To: "Michael Hall" <[EMAIL PROTECTED]>; "PHP List" > <[EMAIL PROTECTED]> > Sent: Thursday, November 29, 2001 2:57 PM > Subject: RE: [PHP] database question > > > Try; > > SELECT whatever FROM articles WHERE textlines LIKE "%searchword%" > > Two warnings; > > 1) This will force a "table scan" (the contents of each row in the entire > table because there can be no index to support faster searching of contents > that float in the column) which will be very slow on a large database (even > a medium size one). > 2) This will also find words that exist inside other words. (ie the word > "ward" exists inside "toward") If you try to solve this by imbedding blanks > between the wildcard (%) and the text, you will probably not be able to find > the word at the end of a line, or just prior to a comma or period. > > I also believe there may be a way to make the search case insensitive, look > for something like a " WHERE tolower(textlines) LIKE ..." to force the > column values to be all lower case and make sure your search values are all > lower case as well. > > Good luck, > > Warren Vail > > -Original Message- > From: Michael Hall [mailto:[EMAIL PROTECTED]] > Sent: Thursday, November 29, 2001 2:21 PM > To: PHP List > Subject: [PHP] database question > > > How can I search a MySQL database field that contains sentences (VARCHAR > datatype) or entire texts (TEXT datatype) for single words? > > Let's say I want to search 100 articles stored in a database field as TEXT > for the word "bingo", is there any SQL or PHP way of doing that? > > Mick > > -- > > Michael Hall > [EMAIL PROTECTED] > [EMAIL PROTECTED] > http://openlearningcommunity.org > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Equivalent of the Basic function SELECT...CASE
switch( $x ){ case 1: case 2: case 3: case 4: case 5: {...} break; default: {...} break; } py At 05:38 PM 12/6/01 +, Robin McKenzie wrote: >Could anyone tell me if there is a PHP equivalent to: > >SELECT x > CASE 1 to 5 > {...} > CASE ELSE > {...} >END SELECT > >Muchos gracias. > >Robin > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: setting up a user login with PHP
or you could use: http://phpclasses.upperdesign.com/browse.html/package/288 py At 01:08 PM 12/10/01 -0500, Jeremy Reed wrote: >The easiest way is to use cookies. >=CODE >require 'auth_functions.php'; >if (authenticateUser($form_username, $form_password)){ >setcookie("cookie_passwd",$form_password); >setcookie("cookie_user",$form_username); >header("Location:http://$SERVER/index2.php";); >exit(); >} else { >header("Location:http://$SERVER/error.html";); >} >?> > >This code takes in input from a form as simple as this: > > Login: > Password: > > > >Checks it against the database values using the function 'authenticateUser', >returns TRUE or FALSE. >If true, sends the user onto the correct page, if false, sends them to some >error page. > >Now, in each other file, you'll need to check the cookies. The values for >the cookies are sent automatically by the user's browser. In this >particular examples, the cookie variables are named '$cookie_user' and >'$cookie_passwd'. You can see in the example how those are set. > >You will check the cookies using the exact same 'authenticateUser' function. >Except in these files, you will use the cookie values as the parameters to >the function instead of the form values. > >Hope this helps. > >Best regards, > >Jeremy Reed > >"Mark Ward" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I've got a mySQL database with usernames and passwords. What's the best >way > > to allow authorized users to enter my site? I'm having some problems using > > the forms properly, they've always been my achilles heel when it comes to > > web programming. Any help is appreciated. > > > > Mark Ward > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP software tool
It works does fine with PHP, but my favorite is EditPlus, py At 07:29 PM 12/22/2001 +, you wrote: >Does 1st page work well with PHP? The website says its good for Perl, HTML >and ASP but it doesnt mention PHP anywhere. >:-s > > > >"-Bd-" <[EMAIL PROTECTED]> wrote in message >028901c18b1c$3c0e4d80$[EMAIL PROTECTED]">news:028901c18b1c$3c0e4d80$[EMAIL PROTECTED]... > > I use 1stpage from evrsoft.com .. not a "real" php editor, but does a > > pretty good job... > > > > > Does anybody know of or can recommend any freeware text editing tools >for > > > editing PHP code in Win32? > > > I can manage with Windows' Notepad but something with code highlighting > > etc > > > and of a similar footprint to notepad would be useful. > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Templates??
"FYI, at the last ThunderLizard web design conference, a presenter speaking about content management tools said that most sites only need 6 or so templates ... that there are usually only 6 categories of pages." Salut, do you know where we could get more info about that conference? What are his 6 categories of pages? I am focusing on "Templating" my sites now and I am interested in what was said there. py - Original Message - From: Les Neste <[EMAIL PROTECTED]> To: Daniel Guerrier <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, June 19, 2001 6:29 AM Subject: Re: [PHP] Templates?? > The template defines the look and feel for a class of pages. The advantage > is in allowing you to change one file -- the template file -- and have your > changes be reflected in all the individual pages that use the template > WITHOUT having to individually edit all of those pages. > > For smaller sites, this may not be a big deal, but, for sites with > thousands of pages, you clearly want to avoid hand-edits if at all possible. > > I'm personally reworking my online portfolio, and I'm now using templates > so I can present a different look and feel to suit different potential > clients. > > FYI, at the last ThunderLizard web design conference, a presenter speaking > about content management tools said that most sites only need 6 or so > templates ... that there are usually only 6 categories of pages. > > > > At 05:48 PM 6/18/2001 -0700, Daniel Guerrier wrote: > >What the true advantage of using templates and where > >can I get info on using them? > > > >__ > >Do You Yahoo!? > >Spot the hottest trends in music, movies, and more. > >http://buzz.yahoo.com/ > > > > > Les Neste 678-778-0382 http://www.lesneste.com
Re: [PHP] SQL statement for clearing a table
if you have a numbered primary key, delete from table where primary_key > 0 ? (to be handled with care....) py - Original Message - From: Wilbert Enserink <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 22, 2001 1:17 PM Subject: [PHP] SQL statement for clearing a table > Hi all, > > anybody knows the mysql statement for clearing the contents of a table and > lieving the table itself intact? > > Wilbert > > - > Pas de Deux > Van Mierisstraat 25 > 2526 NM Den Haag > tel 070 4450855 > fax 070 4450852 > http://www.pdd.nl > [EMAIL PROTECTED] > - > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session timeout
look in php.ini py - Original Message - From: Frédéric Mériot <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2001 1:33 PM Subject: [PHP] Session timeout > How to set the session timeout? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] security
But remember that once a user has accessed the .swf once, they can then get the path and call the file directly afterwards. Even worse, the .swf is in the computer's cache. py - Original Message - From: Chris Lambert - WhiteCrown Networks <[EMAIL PROTECTED]> To: AVisioN:::nomoremedia::: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2001 5:30 PM Subject: Re: [PHP] security > Check what the user agent is for the SWF, and see if it passes a specific > referer. That should deter 99% of attempts. > > /* Chris Lambert, CTO - [EMAIL PROTECTED] > WhiteCrown Networks - More Than White Hats > Web Application Security - www.whitecrown.net > */ > > - Original Message - > From: AVisioN:::nomoremedia::: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Tuesday, July 10, 2001 12:08 PM > Subject: [PHP] security > > > | Is it possible to restrict the use of a php-file to a special file (for > | example an swf). > | > | > | -- > | ---: AVisioN :--- > | http://www.nomoremedia.de > | -::[EMAIL PROTECTED]::- > | > | "I have nothing to declare except my genius"._oscar_wild > | > | > | > | -- > | PHP General Mailing List (http://www.php.net/) > | To unsubscribe, e-mail: [EMAIL PROTECTED] > | For additional commands, e-mail: [EMAIL PROTECTED] > | To contact the list administrators, e-mail: [EMAIL PROTECTED] > | > | > | > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] decrypting passwords
You store it encrypted and you compare the two encrypted password for validation. You will send it to the user before encrypting it, how else ? And if user forget it, you reset a new one. py - Original Message - From: Steph <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 13, 2001 7:04 AM Subject: [PHP] decrypting passwords User enters a new password through a form. Then it is put in the table by the following. ($userid is the username) $query = mysql_query("update users set password = encrypt('$password','$userid') where userid = '$userid'") or die("Couldn't execute query."); I need to know how to decrypt the password so that I can have it emailed to the user should they forget it. Any help would be appreciated Thanks Steph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] count number of form fields?
A multiple dropdown lists will produce an array is you put [] when naming the list. You than need to count how many elements you have in the array. py p.s. it could be done in javascript as well, but it's so easy in php :) - Original Message - From: Jaxon <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 13, 2001 3:32 PM Subject: [PHP] count number of form fields? > Hi, > > Can someone give me an example of how to count the number of form fields > entered? > E.g. let's say I have three dropdown lists, the first is mandatory, and the > second two are optional. > I want to be able to tell my target php script how many of the dropdowns are > populated. > > thanks in advance! > jaxon > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] which php shopping cart is this?
You should ask them! My guess is phpshop?? py - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 13, 2001 6:46 PM Subject: [PHP] which php shopping cart is this? > Greetings! > > Which php-based shopping cart is being used at this site? > http://shop.t-shirtoutlet.com/catalog/ > > > Thanks! > > > > Max Pyziur BRAMA - Gateway Ukraine > [EMAIL PROTECTED] http://www.brama.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Time Taken to Process
Mostly Taken from phpbuilder I beleive... // = // Function to start the timer. // = function start_timer(){ $timeparts = explode( " ",microtime() ); $starttime = $timeparts[1].substr( $timeparts[0], 1 ); return $starttime; } // = // Function to stop the timer. // = function stop_timer(){ $timeparts = explode( " ",microtime() ); $endtime = $timeparts[1].substr( $timeparts[0], 1 ); return $endtime; } // = // Print script execution time // = function script_time( $starttime, $endtime ){ $t_time = ( $endtime - $starttime ); return $t_time; } $starttime = start_timer(); // Script here .. $endtime = stop_timer(); echo "Exec: ". number_format( script_time( $starttime, $endtime ), 6 ) ." sec"; py - Original Message - From: Phil Spitler <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 16, 2001 6:57 PM Subject: [PHP] Time Taken to Process > Does anyone know an easy way to tell how long a page takes to run in ms. > Maybe some variable that can be called at the bottom of the page or > something. > > THANKS! > > - > Phil Spitler [Applications Developer] > American City Business Journals > p: 704.973.1049 > f: 704.973.8049 > e: mailto:[EMAIL PROTECTED] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Simple validation problem
Hello, I am trying to make shure the amount is positive and is a float. (format: $$$.$$) if( $amount == "" && !is_float( $amount ) && !eregi( "^[_a-z]", $amount ) ){ print "Error"; } this code does not work when I the input is -25.00 What could be wrong? py p.s. I read what I could on regular expression, but obviously still learning...
Re: [PHP] Re: Simple validation problem
I wonder how that can be enough, if you consider the following form, you can enter "45-98" and it will print ok !! Since all http is coming as a string, I beleive the only way is to test for invalid characters as anything except [0-9] and the dot. (wich is my problem because I do not really know how) I event try with casting amount like this: $amount = (float)($amount); It does not work, I can still input "12r5" for exemple. py if( $amount >0 ){ print "ok"; }else print "smaller than 0: error"; if( is_float( $amount )){ print "ok"; }else print "not a float: error"; ?> - Original Message - From: CC Zona <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 18, 2001 10:15 PM Subject: [PHP] Re: Simple validation problem > In article <00ef01c10fa5$fd20f2e0$e064fea9@py>, [EMAIL PROTECTED] (Py) > wrote: > > > I am trying to make shure the amount is positive > > if($amount >0) >{...} > > > and is a float > > if(is_float($amount)) >{...} > > -- > CC > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: Simple validation problem
Ok forget it, someone suggest to me: if ((string)((float)$amount) == $amount && (float)$amount > 0) { print "ok"; }else print "error"; and it works perfectly! py - Original Message - From: py <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 19, 2001 11:14 AM Subject: Re: [PHP] Re: Simple validation problem > I wonder how that can be enough, if you consider the following form, > you can enter "45-98" and it will print ok !! > > Since all http is coming as a string, I beleive the only way is to test for > invalid > characters as anything except [0-9] and the dot. (wich is my problem > because I do not really know how) > I event try with casting amount like this: > $amount = (float)($amount); > It does not work, I can still input "12r5" for exemple. > > py > > if( $amount >0 ){ > print "ok"; > }else print "smaller than 0: error"; > > if( is_float( $amount )){ > print "ok"; > }else print "not a float: error"; > ?> > > > > > > - Original Message - > From: CC Zona <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, July 18, 2001 10:15 PM > Subject: [PHP] Re: Simple validation problem > > > > In article <00ef01c10fa5$fd20f2e0$e064fea9@py>, [EMAIL PROTECTED] (Py) > > wrote: > > > > > I am trying to make shure the amount is positive > > > > if($amount >0) > >{...} > > > > > and is a float > > > > if(is_float($amount)) > >{...} > > > > -- > > CC > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] (another, not entirely)sessions question
Hello, I would continue with the queries. That's what a database is made for. Optimize them and make shure the fields you search often ( the ones in the WHERE clause ) are index. Keep the sesion vars as small as possible. Cookies are quite a pain to program and if the user has disable them, nothing works. Maybe an object (OOP) of all user info, serialized in an session var, would be a solution... just my advice... py - Original Message - From: Conor McTernan <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 20, 2001 7:31 AM Subject: [PHP] (another, not entirely)sessions question > Hey there, > > I'm currently writing a web app using php. I was just looking for some > advice on one aspect. On this site, users will be able to log in and post > messages, or articles, or replies etc, you get the idea. > > Anyway, I am storing some info about the users, the usual stuff, name, > email, password, all in mysql. I am also storing other info, such as when > they last posted, and how many times they have posted. > > When a user posts a new message, the message is sent to mysql and stored > in a table, at the same time, i also have to increment their total number > of posts. The way this is done is by selecting the posts field on their > userid, which i have to find using their username, which is set as a > session var, when the user logs in. This all results in a good few > queries to mysql. > > I was wondering would it be better to load all the user info, e.g. number > of posts, last post date, into session vars, or should i set a cookie on > the client side, or should i just continue with the queries. > > Any help is appreciated. > > conor > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Re: (another, not entirely)sessions question
It would also be very good to look at what other similar web application are doing and learn from their success and mistake. I am thinking about phpnuke, phpslice, slashdot and the likes... py - Original Message - From: Conor McTernan <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, July 20, 2001 8:02 AM Subject: Re: [PHP] Re: (another, not entirely)sessions question > > > On Fri, Jul 20, 2001 at 11:52:36AM +, Er Galvão Abbott wrote: > > Just a sugestion here, that may sound strange, but I'd do it like > > this: > > > > Why don't you keep a simle text-counter file for each user? Why this > > HAVE to go trough SQL? > > i suppose i want it to go through SQL because I am storing all my > documents and the guts of the site in a database. > > > > Just creat a text file with "0" on it. When the user posts, retrieve > > the number from the file, increment it and then write it back... > > hmmm, interesting idea, but what happens when there are multiple users, > each one will then have their own file, i know it wont take up too much > disk space, but i really have a thing for tidy directorys:) and this > sounds like a nightmare to me ;) > > > > > This way you don't overload SQL and keep the post counter running... > > could it in fact create more work for the CPU, if it has to keep reading > and writing to files on the disk, as well, would that be any quicker? > > > > > Tell me what you think, even if you think it's stupid :) > > haha, i wouldnt say it's stupid anyway, but i wouldnt be attracted to that > approach, i'm usually drawn to databases, hehe. > > > > > > > On Fri, 20 Jul 2001 12:31:15 +0100, [EMAIL PROTECTED] (Conor > > McTernan) wrote: > > > > >Hey there, > > > > > >I'm currently writing a web app using php. I was just looking for some > > >advice on one aspect. On this site, users will be able to log in and post > > >messages, or articles, or replies etc, you get the idea. > > > > > >Anyway, I am storing some info about the users, the usual stuff, name, > > >email, password, all in mysql. I am also storing other info, such as when > > >they last posted, and how many times they have posted. > > > > > >When a user posts a new message, the message is sent to mysql and stored > > >in a table, at the same time, i also have to increment their total number > > >of posts. The way this is done is by selecting the posts field on their > > >userid, which i have to find using their username, which is set as a > > >session var, when the user logs in. This all results in a good few > > >queries to mysql. > > > > > >I was wondering would it be better to load all the user info, e.g. number > > >of posts, last post date, into session vars, or should i set a cookie on > > >the client side, or should i just continue with the queries. > > > > > >Any help is appreciated. > > > > > >conor > > > >Er Galvão Abbott > > Webdeveloper > > [EMAIL PROTECTED] > > - > > To send me an e-mail just remove > > the CAPITAL TEXT. > > - > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]