[PHP] date() and mktime() functions: weeknumbers and months.
Hi people, I would like to select news from my database bases on week/year and month/year. How can i do this.. I would like to pass two arguments in the query string, like news.php?week=14year=2003 or news.php?month=3year=2003. Can anybody help me.. Thanks in advance. I have been looking at the date() and mktime() functions, but is there anyway to determine the date from a weeknumber? I have been using this: $yr=2003; $mnth=03; $dy=31; echo base date: .$yr.-.$mnth.-.$dy.br /; echo last sunday: .date(Y-m-d, mktime(0,0,0,$mnth,$dy-date(w,mktime(0,0,0,$mnth,$dy,$yr)),$yr)).br /; echo next saturday: .date(Y-m-d, mktime(0,0,0,$mnth,$dy+6-date(w,mktime(0,0,0,$mnth,$dy,$yr)),$yr)).b r /; $sql = SELECT * FROM news WHERE date='$last_sunday' AND date='$next_saturday'). But i would find it better to use a weeknumber instead Best regards, Davy Obdam - Networking4all Webapplication developer E-mail: [EMAIL PROTECTED] Web: http://www.networking4all.com Kijk ook eens op: http://www.verzamelgids.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() and mktime() functions: weeknumbers and months.
Check out mysql manual, section 6.3.4 - Date and Time Functions, example $condition=''; if($GET['week']) $condition .= WEEK(date)='$_GET[week]' AND ; if($GET['year']) $condition .= YEAR(date)='$_GET[week]' AND ; and so on then use the condition: $sql = SELECT * FROM news WHERE $condition 1; Davy Obdam wrote: Hi people, I would like to select news from my database bases on week/year and month/year. How can i do this.. I would like to pass two arguments in the query string, like news.php?week=14year=2003 or news.php?month=3year=2003. Can anybody help me.. Thanks in advance. I have been looking at the date() and mktime() functions, but is there anyway to determine the date from a weeknumber? I have been using this: $yr=2003; $mnth=03; $dy=31; echo base date: .$yr.-.$mnth.-.$dy.br /; echo last sunday: .date(Y-m-d, mktime(0,0,0,$mnth,$dy-date(w,mktime(0,0,0,$mnth,$dy,$yr)),$yr)).br /; echo next saturday: .date(Y-m-d, mktime(0,0,0,$mnth,$dy+6-date(w,mktime(0,0,0,$mnth,$dy,$yr)),$yr)).b r /; $sql = SELECT * FROM news WHERE date='$last_sunday' AND date='$next_saturday'). But i would find it better to use a weeknumber instead Best regards, Davy Obdam - Networking4all Webapplication developer E-mail: [EMAIL PROTECTED] Web: http://www.networking4all.com Kijk ook eens op: http://www.verzamelgids.nl -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dynamic include_path
Hey folks, What we are looking to do is give a specific include path for each site in our customer base. This running on MacOSX so basically we have sites set up like: /Users/username/Sites/site.com/phpinc There can be numerous sites in each users directory and numerous users in /Users. Basically what we want to do is have each set up to be able to include only from their include directory, but the boss is wondering if it can be done on one or two lines for every site total. Basically looking for something like this: Directory /Users/*/Sites/*/phpinc php-value include_path = . /Directory or something like it. Is this possible? Or should we just go ahead and set it in each sites declaration? Derek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] exec different result from command line
Hi folks ! I've got a strage problem I don't know how to solve: I am calling ImageMagick's identify. If I do that via command line, I get a textline as result with all images. If I do the same with exec or passthru, I only get results with certain image-types. Does anyone have any idea of what the problem could be ? thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Newbie] Password()
Hi, in my code I am trying to send an email (containing a password) to a user when he has forgotten his password. The problem is that security leads to needing to encrypt passwords in the database. Im using the password function within mysql. Is there any way of reversing the password function() to get the original password to send out to the user? Or are there any other suggestions in PHP to reverse encryption of passwords. I do understand the principles of encryption and can see the point of unreversible functions but Im sure that not all applications re-set passwords with random generated ones but do send out forgotten passwords. Cheers B _ Worried what your kids see online? Protect them better with MSN 8 http://join.msn.com/?page=features/parentalpgmarket=en-gbXAPID=186DI=1059 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie] Password()
in my code I am trying to send an email (containing a password) to a user when he has forgotten his password. The problem is that security leads to needing to encrypt passwords in the database. Im using the password function within mysql. Is there any way of reversing the password function() to get the original password to send out to the user? Or are there any other suggestions in PHP to reverse encryption of passwords. I do understand the principles of encryption and can see the point of unreversible functions but Im sure that not all applications re-set passwords with random generated ones but do send out forgotten passwords. $pwtestOK=FALSE It's a bit tricky to make it really secure. If your site is vulnerable to serious cracker attacks, better find some indepth articles. What i've seen CMS systems do is take a password from a form and put it as MD5($password) in the database. MD5 is irreversible but when you let people login you simply compare it like this: if (MD5(enteredpassword)== password_in_database) $pwtestOK=TRUE; if (!$pwtestOK) {echo 'wrong password'; exit;} http://nl.php.net/manual/en/function.md5.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [Newbie] Password()
Hi Bobby, In my code I am trying to send an email (containing a password) to a user when he has forgotten his password. [...] The problem is that security leads to needing to encrypt passwords in the database. Im using the password function within mysql. Is there any way of reversing the password function to get the original password to send out to the user? I think it's a one-way hash, like MD5. You could set their password to something else - a random 8-letter string, for example - and send them that along with a note encouraging them to change it. If you want two-way encryption, have a look at AES_ENCRYPT and AES_DECRYPT: http://www.mysql.com/doc/en/Miscellaneous_functions.html (scroll down a bit) Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File access denied!!!
You need to chmod o+r them (in the ftp client). Also the path must be readable by the web server. You might want to set up the ftp server to give these permisions automaticaly Joakim Larsson wrote: I am running a ftp server on my mac along with the webserver on OS 10.2. The files that i upload to the server i have no access to through the internet. This is the message i get when trying to access the webpage You don't have permission to access /index.html on this server.. What do i do to get access to the files that i upload? Sincerely, Joakim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Microsoft SQL Server varchar(500) field text concatenated at 255 characters.
Yeah, umm, Microsoft SQL Server (mssql) is different then MySQL Server (mysql), I believe the correct answer, is if your selecing a VARCHAR longer then 255 is to cast it, example: SELECT CAST(somefield AS TEXT) AS somefield FROM table; That will work. On Fri, 2003-03-28 at 20:10, Daevid Vincent wrote: http://www.mysql.com/doc/en/CHAR.html VARCHAR can only be 255 characters in length. Here's some useful info: # BIGINT UNSIGNED = 8 Byte = = 18446744073709551615 # INT UNSIGNED = 4 Byte = = 4294967295 # MEDIUMINT UNSIGNED = 3 Byte = FF = 16777215 # SMALLINT UNSIGNED = 2 Byte = = 65535 # TINYINT UNSIGNED = 1 Byte = FF = 255 # BIGINT SIGNED = -9223372036854775808 to 9223372036854775807 # INT SIGNED = -2147483648 to 2147483647 # MEDIUMINT SIGNED = -8388608 to 8388607 # SMALLINTSIGNED = -32768 to 32767 # TINYINT SIGNED = -128 to 127 # TINYTEXT = 255 # TEXT = 65535 # MEDIUMTEXT = 16777215 # LONGTEXT = 4294967295 -Original Message- From: Scott Houseman [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 3:35 AM To: [EMAIL PROTECTED] Subject: [PHP] Microsoft SQL Server varchar(500) field text concatenated at 255 characters. Hi There. I am using PHP 4.3.0 on WIN32 to query data from a Microsoft SQL Server. One field I am requesting is type VARCHAR size 500. For some reason, PHP is returning only the first 255 characters of the text from that field. If I change the field type to TEXT, all of the data in that field is returned. Unfortunately, an ASP application is also using that database, and when I change the field type to TEXT, it pukes completely. I would rather try to resolve the issue in PHP than waste my time looking at ASP code. Has anyone got an idea why this might be hapenning? Many thanks. Scott -- Scott Houseman Senior Software Developer Junk Mail Publishing (Pty) Ltd Tel. +27 12 342 3840 x3806 Fax. +27 12 342 1842 Mob. +27 82 491 8021 -- 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 -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Classes
including or requiring a file does not change the working directory, so if you have this structure: index.php A/ClassA.class.php B/ClassB.class.php and index.php includes A/ClassA.class.php, from ClassA.class.php you need to use include('B/ClassB.class.php'); Donahue Ben wrote: I have a ClassA file and a ClassB file stored in separate directories. I am trying to get ClassB to initiate a ClassA object. But since they are stored in seperate directories I get an error. So I tried including the ClassA file in ClassB constructor: function ClassB() { include(../A/ClassA.class.php); ... } i cant get this working. How do i solve this problem without having both class files in the same directory. Ben __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] line feeds
$string = str_replace(\n,'', str_replace(\r,'', $string)); Diana Castillo wrote: How can I remove all line feeds from a document? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] accessing protected remote files
I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accessing protected remote files
You need to use socket functions and check the response headers David Feldman wrote: I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() and mktime() functions: weeknumbers and months.
On Monday 31 March 2003 22:07, Davy Obdam wrote: I would like to select news from my database bases on week/year and month/year. How can i do this.. I would like to pass two arguments in the query string, like news.php?week=14year=2003 or news.php?month=3year=2003. Can anybody help me.. Thanks in advance. I have been looking at the date() and mktime() functions, but is there anyway to determine the date from a weeknumber? I have been using this: [snip] $sql = SELECT * FROM news WHERE date='$last_sunday' AND date='$next_saturday'). But i would find it better to use a weeknumber instead If you're using mysql you can do something like: SELECT * FROM news WHERE WEEK(date) = some_week_number_or_another If you're using some other DBMS check whether it has some similar function. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* We can predict everything, except the future. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GMT strtotime() problem today!!
Im having big problems - I have a script that runs on over 250 Servers, all are running NT4. here is the script: [php] function last_sunday() { return gmdate(Y-m-d, strtotime(Last Sunday)); } echo Last Sunday is returned as: .last_sunday(); [/php] Some servers have 'automatically adjust clock for daylight saving changes' switched on, some have this off - (im in the UK GMT +0). With daylight saving on the above script returns: 2003-03-29 With daylight saving off the above script returns: 2003-03-30 Im puzzled with this one - any ideas? -Stuart |-| |- www.php-editors.com| |- php programming contests | |- php tool reviews | |- php everything else| |-| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Adding a URL
Thank you, your suggestions worked perfectly! ~Scott Don Read wrote: On 30-Mar-2003 Scott Thompson wrote: Hi, I am using the following code to query a database and build an HTML table. snip /* Printing results in HTML */ print table\n; while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { $line['email'] = 'A HREF=mailto:' .$line['email'] .'' .$line['email'].'/A'; print \ttr\n; foreach ($line as $col_value) { print \t\ttd$col_value/td\n; } print \t/tr\n; // how about this ? echo \ntrtd, implode('/tdtd', $line), '/td/tr'; } print /table\n; snip What I want (and can't figure out) is how to have each email address have a URL (i.e. mailto:[EMAIL PROTECTED]). I'm fairly new to PHP, I hope this question made some sense. Suggestions? Regards, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and Front Page XP
Hello people, I have the following strange problem: I designed a form with Front Page XP, and with PHP I save the fields in a MySQL data base. All fields work perfect, except one. This is a control to upload files: INPUT type=file name=f1 The problem is that in the data base the value selected for the user is not recorded. Instead of that a value as /tmp/phpd7Fski is recorded. I don't know if my problem is Front Page, PHP or my Web server (Apache)... As a test I printed the value of the varible $f1: ? echo $f1 ? This shows the following: /tmp/phpd7Fski, instead the value selected by the user. Well I hope somebody can help me, from already thank you very much, Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accessing protected remote files
That's what I thought too, but it's not happening...fopen() is simply returning an error. --Dave On Monday, March 31, 2003, at 09:35 AM, [EMAIL PROTECTED] wrote: Assuming you are retrieving this file via http/https then it's really the remote server that will enforce the access control in whatever manner is uses. I.e., if your script tries to open a file whose access is controlled by a .htaccess file (and http-basic authentication) the user will simply get the authentication prompt when they access your page/php script. -- Original Message -- From: David Feldman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Monday, March 31, 2003 09:13:00 AM -0500 Subject: [PHP] accessing protected remote files I have a script that needs to open a remote file on another Web server, which may or may not be protected (for example, by an htaccess file). What would be the best way to check if it's protected, and if so, prompt the user for username and password to open it? Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- End Original Message -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MSSQL/PHP Problem
Hi, I have this problem retrieving data from a mssql table with PHP. I have this in my mssql table column: Globe and Mail data are retrieved and processed for CustomSearch. On the R30, the crontab entry: 0 4 * * 1-6 /usr1/applic/ntgm/ntgm_get.pl will run the Perl script at 4 a.m. everyday to retrieve the data from Globe and Mail. It will look for the file, retry if not found, until 6 a.m. Most common problem is caused by the data file not available after 6 a.m. for retrieval. The system will send an error message to the support team to alert the problem. To retry downloading manually, simply sign on to the R30 and run the script /usr1/applic/ntgm/ntgm_get.pl. The data file can be found in the done directory and two log files in the log directory. WHen I retrieve this data from php to display on my webpage I get this: Globe and Mail data are retrieved and processed for CustomSearch. On the R30, the crontab entry: 0 4 * * 1-6 /usr1/applic/ntgm/ntgm_get.pl will run the Perl script at 4 a.m. everyday to retrieve the data from Globe and Mail. It will look for the fi The code I have in my php to display this text is: $query = SELECT * FROM knowledgeBase WHERE Title = '$title'; $result = mssql_query($query); $line = mssql_fetch_row($result); echo $line[2]; $line[2] because this data is in the second column of the mssql table of the row '$title' P.S. I have set the limit of the mssql table to have 8000 character, so it should exceed the limit, but I just don't know why it takes only 6 lines of the total 11 lines of what I had in the mssql table. Please advise! THANKS! Kelvin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing CSS files
Yeah... the same way you made your web server parse files with a .php extension. Just repeat the same procedure for a .css extension. if you have cpanel you can add the extension from there. Yeah, I need to find out where to add the CSS extension to my list of parsable files. I tried just sticking regular PHP code into a CSS file, and it didn't come out properly. I can't find the place where I can specify what files to parse, though. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and Front Page XP
$f1 is the temporary file namen your server, you need to use $f1_name, or even better $_FILES['f1']['name'] Tomás Liendo wrote: Hello people, I have the following strange problem: I designed a form with Front Page XP, and with PHP I save the fields in a MySQL data base. All fields work perfect, except one. This is a control to upload files: INPUT type=file name=f1 The problem is that in the data base the value selected for the user is not recorded. Instead of that a value as /tmp/phpd7Fski is recorded. I don't know if my problem is Front Page, PHP or my Web server (Apache)... As a test I printed the value of the varible $f1: ? echo $f1 ? This shows the following: /tmp/phpd7Fski, instead the value selected by the user. Well I hope somebody can help me, from already thank you very much, Tom. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Memory
Hello, Is there a way to know the memory that was used to execute a php page ? Thanks ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: XML+XSLT or Smarty again??
This xml+html+xslt paradigm provides great separation, especially when viewed in light of the traditional xslt=html+code method. I've used it with good success. http://www.xml.com/pub/a/2000/07/26/xslt/xsltstyle.html HTH. Pete. -- Pusher http://www.shaman.ca/pusher A news aggregator with email notification. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Crystal Reports in PHP via COM - SelectPrinter problem
Crystal Decisions provided a resolution to the problem. If the SelectPrinter method is called, the PaperOrientation method must also be set. So, to access Crystal Reports from PHP, the following code is used: $crapp = new COM(CrystalDesignRunTime.Application); $creport = $crapp-OpenReport(d:\\athermal\\reports\\backlog.rpt, 1); $creport-SelectPrinter(winspool, HP LaserJet 1200 Series PCL, Ne01:); $creport-PaperOrientation = 0; $creport-PrintOut(False); aap Andrew Powell wrote: I am receiving an error when attempting to use the SelectPrinter method in the CrystalDesignRunTime.Application COM object. The following code: - $crapp = new COM(CrystalDesignRunTime.Application); $creport = $crapp-OpenReport(d:\\athermal\\reports\\backlog.rpt, 1); $creport-SelectPrinter(winspool, HP LaserJet 1200 Series PCL, Ne01:); print DEBUG|.$creport-DriverName.|.$creport-PrinterName.|.$creport-PortName.|; $creport-PrintOut(False); - Produces the following output: - Content-type: text/html X-Powered-By: PHP/4.3.1 winspool|HP LaserJet 1200 Series PCL|Ne01:|br / bWarning/b: (null)(): Invoke() failed: Exception occurred. bSource/b: Crystal Reports ActiveX Designer bDescription/b: Error starting print job. Please check your printer or network connection. in bd:\athermal\temp\test.php/b on line b7/bbr / - Other items to note: - When the SelectPrinter line is commented out, the report prints fine to the default printer and the DEBUG line prints DEBUG|||. - If the PrintOut line is commented out, the DEBUG line prints DEBUG|winspool|HP LaserJet 1200 Series PCL|Ne01:| without any error. - If the PortName is not specified, or specified incorrectly on the SelectPrinter line, it is printed correctly on the DEBUG line. (i.e. if Ne00: is specified on the SelectPrinter line, Ne01: is reported on the DEBUG line.) I am in the process of converting an Intranet application from CGI4VB to PHP. Some of the scripts call Crystal Reports RDC to print to either PDF or their printer, which is mapped through the network on the server. I therefore need to call the SelectPrinter method. Any workarounds or patches for this would be very helpful. aap -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: XML+XSLT or Smarty again??
Pete James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This xml+html+xslt paradigm provides great separation, especially when viewed in light of the traditional xslt=html+code method. I've used it with good success. This does relieve the problem of dirty templates, but with some costs in inreased complexity. With TT you would have less things to do to achieve similar, but I assume that in the end it is largely a matter of taste and/or preferences. Sincerely, rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: XML+XSLT or Smarty again??
Pete James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This xml+html+xslt paradigm provides great separation, especially when viewed in light of the traditional xslt=html+code method. I've used it with good success. This does relieve the problem of dirty templates, but with some costs in inreased complexity. With TT you would have less things to do to achieve similar, but I assume that in the end it is largely a matter of taste and/or preferences. Sincerely, rush -- http://www.templatetamer.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date Problem - Last Day Of Month
Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat the months... What the code suppose to do is, makes a drop down box from which you can select the month, and if its the current month the box is already selected. select name=month ? for ($i=1; $i=12; $i++) { if ($i == date(m)) { print option selected value=\. $i . \ . date(F,mktime(0,0,0,$i,date(d),date(Y))) . /option; } else { print option value=\. $i . \ . date(F,mktime(0,0,0,$i,date(d),date(Y))) . /option; } } ? /select Thanks Vinesh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Problem - Last Day Of Month
Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat the months... I'm not sure what you mean by this, but I can be a moron on this list sometimes and the clear answer usually comes to me about 2 seconds after I hit the send button. Do you mean that you don't want any months in the SELECT control when it's the last of the month? Or you don't want the SELECTED attribute in the OPTION tags? As far as I can tell, you're not repeating any months, but you're only listing them once. Try this (and IMHO a *slight* *slight* improvement in clarity, but again, that's my HO): select name=month ? for ($counter=1; $counter=12; $counter++) { print option value=\. $counter . \; if (($counter == date(m)) || (date(d) date(t))) { print selected; } print . date(F,mktime(0,0,0,$counter,date(d),date(Y))) . /option; } } /select I adjusted it so that you only print out the SELECTED attribute if it's the current month, and I called $i as $counter, because, to me anyway, it makes it clearer what is the $counter. If $i works for you, though, there's nothing wrong with that, and it's not that it's unclear anyway, what with it in the FOR loop only a few lines earlier. (I'll shut up now about $counter.) Anyway, I added a comparison above that said if the current date is less than the last day of the month, then print SELECTED. That's assuming I have your question right in that you don't want to select the current month if it's the last day of that month. Otherwise, if I'm wrong, you can take that comparison and put it just about anywhere. Help? Doesn't? Am I a complete goof? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: XML+XSLT or Smarty again??
Hi, From my point of view, XML+XSLT increases complexity with very less number of advantages. Fundamental of using XML+XSLT with PHP is to seperate HTML code from the PHP and database code. But in the following article, it shows XSL stylesheet comes with full of logic. Do we really need this approach?? At this time i think smarty is separating the presentation from logic in the best manner. Please correct me if i am wrong. THanks Hardik --- rush [EMAIL PROTECTED] wrote: Pete James [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This xml+html+xslt paradigm provides great separation, especially when viewed in light of the traditional xslt=html+code method. I've used it with good success. __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing CSS files
Liam Gibbs wrote: Yeah... the same way you made your web server parse files with a .php extension. Just repeat the same procedure for a .css extension. if you have cpanel you can add the extension from there. Yeah, I need to find out where to add the CSS extension to my list of parsable files. I tried just sticking regular PHP code into a CSS file, and it didn't come out properly. I can't find the place where I can specify what files to parse, though. If you are using Apache, its the AddType line in httpd.conf. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: XML+XSLT or Smarty again??
IMO, Smarty is just an abstraction of PHP. Smarty templates are HTML templates, but they still contain their own application logic for looping, etc, and so are still not a real separation (or are *dirty*, as 'rush' calls it). XML+HTML+XSLT (or Template Tamer from what I can gather) take it the extra step. The application logic in PHP generates an XML data stream, which contains no dependencies on output. It is simply data. The XSLT parser parses the HTML template (which contains _only_ HTML and placeholders), and when it encounters a placeholder it executes the relevant XSLT code. This way, the design department can design the HTML fully, without having to learn PHP, Smarty, or any other syntax. They just put in placeholder tags wherever information from the XML file is needed. There are drawbacks to every abstraction, and templating is no different. Smarty templates are fast, and are enjoyed by a large user base for their relative simplicity. XML, XSLT, etc are complex and verbose, but provide for maximum abstraction. Template Tamer sounds like it combines the best from both (from what I've heard here). It is a matter of taste, I suppose. I think that people may sometimes waste more time trying to maximize the division between presentation and logic than it's worth. Well written PHP scripts can be almost as good a template as any (by separating the HTML and just using embedded variables). HTH, Pete. -- Pusher http://www.shaman.ca/pusher A news aggregator with email notification. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Problem - Last Day Of Month
change for ($i=1; $i=12; $i++) to for ($i=1; $i12; $i++) --- Vinesh Hansjee [EMAIL PROTECTED] wrote: Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat the months... What the code suppose to do is, makes a drop down box from which you can select the month, and if its the current month the box is already selected. select name=month ? for ($i=1; $i=12; $i++) { if ($i == date(m)) { print option selected value=\. $i . \ . date(F,mktime(0,0,0,$i,date(d),date(Y))) . /option; } else { print option value=\. $i . \ . date(F,mktime(0,0,0,$i,date(d),date(Y))) . /option; } } ? /select Thanks Vinesh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GNU Open Source
Hi, This is a list for questions about PHP. Look in the titlebar of your browser when you go to www.php.net He was asking *where* PHP stands (regarding licenses), not *what* PHP stands for. Maybe PHP FAQ should have something about licenses. Indeed, I did find somehting ... in the licence FAQ (frequently asked question) section: http://www.php.net/license/ discusses: (I don't mean to frequently ask :) ) GPL enforces many restrictions on what can and cannot be done with the licensed code. The PHP developers decided to release PHP under a much more loose license ... But you don't go into any further detail. What I would like to know is what are the restrictions? A couple of examples would suffice. In a nutshell ... Something I can document in an academic paper I am presenting on the utility of PHP MySQL combination and how it improved our research mindset. Rasmus: I understand there are differences between GNU.org OpenSource.org but I didn't mean to offend anyone. Sorry Rasmus, but I was surprised you would answer that way. Is this a touchy subject? The General list should be the correct place to ask? John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Problem - Last Day Of Month
- Original Message - From: Vinesh Hansjee [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 31, 2003 6:55 AM Subject: [PHP] Date Problem - Last Day Of Month Hi there, can anyone tell me how to fix my code so that on the last day of the month, my code doesn't repeat the months... What the code suppose to do is, makes a drop down box from which you can select the month, and if its the current month the box is already selected. select name=month ? for ($i=1; $i=12; $i++) { if ($i == date(m)) { print option selected value=\. $i . \ . date(F,mktime(0,0,0,$i,date(d),date(Y))) . /option; } else { print option value=\. $i . \ . date(F,mktime(0,0,0,$i,date(d),date(Y))) . /option; } } ? /select Thanks Vinesh Vinesh, there's a fundemental flaw in your logic. The date(d) input will fail to produce a reliable list if it is executed on any day after the 28th of the month. Since today is the 31st obviously this is going to cause some problems becuase any month that ends on the 30th or earlier will return plus one the month. So February will return March, April willl return May, and so on. If you wait until tommorrow (the 1st) your function will magically work. :) One way to fix this is to build your own array of month names and reference that instead of using the date() function. $months = array(1=January, 2=February, 3=March, 4=April, 5=May, 6= ... and so on...); for($i=1; $i=12; $i++) { $selected = ; if ($i == date(m));{$selected = SELECTED;} echo option $selected value=\${months[$i]}\\n; } HTH, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Is there a PHP for Dummies?
I tend to get more out of the users comments than the actual manual.. It is possible that is because you don't want to put the time into figuring things out for yourself. It's a lot easier to post a ton of RTFM questions than to actually read the manual or research your question. I seem to recall you having the same problem with the MySQL documentation. -Original Message- From: Beauford.2002 [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 6:52 PM To: Leif K-Brooks Cc: PHP General Subject: Re: [PHP] Is there a PHP for Dummies? I found that after the fact, but my question was regarding tutorials, books, or other docs. This was just an example I used. In general I don't find the PHP manual very helpful - I tend to get more out of the users comments than the actual manual.. - Original Message - From: Leif K-Brooks [EMAIL PROTECTED] To: Beauford.2002 [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, March 28, 2003 9:49 PM Subject: Re: [PHP] Is there a PHP for Dummies? After a quick search of the php manual, I came upon http://www.php.net/manual/en/ref.info.php#ini.magic-quotes-gpc, which says: Sets the magic_quotes state for GPC (Get/Post/Cookie) operations. When magic_quotes are on, all ' (single-quote), (double quote), \ (backslash) and NUL's are escaped with a backslash automatically. Seems to explain it pretty nicely. Beauford.2002 wrote: No, the name explains absolutely squat. What is a magic quote? Sounds like something I smoked in the 60's. Maybe to you it makes sense as you know what it does. To me it means absolutely nothing - nor does the PHP manual explain it. B. - Original Message - From: Jennifer Goodie [EMAIL PROTECTED] To: Beauford.2002 [EMAIL PROTECTED]; PHP General [EMAIL PROTECTED] Sent: Friday, March 28, 2003 5:07 PM Subject: RE: [PHP] Is there a PHP for Dummies? That is a really, really, really poor example. Tha name says it all. It gets the magic quotes setting for gpc(get, post, cookie). You can figure out what most PHP functions do just by looking at their names, that's actually what I like about PHP. -Original Message- From: Beauford.2002 [mailto:[EMAIL PROTECTED] Sent: Friday, March 28, 2003 1:54 PM To: PHP General Subject: [PHP] Is there a PHP for Dummies? I'm really tired of trying to figure out the PHP manual and need something that explains things in plain straight forward English. Like get_magic_quotes_gpc() for example - the manual says how to use it and what it returns - but nowhere can I find out what it's for. Does it count sheep, do a quote of the day, or what - maybe I'm just stupid - but in any event I have spent more time in the last two weeks searching for things and getting no answers - Any help in pointing me a good straight forward tutorial/manual would be appreciated. B. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- 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] GNU Open Source
--- John Taylor-Johnston [EMAIL PROTECTED] wrote: Rasmus: I understand there are differences between GNU.org OpenSource.org but I didn't mean to offend anyone. Sorry Rasmus, but I was surprised you would answer that way. Is this a touchy subject? The General list should be the correct place to ask? John, I think the main point is that this question is completely off-topic. Neither gnu.org nor opensource.org are sites that have anything to do with using PHP. As for licenses, you can read PHP's here: http://cvs.php.net/co.php/php4/LICENSE?login=2r=1.22. Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] require/include from a different directory
If the includes are within the website, using $_SERVER[DOCUMENT_ROOT]/pathtofile/file is a good way to go. -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 2:10 PM To: 'Greg Macek'; [EMAIL PROTECTED] Subject: RE: [PHP] require/include from a different directory try using an absolute path. I've considered that route, but an issue I have with that is I do most of my development work on a machine that a different directory structure than the production server (currently a Cobalt RaQ4), so the paths are different. Accommodating both would be a time consuming project for me. I always put it into a variable. $_CONF['path'] = '/home/web/www/'; and then use that variable in all of your includes or requires. I also make an HTML variable that's used in all links and images. $_CONF['html'] = 'http://www.mysite.com/'; Sure, you have to get used to using this variable everywhere, but it makes switching server pretty easy. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.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] php with mcrypt
Hey guys, How can I enable php to work with mcrypt functions? I´m using debian woody linux. I´ve had installed libmcrypt already, from debian cds. But I dont know how to make php understands this lib. thanks --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.465 / Virus Database: 263 - Release Date: 25/03/03 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php and mysql
I have a db with events in it. i would like to pull the events out via php, but i would like them to be ordered by month number (1-12). When I do this (Select blah blah From blah Order By Month_Start ASC) it orders the months by number, but it starts with october (month 10) I am pretty sure it is doing this because I have no events until april (month 4). So how can i get it to order the months by their numbers starting with january (1) and going to december (12) even if I do not have events until april (4)? _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] date() and mktime() functions: weeknumbers and months.
Thanks Jason and Marek, I was thinking to difficult, Thanks for the quick responses. Best regards, Davy Obdam -Oorspronkelijk bericht- Van: Jason Wong [mailto:[EMAIL PROTECTED] Verzonden: maandag 31 maart 2003 16:36 Aan: [EMAIL PROTECTED] Onderwerp: Re: [PHP] date() and mktime() functions: weeknumbers and months. On Monday 31 March 2003 22:07, Davy Obdam wrote: I would like to select news from my database bases on week/year and month/year. How can i do this.. I would like to pass two arguments in the query string, like news.php?week=14year=2003 or news.php?month=3year=2003. Can anybody help me.. Thanks in advance. I have been looking at the date() and mktime() functions, but is there anyway to determine the date from a weeknumber? I have been using this: [snip] $sql = SELECT * FROM news WHERE date='$last_sunday' AND date='$next_saturday'). But i would find it better to use a weeknumber instead If you're using mysql you can do something like: SELECT * FROM news WHERE WEEK(date) = some_week_number_or_another If you're using some other DBMS check whether it has some similar function. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* We can predict everything, except the future. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Deze e-mail is door E-mail VirusScanner van Planet Internet gecontroleerd op virussen. Op http://www.planet.nl/evs staat een verwijzing naar de actuele lijst waar op wordt gecontroleerd. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 31 Mar 2003 19:42:36 -0000 Issue 1971
php-general Digest 31 Mar 2003 19:42:36 - Issue 1971 Topics (messages 141681 through 141723): Dynamic include_path 141681 by: Derek J. Belrose exec different result from command line 141682 by: Jan-Hendrik [Newbie] Password() 141683 by: Bobby Rahman 141684 by: Chris Hayes 141685 by: Jon Haworth Re: File access denied!!! 141686 by: Marek Kilimajer Re: Microsoft SQL Server varchar(500) field text concatenated at 255 characters. 141687 by: Adam Voigt Re: Classes 141688 by: Marek Kilimajer Re: line feeds 141689 by: Marek Kilimajer date() and mktime() functions: weeknumbers and months. 141690 by: Davy Obdam 141693 by: Marek Kilimajer 141694 by: Jason Wong 141723 by: Davy Obdam accessing protected remote files 141691 by: David Feldman 141692 by: Marek Kilimajer 141698 by: David Feldman GMT strtotime() problem today!! 141695 by: Stuart Cochrane Re: Adding a URL 141696 by: Scott Thompson PHP and Front Page XP 141697 by: Tomás Liendo 141701 by: Marek Kilimajer MSSQL/PHP Problem 141699 by: Poon, Kelvin (Infomart) Re: Parsing CSS files 141700 by: Liam Gibbs 141710 by: Chris Hewitt Memory 141702 by: Php general Re: XML+XSLT or Smarty again?? 141703 by: Pete James 141705 by: rush 141706 by: rush 141709 by: Hardik Doshi 141711 by: Pete James Re: Crystal Reports in PHP via COM - SelectPrinter problem 141704 by: Andrew Powell Date Problem - Last Day Of Month 141707 by: Vinesh Hansjee 141708 by: Liam Gibbs 141712 by: Daniel Guerrier 141714 by: Kevin Stone 141720 by: Daniel Guerrier Re: GNU Open Source 141713 by: John Taylor-Johnston 141716 by: Chris Shiflett 141721 by: Rasmus Lerdorf Re: Is there a PHP for Dummies? 141715 by: Jennifer Goodie Re: require/include from a different directory 141717 by: Jennifer Goodie php with mcrypt 141718 by: Gilberto Garcia Jr. php and mysql 141719 by: Tyler Durdin 141722 by: Tyler Durdin Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hey folks, What we are looking to do is give a specific include path for each site in our customer base. This running on MacOSX so basically we have sites set up like: /Users/username/Sites/site.com/phpinc There can be numerous sites in each users directory and numerous users in /Users. Basically what we want to do is have each set up to be able to include only from their include directory, but the boss is wondering if it can be done on one or two lines for every site total. Basically looking for something like this: Directory /Users/*/Sites/*/phpinc php-value include_path = . /Directory or something like it. Is this possible? Or should we just go ahead and set it in each sites declaration? Derek ---End Message--- ---BeginMessage--- Hi folks ! I've got a strage problem I don't know how to solve: I am calling ImageMagick's identify. If I do that via command line, I get a textline as result with all images. If I do the same with exec or passthru, I only get results with certain image-types. Does anyone have any idea of what the problem could be ? thanks ! ---End Message--- ---BeginMessage--- Hi, in my code I am trying to send an email (containing a password) to a user when he has forgotten his password. The problem is that security leads to needing to encrypt passwords in the database. Im using the password function within mysql. Is there any way of reversing the password function() to get the original password to send out to the user? Or are there any other suggestions in PHP to reverse encryption of passwords. I do understand the principles of encryption and can see the point of unreversible functions but Im sure that not all applications re-set passwords with random generated ones but do send out forgotten passwords. Cheers B _ Worried what your kids see online? Protect them better with MSN 8 http://join.msn.com/?page=features/parentalpgmarket=en-gbXAPID=186DI=1059 ---End Message--- ---BeginMessage--- in my code I am trying to send an email (containing a password) to a user when he has forgotten his password. The problem is that security leads to needing to encrypt passwords in the database. Im using the password function within mysql. Is there any way of reversing the password function() to get the original password to send out to the user? Or are there any other suggestions in PHP to reverse encryption of passwords. I do
[PHP] if statment
I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] if statment
if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parsing CSS files
Why do you need to do this in the first place? If you're trying to create dynamic CSS, the .php extension will be fine as long as you send the proper content-type header. Liam Gibbs wrote: Is there any way of making PHP parse files with a CSS extension? -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if statment
My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] if statment
so change it to -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- 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] Re: if statment
if ( !isset($HTTP_GET_VARS[pr_ID]) OR empty($HTTP_GET_VARS[pr_ID]) ) HTH R'twick Tim Haskins [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if statment
Wow, that's weird- I had just tried it and that didn't work, so I thought it might be some special php thing goin on- thanks for your help! -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] so change it to -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- 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] if statment
Also, take a look at isset() and empty() http://php.net/empty http://php.net/isset Jennifer Goodie wrote: so change it to -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] if statment
I'm pretty sure that if it was in a form but left blank isset() won't work because it is set in the globals, it is just empty. I've never used empty(), so I cannot comment on its behavior. -Original Message- From: Pete James [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:17 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment Also, take a look at isset() and empty() http://php.net/empty http://php.net/isset Jennifer Goodie wrote: so change it to -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Excel
I've got one here -- http://jonroig.com/modules.php?op=modloadname=Newsfile=articlesid=55 (Watch out, url may wrap wrong) That is, if you're just looking to export data to excel... -- jon -Original Message- From: Evan Nemerson [mailto:[EMAIL PROTECTED] Sent: Thursday, March 27, 2003 1:47 PM To: Gabi Moise; [EMAIL PROTECTED] Subject: Re: [PHP] Excel -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Not exactly, but http://pear.php.net/package-info.php?pacid=156 On Thursday 27 March 2003 05:47 am, Gabi Moise wrote: Hi, Can someone point me to a php and Excel tutorial? tnx. - -- First they came for the Communists, and I didn't speak up, because I wasn't a Communist. Then they came for the Jews, and I didn't speak up, because I wasn't a Jew. Then they came for the Catholics, and I didn't speak up, because I was a Protestant. Then they came for me, and by that time there was no one left to speak up for me. - -Martin Niemoller -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE+g0c3/rncFku1MdIRApbWAKCyeYSh+AxzuBoqz73H7lMTbnBnQwCggdvv ZmDL1xWz1fdxvvrVJM+YLmU= =wm4h -END PGP SIGNATURE- -- 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] COM
Is there some reason you want to access it through com? I'm assuming that you've added the access db as an odbc data source? I'm not sure, but it seems like you might be using the wrong syntax. You might want to check out this: http://www.php.net/manual/en/ref.odbc.php ... or... this, which is a good example of how to use odbc in php: http://php.weblogs.com/odbc Also, is it giving you an error or just not returning results? -- jon - jon roig senior manager, online production epilepsy foundation http://jonroig.com -Original Message- From: Kiswa [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 4:17 AM To: [EMAIL PROTECTED] Subject: [PHP] COM Server Win2000 +ISS5 +PHP Trying to get access to an access DB through COM but i wont work. there is no results generated. Can anyone help me Here is the code $rownum =0; $conn = ADONewConnection('access'); $conn-PConnect('webdb.mdb'); $result = $conn-Execute('SELECT Produkt, Artikelnr, Pris, Lagerstatus, Beskrivning, Kategori, Bild FROM Data'); while(odbc_fetch_row($result)){ $Produkt = odbc_result($result, Produkt); $Artikelnr = odbc_result($result, Artikelnr); $Pris = odbc_result($result, Pris); $Lagerstatus = odbc_result($result, Lagerstatus); $Beskrivning = odbc_result($result, Beskrivning); $Kategori = odbc_result($result, Kategori); $Bild = odbc_result($result, Bild); -- 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] if statment
below is what I have currently ?php if ($HTTP_GET_VARS[id] == ) { ? its empty ?php }? Now when I change the == to I receive the following error: Notice: Undefined index: id in c:\inetpub\wwwroot\_\users.php on line 103 Why would that not work - In asp it does, but I can't get it workin in php. If that doesn't make sense, I would like to have an if statement the says, if HTTP_GET_VARS[id] is NOT empty then show something else Thanks for you guy's help and time -- Tim Haskins Tim Haskins [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Wow, that's weird- I had just tried it and that didn't work, so I thought it might be some special php thing goin on- thanks for your help! -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] so change it to -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- 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] if statment
Because not equal is !=, not I think I posted a link to the documentation a few eamils ago in this thread. Check it out, these are all really easy syntax questions, so you'll save yourself much hair pulling by just reading the section on basic syntax. -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:27 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment below is what I have currently ?php if ($HTTP_GET_VARS[id] == ) { ? its empty ?php }? Now when I change the == to I receive the following error: Notice: Undefined index: id in c:\inetpub\wwwroot\_\users.php on line 103 Why would that not work - In asp it does, but I can't get it workin in php. If that doesn't make sense, I would like to have an if statement the says, if HTTP_GET_VARS[id] is NOT empty then show something else Thanks for you guy's help and time -- Tim Haskins Tim Haskins [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Wow, that's weird- I had just tried it and that didn't work, so I thought it might be some special php thing goin on- thanks for your help! -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] so change it to -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- 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] str_replace() problem
I am performing a str_replace() on a large string, and everything works fine, except that two of the elements I'm searching for (and replacing) have the same first letters. To keep it the issue clear, here's a simple example of what I'm talking about: Blue Blueberry Now, if I use: str_replace(Blue,Red,$paragraph); str_replace(Blueberry,Strawberry,$paragraph); ...all occurrences of Blueincluding Blueberrywill be replaced with Red. The result will be something like: Red Redberry ...But what I want is... Red Strawberry I need str_replace to somehow only search for a complete occurrence of each item. How do I do that? I've read the docs, and I just can't see any examples. Thanks. ...Rene --- Ren Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if statment
--- Tim Haskins [EMAIL PROTECTED] wrote: Now when I change the == to I receive the following error: Notice: Undefined index: id in c:\inetpub\wwwroot\_\users.php on line 103 Why would that not work - In asp it does, but I can't get it workin in php. Are you kidding? You do realize that ASP and PHP are not the same thing, right? If that doesn't make sense, I would like to have an if statement the says, if HTTP_GET_VARS[id] is NOT empty then show something else if (!empty($_GET['id'])) { echo 'Something else'; } Chris = Become a better Web developer with the HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: XML+XSLT or Smarty again??
wow thanks ! i've been looking for some example like this for a very long time , does it mean that the templates becomes similar to the template block ? -Original Message- From: Pete James [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 2:08 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: XML+XSLT or Smarty again?? This xml+html+xslt paradigm provides great separation, especially when viewed in light of the traditional xslt=html+code method. I've used it with good success. http://www.xml.com/pub/a/2000/07/26/xslt/xsltstyle.html HTH. Pete. -- Pusher http://www.shaman.ca/pusher A news aggregator with email notification. -- 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] GNU Open Source
Rasmus, I hardly call it a school paper. I haven't done one of them in 25 years. But if you are not the one to ask, nor is the general list not the place to ask, who do I email or where do I post to find out more about your statement at: http://www.php.net/license/ GPL enforces many restrictions on what can and cannot be done with the licensed code. Chris' response: http://cvs.php.net/co.php/php4/LICENSE?login=2r=1.22. Is interesting, but does not answer the question. Sorry to bother, John examples of restrictions mentionned http://www.php.net/license/ Rasmus: I understand there are differences between GNU.org OpenSource.org but I didn't mean to offend anyone. Sorry Rasmus, but was surprised you would answer that way. Is this a touchy subject? General list should be the correct place to ask? No, the php-general list is not the place for you to do your open source license research for your school paper. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question on response time, SQL vs. PHP
I'm trying to do a count(*) in SQL. Would it be faster to do a or b below? a: just do a simple query, and use mysql_num_rows() to return the row count; or b: do the count(*) and use mysql_fetch_row() to return the result. I guess it would have to do more with SQL response time (is it faster to grab the count and then the row, or all rows in question and then do a count in PHP).
Re: [PHP] str_replace() problem
- Original Message - From: Ren Fournier [EMAIL PROTECTED] To: php [EMAIL PROTECTED] Sent: Monday, March 31, 2003 1:52 PM Subject: [PHP] str_replace() problem I am performing a str_replace() on a large string, and everything works fine, except that two of the elements I'm searching for (and replacing) have the same first letters. To keep it the issue clear, here's a simple example of what I'm talking about: Blue Blueberry Now, if I use: str_replace(Blue,Red,$paragraph); str_replace(Blueberry,Strawberry,$paragraph); ...all occurrences of Blueincluding Blueberrywill be replaced with Red. The result will be something like: Red Redberry ...But what I want is... Red Strawberry I need str_replace to somehow only search for a complete occurrence of each item. How do I do that? I've read the docs, and I just can't see any examples. Thanks. ...Rene --- Ren Fournier, [EMAIL PROTECTED] You might be able to be more precise using ereg_replace(). But I donot know the regular expression to make it happen. Or if your situation allows it you can hack it by appending a single space on the end of each input. Either way what you need to do is give the script more information about exactly what you want to replace. echo str_replace(Blue , Red , $paragraph); HTH, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] str_replace() problem
You could replace the longer one, Blueberry, first. Then, the only remaining occurrences of Blue will be ones that you really want. Kirk I am performing a str_replace() on a large string, and everything works fine, except that two of the elements I'm searching for (and replacing) have the same first letters. To keep it the issue clear, here's a simple example of what I'm talking about: Blue Blueberry Now, if I use: str_replace(Blue,Red,$paragraph); str_replace(Blueberry,Strawberry,$paragraph); ...all occurrences of Blueincluding Blueberrywill be replaced with Red. The result will be something like: Red Redberry ...But what I want is... Red Strawberry -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] str_replace() problem
Just change the order and do the search and replace on Blueberry before doing it on Blue. Ei: str_replace(Blueberry,Strawberry,$paragraph); str_replace(Blue,Red,$paragraph); or: str_replace(array(Blueberry, Blue), array(Strawberry, Red), $paragraph); _ Marcus Rasmussen [EMAIL PROTECTED] www.marcusr.dk - On 31-03-2003 at 13:52 René Fournier wrote: - I am performing a str_replace() on a large string, and everything works fine, except that two of the elements I'm searching for (and replacing) have the same first letters. To keep it the issue clear, here's a simple example of what I'm talking about: Blue Blueberry Now, if I use: str_replace(Blue,Red,$paragraph); str_replace(Blueberry,Strawberry,$paragraph); ...all occurrences of Blueincluding Blueberrywill be replaced with Red. The result will be something like: Red Redberry ...But what I want is... Red Strawberry I need str_replace to somehow only search for a complete occurrence of each item. How do I do that? I've read the docs, and I just can't see any examples. Thanks. ...Rene --- René Fournier, [EMAIL PROTECTED] Toll-free +1.888.886.2754 Tel +1.403.291.3601 Fax +1.403.250.5228 www.smartslitters.com SmartSlitters International #33, 1339 - 40th Ave NE Calgary AB T2E 8N6 Canada -- 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] Question on response time, SQL vs. PHP
It is faster to do a count(*) -Original Message- From: Liam Gibbs [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 1:31 PM To: php list Subject: [PHP] Question on response time, SQL vs. PHP I'm trying to do a count(*) in SQL. Would it be faster to do a or b below? a: just do a simple query, and use mysql_num_rows() to return the row count; or b: do the count(*) and use mysql_fetch_row() to return the result. I guess it would have to do more with SQL response time (is it faster to grab the count and then the row, or all rows in question and then do a count in PHP). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: if statment
if ($HTTP_GET_VARS[pr_ID] = nothing ) { } else if ($HTTP_GET_VARS[pr_ID] = something) { } else { } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problems with curl + exec
hi guys , this is a wierd problem , for some reason wget is fine to return stderr to stdoutput , i'll get an exact error in key 4 , ie OK or HTTP 404 , but with curl it is not returning the exact errorode or outputting an error ? here are my instructions although for a 404 instead of 22 i am getting an errorcode of 23 or sometimds even 6 ? $execstring=escapeshellcmd($this-command. -stderr error -v --fail -O .$url. 21 .$options); @exec($execstring, $stdout, $errorcode); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with mysql.
ok i've reinstalled phpseveral times now, reinstalled mysql, and even reinstalled apache once but i am still getting this same problem. when configuring php i use --with-mysql and it configures just fine. i've even added an =/path/to/php after it to no avail. i keep getting this on pages that use MYSQL: PHP ERROR: PHP build incomplete: the prerequisite MySQL support required to read the alert database was not built into PHP. Please recompile PHP with the necessary library (--with-mysql) anyone else had this problem and found a fix? (also, i've rebooted the server and restarted httpd and that didnt start it working.) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: if statment
in addition to my last response, if you go to http://www.php.net/manual/en/ you can find more than you ever wanted to know about php. just use the search at the top. Tim Haskins[EMAIL PROTECTED] 03/31/03 01:56PM I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problems with curl + exec
sorry worked it out i had stderr in the escape string -Original Message- From: Dan Rossi [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 7:39 AM To: Php-General Subject: [PHP] problems with curl + exec hi guys , this is a wierd problem , for some reason wget is fine to return stderr to stdoutput , i'll get an exact error in key 4 , ie OK or HTTP 404 , but with curl it is not returning the exact errorode or outputting an error ? here are my instructions although for a 404 instead of 22 i am getting an errorcode of 23 or sometimds even 6 ? $execstring=escapeshellcmd($this-command. -stderr error -v --fail -O .$url. 21 .$options); @exec($execstring, $stdout, $errorcode); -- 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] problem with mysql.
Hi Ryan, when configuring php i use --with-mysql and it configures just fine. i've even added an =/path/to/php after it to no avail. Try --with-mysql=/path/to/mysql instead of --with-mysql=/path/to/php. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem installing PHP 4.3.1 - won't compile due to odd error.
Hi, Trying to install PHP 4.3.1 but getting the following error message: configure error: cURL version 7.9.8 or later is required to compile php with cURL support I have curl installed; when I issue a curl -V, the version number reported is 7.10.3 Can anyone tell me what the install is looking for? Thanks in advance, Don --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.465 / Virus Database: 263 - Release Date: 3/25/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Files uploads problem
I am a learner in PHP - I have been using Larry Ullman's Peachpit beginners book which I have found useful to take me through the basics. But the examples were written before the general applicaton of the new $_POST, $_GET and similar arrays. It has been valuable learning to change the code for that (I use version 4.2. (and a bit) and Larry Ullman is very helpful on his own website forum with readers' queries on the book examples. But I am having real trouble making a file upload programme work. It needs substitution of $FileName given in the example with $_FILES array values which I have done and use of isset instead of a raw if(). But I still cannot get it to work May I put the code here and ask if anyone can tell me the problme. Incidentally I use Windows ME with Apache 2.0.36 and PHP 4.2.. The files upload is on with a max size of 2M and no specific directory given for a temp store (the INI says it will use the default directory.) My test out script is as follows::- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleUploader/title /head body ?php if(isset($_FILES['File'])) { $File=$_FILES['File']; $File_name=$_FILES['File']['name']; $File_size=$_FILES['File']['size']; echo (p$File_name/pbr /\n); echo ($_FILES['File']['name']); print(File name: $File_namep /\n); print(File size: $File_sizep /\n); if (copy ($_FILES[File][tmp_name],users/$File_name)) { print(The file was sucessfully uploaded.p /\n); }else{ print(Your file could not be copied unfortunately.p /\n); } unlink($File); } echo (Upload a file to the server.); echo (Form action=\FileUpload.php\ method=POST enctype=\multipart/form-data\\n); echo (File: input type=file name=\File\br /\n); echo (input type=submit name=\submit\ value=\Press here to upload.\br // form\n); //test whether anything prints for the FILES array echo (pemfont color=\green\Can I get it to print the variable outside the conditional? i.e. this one {$_FILES['File']['name']}./font/em/p\n); //set any old variable and print it to be sure basics work $TestPrint=pbigfont color=\purple\Print this out then./font/big/p.\n; echo($TestPrint); ? /body /html Is there something I've missed in the script. Or perhaps Apache 2 is the problem? Thanks Regards Adrian Greeman Telephone +44 20 8672 9661 Mobile +44 780 329 7447 E-mail adresses [EMAIL PROTECTED] or [EMAIL PROTECTED] **Please note - there is a 400kB filter on my e-mail so if you send a large item (eg a JPEG pic) please also send a separate smaller message to tell me the other one is coming. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if statment
On 31-Mar-2003 Tim Haskins wrote: My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. if (empty($HTTP_GET_VARS[pr_ID])) Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] if statment
You should be using if(!isset($HTTP_GET_VARS['id'])){ Otherwise, it generates an eror when it simply doesn't exist. and nothing (an unset variable) are NOT the same. Tim Haskins wrote: below is what I have currently ?php if ($HTTP_GET_VARS[id] == ) { ? its empty ?php }? Now when I change the == to I receive the following error: Notice: Undefined index: id in c:\inetpub\wwwroot\_\users.php on line 103 Why would that not work - In asp it does, but I can't get it workin in php. If that doesn't make sense, I would like to have an if statement the says, if HTTP_GET_VARS[id] is NOT empty then show something else Thanks for you guy's help and time -- Tim Haskins Tim Haskins [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Wow, that's weird- I had just tried it and that didn't work, so I thought it might be some special php thing goin on- thanks for your help! -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] so change it to -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 12:12 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] if statment My bad, I actually meant that the nothing was like, if the pr_ID in the url is empty then show the following text. -- Tim Haskins Jennifer Goodie [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] if( $HTTP_GET_VARS[pr_ID] == nothing){ echo there are no products; } http://www.php.net/manual/en/control-structures.php http://www.php.net/manual/en/ -Original Message- From: Tim Haskins [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 11:56 AM To: [EMAIL PROTECTED] Subject: [PHP] if statment I'm used to asp and not php, but what would the code be for and if statement that was like: if $HTTP_GET_VARS[pr_ID] = nothing then there are no products end if Also does anyone know a great resource that lists different examples of php variables, if statements, and so on? Thanks so much! -- Tim Haskins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.
Re: [PHP] Files uploads problem
- Original Message - From: Adrian Greeman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, March 31, 2003 3:04 PM Subject: [PHP] Files uploads problem I am a learner in PHP - I have been using Larry Ullman's Peachpit beginners book which I have found useful to take me through the basics. But the examples were written before the general applicaton of the new $_POST, $_GET and similar arrays. It has been valuable learning to change the code for that (I use version 4.2. (and a bit) and Larry Ullman is very helpful on his own website forum with readers' queries on the book examples. But I am having real trouble making a file upload programme work. It needs substitution of $FileName given in the example with $_FILES array values which I have done and use of isset instead of a raw if(). But I still cannot get it to work May I put the code here and ask if anyone can tell me the problme. Incidentally I use Windows ME with Apache 2.0.36 and PHP 4.2.. The files upload is on with a max size of 2M and no specific directory given for a temp store (the INI says it will use the default directory.) My test out script is as follows::- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleUploader/title /head body ?php if(isset($_FILES['File'])) { $File=$_FILES['File']; $File_name=$_FILES['File']['name']; $File_size=$_FILES['File']['size']; echo (p$File_name/pbr /\n); echo ($_FILES['File']['name']); print(File name: $File_namep /\n); print(File size: $File_sizep /\n); if (copy ($_FILES[File][tmp_name],users/$File_name)) { print(The file was sucessfully uploaded.p /\n); }else{ print(Your file could not be copied unfortunately.p /\n); } unlink($File); } echo (Upload a file to the server.); echo (Form action=\FileUpload.php\ method=POST enctype=\multipart/form-data\\n); echo (File: input type=file name=\File\br /\n); echo (input type=submit name=\submit\ value=\Press here to upload.\br // form\n); //test whether anything prints for the FILES array echo (pemfont color=\green\Can I get it to print the variable outside the conditional? i.e. this one {$_FILES['File']['name']}./font/em/p\n); //set any old variable and print it to be sure basics work $TestPrint=pbigfont color=\purple\Print this out then./font/big/p.\n; echo($TestPrint); ? /body /html Is there something I've missed in the script. Or perhaps Apache 2 is the problem? Thanks Couple of HTML problems to point out. Where you have br // form\n, / form is an invalid tag. Remove the space. Also where you have enctype=\multipart/form-data\ you need quotes after the slashes (ie. \) otherwise PHP is going to assume that you want the litteral slash in the HTML. Niether of these errors will return visable error code but both will result in you not being able to submit the form. Also when you go to unlink($File); you're going to see an error becuase $File is not a valid file path, it's an array. Besides you shouldn't worry about trying to clean up the temp file. PHP will do it automatically when the script exists. :-) HTH, Kevin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] problem with mysql.
Sorry about that. i did use /path/to/mysql. i wasnt paying attention when writing my pervious post. -Ryan Jon Haworth[EMAIL PROTECTED] 03/31/03 04:00PM Hi Ryan, when configuring php i use --with-mysql and it configures just fine. i've even added an =/path/to/php after it to no avail. Try --with-mysql=/path/to/mysql instead of --with-mysql=/path/to/php. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Files uploads problem
You should tell us 1. What happens 2. What you expected to happen that didn't happen. As Kevin points out your enctype will be wrong but if that doesn't fix it then I'd guess at the Apache 2. But tell us what the output is anyway. - Original Message - From: Adrian Greeman [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, March 31, 2003 5:04 PM Subject: Files uploads problem I am a learner in PHP - I have been using Larry Ullman's Peachpit beginners book which I have found useful to take me through the basics. But the examples were written before the general applicaton of the new $_POST, $_GET and similar arrays. It has been valuable learning to change the code for that (I use version 4.2. (and a bit) and Larry Ullman is very helpful on his own website forum with readers' queries on the book examples. But I am having real trouble making a file upload programme work. It needs substitution of $FileName given in the example with $_FILES array values which I have done and use of isset instead of a raw if(). But I still cannot get it to work May I put the code here and ask if anyone can tell me the problme. Incidentally I use Windows ME with Apache 2.0.36 and PHP 4.2.. The files upload is on with a max size of 2M and no specific directory given for a temp store (the INI says it will use the default directory.) My test out script is as follows::- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleUploader/title /head body ?php if(isset($_FILES['File'])) { $File=$_FILES['File']; $File_name=$_FILES['File']['name']; $File_size=$_FILES['File']['size']; echo (p$File_name/pbr /\n); echo ($_FILES['File']['name']); print(File name: $File_namep /\n); print(File size: $File_sizep /\n); if (copy ($_FILES[File][tmp_name],users/$File_name)) { print(The file was sucessfully uploaded.p /\n); }else{ print(Your file could not be copied unfortunately.p /\n); } unlink($File); } echo (Upload a file to the server.); echo (Form action=\FileUpload.php\ method=POST enctype=\multipart/form-data\\n); echo (File: input type=file name=\File\br /\n); echo (input type=submit name=\submit\ value=\Press here to upload.\br // form\n); //test whether anything prints for the FILES array echo (pemfont color=\green\Can I get it to print the variable outside the conditional? i.e. this one {$_FILES['File']['name']}./font/em/p\n); //set any old variable and print it to be sure basics work $TestPrint=pbigfont color=\purple\Print this out then./font/big/p.\n; echo($TestPrint); ? /body /html Is there something I've missed in the script. Or perhaps Apache 2 is the problem? Thanks Regards Adrian Greeman Telephone +44 20 8672 9661 Mobile +44 780 329 7447 E-mail adresses [EMAIL PROTECTED] or [EMAIL PROTECTED] **Please note - there is a 400kB filter on my e-mail so if you send a large item (eg a JPEG pic) please also send a separate smaller message to tell me the other one is coming. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with mysql.
Right, defaults to /usr/local/ for the source versions of MySQL, in that case, use --with-mysql=/usr/local - Original Message - From: Jon Haworth [EMAIL PROTECTED] Newsgroups: php.general To: Ryan Vennell [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, March 31, 2003 5:00 PM Subject: RE: [PHP] problem with mysql. Hi Ryan, when configuring php i use --with-mysql and it configures just fine. i've even added an =/path/to/php after it to no avail. Try --with-mysql=/path/to/mysql instead of --with-mysql=/path/to/php. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php and mysql
Assuming Month_Start is stored in MySQL date format (-mm-dd) you could Select blah blah From blah Order By DATE_FORMAT(Month_Start,%m) ASC The %m will pad on the zeroes. http://www.mysql.com/doc/en/Date_and_time_functions.html - Original Message - From: Tyler Durdin [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Monday, March 31, 2003 1:53 PM Subject: php and mysql I have a db with events in it. i would like to pull the events out via php, but i would like them to be ordered by month number (1-12). When I do this (Select blah blah From blah Order By Month_Start ASC) it orders the months by number, but it starts with october (month 10) I am pretty sure it is doing this because I have no events until april (month 4). So how can i get it to order the months by their numbers starting with january (1) and going to december (12) even if I do not have events until april (4)? _ The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] excel 2 csv 2 mysql
hi guys i am trying to work out how to dynamically be able to upload an excel file , export it to csv to be able to import into mysql , is there any examples out there ? fopen gave me binary code :| -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] global var.
hello all, $variable = $id; // some other stuff @mysql_query here $id = mysql_insert_id(); to the question: How do I get $id from insert_id() to pass to $variable above? Hard to explain the situation i am in, but the query has to be below $variable, is it possible to 'globalize' $id so it passes to the top $variable? first time i ever ran into this problem. Thanks in advanced. cheers, - Sebastian
RE: [PHP] global var.
Hi Sebastian, $variable = $id; // some other stuff @mysql_query here $id = mysql_insert_id(); How do I get $id from insert_id() to pass to $variable above? Hard to explain the situation i am in, but the query has to be below $variable ::blink:: Perhaps something like: $loc = $PHP_SELF. ?variable=. $id; header(Location:. $loc); You'd have to put something in to stop an infinte loop though. Cheers Jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] can't get imagecopy, etc. function to work.
Dear Experts, Seems like I can't use any of the followings even though I'm running PHP 4.3.2-RC1: * imagecreatefromjpeg * imagecopy * etc. Am I right the gd-2.x has already integrated with PHP 4.3.2-RC1 and the gd also has the jpeg integrated? Or, should do I have to bring in the jpeg-6x myself? If I need to bring in the jpeg-6x myself, should I install it within the ext/gd sub-dir? Thing wanted to do: create a separate thumbnail jpeg file from an org. jpeg file. Any better idea? Please advice. Thanks in advanced. --Wo - Original Message - From: Wo Chang [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 23, 2002 2:33 PM Subject: how can php applications use session control to track multiple users? Dear Experts, I know you can use session_register to register varialbes, but how do you use sessions for multiple users? Ex. $valid_user = $username; // let's say $username has JSmith session_register(valid_user); but if another user (SWhite) logins, then the valid_user now has the value of SWhite and the earlier user JSmith is gone. So, how do you make the sessions looks like: JSmith|s:6:JSmith;SWhite|s:6:SWhite; Is this the way how people usually implment to track multiple users? Any hints would be greatly appreciated! --Wo
RE: [PHP] excel 2 csv 2 mysql
Yeah... you're going to have to use COM or something similar on a windows server to get effective access to the server. Another option is dynamically adding at as an odbc datasource and querying it. Again, this will only work on a windows server... It's all much easier if you can convince users to upload csv files. - jon - jon roig senior manager, online production epilepsy foundation http://jonroig.com -Original Message- From: daniel [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 7:48 PM To: [EMAIL PROTECTED] Subject: [PHP] excel 2 csv 2 mysql hi guys i am trying to work out how to dynamically be able to upload an excel file , export it to csv to be able to import into mysql , is there any examples out there ? fopen gave me binary code :| -- 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] cookies with internet explorer on macs
Hi! The cookies i set for people using Internet Explorer on mac (OS X or mac os 8-9) are not staying alive as long as I would like(12hours) they only last for a few hours or sometimes even a few minutes, the time on the end users computers are set correctly. IE on windows is fine and Mozilla and other browsers on linux are fine. This is what I use to set the cookie. $rand = md5(uniqid(rand())); setcookie(sessid, $rand, time()+43200, /); Any ideas? Thanks! Jimmy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] excel 2 csv 2 mysql
on 01/04/03 11:48 AM, daniel ([EMAIL PROTECTED]) wrote: hi guys i am trying to work out how to dynamically be able to upload an excel file , export it to csv to be able to import into mysql , is there any examples out there ? fopen gave me binary code :| also see fgetscsv() Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GNU Open Source
on 01/04/03 8:01 AM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: GPL enforces many restrictions on what can and cannot be done with the licensed code. The point is, PHP is not released under GPL any more -- it's under QPL, so this thread hardly seems relevant to any PHP list -- just my two cents though. /Why/ did they change? They state it on the very next line: The PHP developers decided to release PHP under a much more loose license (Apache-style), to help PHP become as popular as possible. If you need to know more than that, I'd start by reading both licenses, and perhaps looking for plain English or annotated versions of the licenses which help you compare them. But really, this isn't related to PHP any more. Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] parse_str()
I might be wrong here, but with the code below I would expect $_GET to be filled and the script to output the next line: ?php $example_string = 'action=kickitem=me'; parse_str($example_string); var_dump($_GET); ? // expected output: // // array(2) { [action]= string(4) kick [item]= string(2) me } // Is my assumption wrong? What would be the workaround? Thanks, Jose -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] parse_str()
I might be wrong here, but with the code below I would expect $_GET to be filled and the script to output the next line: ?php $example_string = 'action=kickitem=me'; parse_str($example_string); var_dump($_GET); ? // expected output: // // array(2) { [action]= string(4) kick [item]= string(2) me } // Forgot to mention what I get. // actual output: // // array(0) { } Is my assumption wrong? What would be the workaround? Thanks, Jose -- 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] Re: Parsing XML CDATA errors?
i think it should be line 43 : $person_data[$counter][description] .= $data; wish you luck ! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] global var.
Putting an sign in front of the $id in the first line should do the trick: $variable = $id; A short example: $bar = 0; $foo = $bar; $bar = 2; print $foo; //prints 2 __ Marcus Rasmussen [EMAIL PROTECTED] www.marcusr.dk - On 31-03-2003 at 19:56 Sebastian wrote: - hello all, $variable = $id; // some other stuff @mysql_query here $id = mysql_insert_id(); to the question: How do I get $id from insert_id() to pass to $variable above? Hard to explain the situation i am in, but the query has to be below $variable, is it possible to 'globalize' $id so it passes to the top $variable? first time i ever ran into this problem. Thanks in advanced. cheers, - Sebastian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] parse_str()
This should work: parse_str($example_string, $_GET); ___ Marcus Rasmussen [EMAIL PROTECTED] www.marcusr.dk - On 01-04-2003 at 03:20 Jose wrote: - I might be wrong here, but with the code below I would expect $_GET to be filled and the script to output the next line: ?php $example_string = 'action=kickitem=me'; parse_str($example_string); var_dump($_GET); ? // expected output: // // array(2) { [action]= string(4) kick [item]= string(2) me } // Forgot to mention what I get. // actual output: // // array(0) { } Is my assumption wrong? What would be the workaround? Thanks, Jose -- 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
RE: [PHP] excel 2 csv 2 mysql
http://www.ice.ru/~vitus/catdoc/ anyone seen this ? its pretty much wot i needed, havent used it yet though = Original Message From [EMAIL PROTECTED] = Yeah... you're going to have to use COM or something similar on a windows server to get effective access to the server. Another option is dynamically adding at as an odbc datasource and querying it. Again, this will only work on a windows server... It's all much easier if you can convince users to upload csv files. - jon - jon roig senior manager, online production epilepsy foundation http://jonroig.com -Original Message- From: daniel [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 7:48 PM To: [EMAIL PROTECTED] Subject: [PHP] excel 2 csv 2 mysql hi guys i am trying to work out how to dynamically be able to upload an excel file , export it to csv to be able to import into mysql , is there any examples out there ? fopen gave me binary code :| -- 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
Re: [PHP] global var.
Hmm, interesting.. i dunno why it doesn't work for me, here is a bit of the code, $var isn't getting the output of $id, any ideas? $var = $id; if( ! $forg = resizer_main(image,image_$var, blah, blah); $org = getimagesize( $root/$forg ); $result = @mysql_query(INSERT INTO images blah blah.); $id = mysql_insert_id(); cheers, Sebastian - Original Message - From: Marcus Rasmussen [EMAIL PROTECTED] Putting an sign in front of the $id in the first line should do the trick: $variable = $id; A short example: $bar = 0; $foo = $bar; $bar = 2; print $foo; //prints 2 __ Marcus Rasmussen [EMAIL PROTECTED] www.marcusr.dk - On 31-03-2003 at 19:56 Sebastian wrote: - hello all, $variable = $id; // some other stuff @mysql_query here $id = mysql_insert_id(); to the question: How do I get $id from insert_id() to pass to $variable above? Hard to explain the situation i am in, but the query has to be below $variable, is it possible to 'globalize' $id so it passes to the top $variable? first time i ever ran into this problem. Thanks in advanced. cheers, - Sebastian -- 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] Validate MySQL date
How do I easily check to see if a MySQL formatted date is valid such as if a user enters 2003/02/28 would return true 2003/02/31 would return false I have check the manual and other resources but can't come up with anything. -- The content of this email message and any attachments are confidential and may be legally privileged, intended solely for the addressee. If you are not the intended recipient, be advised that any use, dissemination, distribution, or copying of this e-mail is strictly prohibited. If you receive this message in error, please notify the sender immediately by reply email and destroy the message and its attachments. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question on response time, SQL vs. PHP
It's faster to use count(*), because it just has to fetch a count of the rows (but not the rows themselves). If you're retrieving the rows anyway, you should use mysql_num_rows, Liam Gibbs wrote: I'm trying to do a count(*) in SQL. Would it be faster to do a or b below? a: just do a simple query, and use mysql_num_rows() to return the row count; or b: do the count(*) and use mysql_fetch_row() to return the result. I guess it would have to do more with SQL response time (is it faster to grab the count and then the row, or all rows in question and then do a count in PHP). -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Is_readable()
Is there anything I should know about is_readable? It seems to find a file unreadable whether the permissions are 000 or 777.
Re: [PHP] cookies with internet explorer on macs
From: Jimmy Brake [EMAIL PROTECTED] The cookies i set for people using Internet Explorer on mac (OS X or mac os 8-9) are not staying alive as long as I would like(12hours) they only last for a few hours or sometimes even a few minutes, the time on the end users computers are set correctly. IE on windows is fine and Mozilla and other browsers on linux are fine. This is what I use to set the cookie. $rand = md5(uniqid(rand())); setcookie(sessid, $rand, time()+43200, /); Any ideas? A designer I work with was having problems with his sessions sometimes expiring after a few minutes. He uses OS X/Internet Explorer/Entourage. He determined that whenever he checks his email with Entourage, his session cookie is no longer recognized. He got Microsoft support to duplicate and acknowledge the problem. I use Mac OS 9/Internet Explorer/Outlook Express -- no problem. -- Lowell Allen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] cookies with internet explorer on macs
thanks ... lots of my customers use entourage ... On Mon, 2003-03-31 at 20:53, Lowell Allen wrote: From: Jimmy Brake [EMAIL PROTECTED] The cookies i set for people using Internet Explorer on mac (OS X or mac os 8-9) are not staying alive as long as I would like(12hours) they only last for a few hours or sometimes even a few minutes, the time on the end users computers are set correctly. IE on windows is fine and Mozilla and other browsers on linux are fine. This is what I use to set the cookie. $rand = md5(uniqid(rand())); setcookie(sessid, $rand, time()+43200, /); Any ideas? A designer I work with was having problems with his sessions sometimes expiring after a few minutes. He uses OS X/Internet Explorer/Entourage. He determined that whenever he checks his email with Entourage, his session cookie is no longer recognized. He got Microsoft support to duplicate and acknowledge the problem. I use Mac OS 9/Internet Explorer/Outlook Express -- no problem. -- Lowell Allen -- Jimmy Brake [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] excel 2 csv 2 mysql
ok guys are you ready , /www_tools/apache/catdoc/bin/xls2csv test.xls test2.csv gave me this column1`,column2,column3 faffafs,fsafsa,fsafs fssfa,fasfs,fasfs fasaf,fasfs,asffaf fafs,sfafsa,fasfas sfafs,fssfa,fassfa sfasfa,asfafs,fasfas asffas,sfaaf,sfafsa fssaf,asffsa,asffas sfasfa,sfasaf,fasasf unfortunately its putting quotes in, have to strip them = Original Message From [EMAIL PROTECTED] = Yeah... you're going to have to use COM or something similar on a windows server to get effective access to the server. Another option is dynamically adding at as an odbc datasource and querying it. Again, this will only work on a windows server... It's all much easier if you can convince users to upload csv files. - jon - jon roig senior manager, online production epilepsy foundation http://jonroig.com -Original Message- From: daniel [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 7:48 PM To: [EMAIL PROTECTED] Subject: [PHP] excel 2 csv 2 mysql hi guys i am trying to work out how to dynamically be able to upload an excel file , export it to csv to be able to import into mysql , is there any examples out there ? fopen gave me binary code :| -- 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
RE: [PHP] excel 2 csv 2 mysql
ok it works now /www_tools/apache/catdoc/bin/xls2csv -q 0 test.xls test2.csv column1`,column2,column3 faffafs,fsafsa,fsafs fssfa,fasfs,fasfs fasaf,fasfs,asffaf fafs,sfafsa,fasfas sfafs,fssfa,fassfa sfasfa,asfafs,fasfas asffas,sfaaf,sfafsa fssaf,asffsa,asffas sfasfa,sfasaf,fasasf then i can load that into mysql using load data into :D, aparantly there are some bugs , gotta find them = Original Message From daniel [EMAIL PROTECTED] = ok guys are you ready , /www_tools/apache/catdoc/bin/xls2csv test.xls test2.csv gave me this column1`,column2,column3 faffafs,fsafsa,fsafs fssfa,fasfs,fasfs fasaf,fasfs,asffaf fafs,sfafsa,fasfas sfafs,fssfa,fassfa sfasfa,asfafs,fasfas asffas,sfaaf,sfafsa fssaf,asffsa,asffas sfasfa,sfasaf,fasasf unfortunately its putting quotes in, have to strip them = Original Message From [EMAIL PROTECTED] = Yeah... you're going to have to use COM or something similar on a windows server to get effective access to the server. Another option is dynamically adding at as an odbc datasource and querying it. Again, this will only work on a windows server... It's all much easier if you can convince users to upload csv files. - jon - jon roig senior manager, online production epilepsy foundation http://jonroig.com -Original Message- From: daniel [mailto:[EMAIL PROTECTED] Sent: Monday, March 31, 2003 7:48 PM To: [EMAIL PROTECTED] Subject: [PHP] excel 2 csv 2 mysql hi guys i am trying to work out how to dynamically be able to upload an excel file , export it to csv to be able to import into mysql , is there any examples out there ? fopen gave me binary code :| -- 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 General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php