[PHP] Re: Having problems with an IF statement, just doesn't make sense
Paying attention to this line: Also if I use !isset it returns true with a null value for $theme Well this is clear in the manual: isset() will return FALSE if testing a variable that has been set to NULL So !isset($a_Null) = !FALSE = TRUE From PHP Manual = $var = 0; if (empty($var)) { // evaluates true echo '$var is either 0 or not set at all'; } if (!isset($var)) { // evaluates false echo '$var is not set at all'; } Read manual: empty() and isset() -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] accesing php script in a different port
hi to all, I want to develop a system that can be access in a different port of the web (such as in Port 11000). But i dont know how to do this without affecting existing apache or other webserver installation. My idea is based on some utilities that exists such as the Webmin Utilities that are commonly used to administer Unix/Linux. Can anyone give a hint or good tutorial links for this problem? Thanks in advance. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP4 and PHP5 at one machine
Yes all these things I know, because already I'm running these two servers, but both with PHP4. But now I came accros the problem of php4ts.dll. Because in both versiones it has the same name. And if I have the old one my \WINNT\SYSTEM32 the server which is running PHP5 won't start, and if i put there the newer one the one with PHP4 won't start. That's my problem. Do you know how to solve this? Milan -- -- Milan Reznicek Software Developer e-mail: [EMAIL PROTECTED] Burhan Khalid [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tuesday, July 8, 2003, 8:42:16 PM, Milan wrote: MR is there any posibility to run PHP4 and PHP5 at one machine, with two MR Apache servers running at the same time. MR Windows 2000 SP3 MR Apache 1.3.27/PHP 4.3.0 MR Apache 2.0.46/PHP 5.0.0b1 Yes it is possible. If you want both of the servers to be running at one time, then you'll have to change the Listen directive on one of them, since both will default to port 80. So, change one to something else, like 8080. Then access it with the port number http://address:port As far as the PHP install goes, you can have two PHP installs (one for each server), you just have to make sure where the .ini files are stored, and that the configuration directives for PHP (such as LoadModule, etc.) point to the right direction for each server. I also believe that the Apache Service Monitor can handle more than one Apache install, so you'll have a convienient place to control your servers. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: NEW SPAMMER - [PHP] New Krysalis version released
Hi Jeff, What are you planning to do with XML? As for now, there are three or four main things you can do with PHP and XML 1. create webapplication that call remote functions using SOAP (nuSoap and PEAR SOAP and the libraries to use) 2. create websites that use XML messaging to retrieve data (non SOAP, just pure XML calls and XML replies) 3. manipulate and generate XML files (using DOM or SAX) - use the standard XML APIs form PHP (I recommend PHP 4.3.1) 4. use Krysalis or Popoon to publish information by separating the application logic from the presentation layer (XML/XSL publishing) How do you plan to use XML with PHP? You just want to do some research for future projects or do you have a project to be made that somehow requires XML? Alexandru -- Alexandru COSTIN Chief Operating Officer http://www.interakt.ro/ +4021 312 5312 Jeff Harris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Jul 8, 2003, Alexandru COSTIN claimed that: |Hi, |I've just read the other thread about spammers and such. |Indeed, my announcement - even for a free platform - was not complying |to the posting guidelines as it not a response to any questions asked. | |I apologize. | |Alexandru | I've just started poking around with XML. Does anyone know anything that I might use to learn more about it? Optimally, it would be available in the pear repository, and have plenty of documentation. Jeff -- Registered Linux user #304026. lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED Responses to this message should conform to RFC 1855. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] accesing php script in a different port
Try using sockets in php to set up the port and listen there... -- BigDog On Wed, 2003-07-09 at 00:22, Michael P. Carel wrote: hi to all, I want to develop a system that can be access in a different port of the web (such as in Port 11000). But i dont know how to do this without affecting existing apache or other webserver installation. My idea is based on some utilities that exists such as the Webmin Utilities that are commonly used to administer Unix/Linux. Can anyone give a hint or good tutorial links for this problem? Thanks in advance. Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: what's wrong with this?????
$result = mysql_query('CREATE TABLE members (userid INT(25) NOT NULL AUTO_INCREMENT, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(50) NOT NULL, email_address VARCHAR(255) NOT NULL, username VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL, activated ENUM('0','1') DEFAULT '0' NOT NULL, date_joined DATETIME NULL, last_login DATETIME NULL);')or die(Create table Error: .mysql_error()); --- - First of all verify ' (single quote) or (double quote) here... this should solve the problem BUT - Another problem will crop 'coz u didnot define a key... Read - PRIMARY KEY (index_col_name,...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create a Report
I'm using MySQL and PHP for building a website, however now I need to create a report with something like this: - {Title} {Description} {Zone1} Detail Zone1.Topic1 DetailZone1.Topic2 DetailZone1.Topic3 {Zone2} Detail Zone2.Topic1 DetailZone2.Topic2 {Zone3} Detail Zone3.Topic1 DetailZone3.Topic2 DetailZone3.Topic3 DetailZone3.Topic4 - I have 2 tables named Zone1 and Zone1detail where I do a join to get values I need. How ever don't know how to make something like this. Can anyone help? Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: movement on a page
Nope. What I was thinking was something like a HTML anchor. where you can jump to a completely different location on a page but I was thinking of a different part in the script or all together completely out of the PHP script. Anyway, I made a work around. I call a function if the condition is not meet and I don't do a return. It works and so far has been error free. thanks Yasha Nisanov [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] are you talking about this ?? ? if (conditionIsMet) { } else { ? html head /head body /body /html ? } ? Micah Montoy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there any way to jump out of PHP script but continue loading the HTML on the rest of page? For instance I have this conditional and if its true, I want to stop running the rest of the script and I want the rest of the page to continue loading that doesn't have any script. thanks --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions
Kirk, Thanks for the input. I've never been certain about the register_globals setting. From what I read I understood it that since I use the new method and have my dev site set to off that it wouldn't be a problem. As it turns out my dev site has globals OFF, test site ON and target site ON. So I'm no closer to figuring that one out. regards, Dave Kirk Johnson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] This works fine on my development PC, (PHP v 4.3.1) and on my primary test site (PHP v4.2.2). However when I try it on the target site (PHP v4.1.2) then I find that immediately after starting the session everything works fine, however when I move to any other page the session information is lost and I'm redirected to log in again. Also check the register_globals setting in the various php.ini files. It is probably set to off on your dev and test sites, but may be set to on on the target site. Kirk --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] output compression and MSIE
Hi, I'm shocked. It seems it works! However.. My pages without forcing ISO 8559-2 don't look good. What to use instead so? -- Best regards, Sebastian Tuesday, July 8, 2003, 3:55:43 PM, you wrote: MO [snip] My head looks like that - nothing special.. head LINK href=/css/main.css rel=stylesheet type=text/css TITLESome title/TITLE meta http-equiv=Content-Type content=text/html; charset=iso-8859-2 script language=JavaScript src=/javascripts/date_picker/date_picker.js/script /head MO [/snip] MO sorry list for the mess in this thread. got somewhat wrong. MO try to take the following line out: MO meta http-equiv=Content-Type content=text/html; charset=iso-8859-2 MO (modifing to output correct type would be even better) MO regards MO mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple upload files with php
Hi, I need to upload multiples files using php, but with the same input tag, somebody can help my, is this feature supported by php?. Anyboy knows how to invocate the browser windows that allow to select more than one file for upload ? thanks a lot _ MSN Compras: Veinte tiendas personales abiertas todo el día. http://www.msn.es/compras/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] output compression and MSIE
Hi, I'm shocked. It seems it works! However.. My pages without forcing ISO 8559-2 don't look good. What to use instead so? Hi, You could try leaving the line an and add content-encoding headers like this meta http-equiv=content-encoding content=gzip (or an equiv. header() statement) Haven't tried that, but i see a chance that it works properly. Question is, if you let mod_gzip zip your pages, how to know when to send this header-directive. I'm quite sure about that IE is up to making troubles getting unzipped content with that header. regards mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Annoucement Idea
Hi, I welcome your idea. [ANN] would be fine. Alexandru -- Alexandru COSTIN Chief Operating Officer http://www.interakt.ro/ +4021 312 5312 Joe Harman [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am wondering if the creators of this list could impose a rule... all things must be PHP related... if you have an announcement and it is related to PHP... it must be proceed in the subject line of the email with the word ADV or Annoucement - that way if you don't want to read it, you can delete it... or set up a rule in Outlook to delete it??? so... just an idea see ya, joe -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Multiple upload files with php problem!!
Hi, I need to upload multiples files using php, but with the same input tag, somebody can help my, is this feature supported by php?. Anyboy knows how to invocate the browser windows that allow to select more than one file for upload ? thanks a lot _ Melodías, logos y mil servicios para tu teléfono en MSN Móviles. http://www.msn.es/MSNMovil/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] picture(s) in Excel
Hi there! I'd like to ask if there is any work-around available for saving picture(s) (BMP/JPG/PNG) in *.xls file. I need to create (using PHP) dynamically xls file with some pictures in it. thanks Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: picture(s) in Excel
PHP with Excel??? I know it can work with CVS but not exactly with Excel (xls) files. Why not use Access (in windows with ASP) or MySQL (in Linux server)? Jan [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Hi there! I'd like to ask if there is any work-around available for saving picture(s) (BMP/JPG/PNG) in *.xls file. I need to create (using PHP) dynamically xls file with some pictures in it. thanks Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using PHP with windows logon
Hello all, I just have a quick question, I am not sure that it is even possible but im gonna take a whack anyways, basically what i want to know is, can you use your windows logon as set it as a variable in php?? eg I log onto a windows machine using brenton can i use a php script to set that as a variable, I have seen a similar type function before but i have no idea how it works, I know windows sets the variable %username% that as a network administrator i use in shortcuts to point to their home drive.. Hopefully i can do this :P Cheers in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Multiple upload files with php problem!!
This is supported in the standards I think, as it says clearly in the HTML 4.01 specification on www.w3.org: file select - This control type allows the user to select files so that their contents may be submitted with a form. Note that 'files' is plural. However, no browser yet supports this feature. The only way to upload multiple files in one page is to create multiple fileboxes and store the filenames in an array. Or you could do it like me, upload zipfiles and extract them with some ziplibrary, like zlib. -Original Message- From: Francisco Morales [mailto:[EMAIL PROTECTED] Sent: 9. júlí 2003 08:30 To: [EMAIL PROTECTED] Subject: [PHP] Multiple upload files with php problem!! Hi, I need to upload multiples files using php, but with the same input tag, somebody can help my, is this feature supported by php?. Anyboy knows how to invocate the browser windows that allow to select more than one file for upload ? thanks a lot _ Melodías, logos y mil servicios para tu teléfono en MSN Móviles. http://www.msn.es/MSNMovil/ -- 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] preg_replace - understanding
-Original Message- From: Jennifer Goodie [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 00:43 $filevalue = str_replace(\\, /, $filevalue); it is reversing the \\ to // but not replacing them with just a single /. I think you need to escape your \ so each \ is \\ so your string should be Or use single quotes for your strings: $filevalue = str_replace('\\', '/', $filevalue); Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 9 Jul 2003 10:09:21 -0000 Issue 2165
php-general Digest 9 Jul 2003 10:09:21 - Issue 2165 Topics (messages 154447 through 154512): preg_replace - understanding 154447 by: Micah Montoy 154452 by: Kevin Stone 154453 by: Micah Montoy 154454 by: Jennifer Goodie 154455 by: Micah Montoy 154456 by: Micah Montoy 154512 by: Ford, Mike [LSS] Re: Stumper: Get Variable Name 154448 by: Mike Migurski Alex,Joe - Re: [PHP] New Krysalis version released 154449 by: Ryan A 154450 by: Joe Harman Re: XML 154451 by: Ray Hunter Object assignment 154457 by: Matt Grimm 154461 by: Martin Towell 154464 by: Tom Rogers seeing strange things? 154458 by: Micah Montoy 154459 by: Micah Montoy [ML] Are there any announcement rules for this list? (was Re: [PHP] Re: NEW SPAMMER ...) 154460 by: Joel Rees 154467 by: Robert Cummings 154477 by: Richard Baskett how to force variables declaration?? 154462 by: mack paul 154463 by: Martin Towell 154466 by: David Nicholson session data missing 154465 by: ulf sundin Annoucement Idea 154468 by: Joe Harman 154506 by: Alexandru COSTIN Re: __get, __set, __clone 154469 by: Greg Beaver Re: Incrementing counter from an HTML page. 154470 by: Student4 Re: include/require inside of function 154471 by: Ow Mun Heng Text boxes posted to MySQL record that contain quotes 154472 by: Vernon 154474 by: electroteque 154475 by: electroteque 154476 by: Burhan Khalid 154478 by: electroteque 154480 by: Vernon 154490 by: gamin Re: New to PHP 154473 by: Ow Mun Heng Re: PHP4 and PHP5 at one machine 154479 by: Burhan Khalid 154496 by: Milan Reznicek PHP forum 154481 by: Richard Baskett 154484 by: PHP4 Emailer How configure PHP parser 4.3.x in IIS version 6.0? 154482 by: o_j_p_p.icnet.com.ve 154492 by: Roberto Ramírez getting part of a string 154483 by: Micah Montoy 154486 by: ulf sundin 154487 by: Micah Montoy Anchor lost in header redirect 154485 by: Yasha Nisanov simple ereg() question 154488 by: gamin 154491 by: Eddy-Das movement on a page 154489 by: Micah Montoy 154493 by: Yasha Nisanov 154501 by: Micah Montoy Re: Having problems with an IF statement, just doesn't make sense 154494 by: Nadim Attari accesing php script in a different port 154495 by: Michael P. Carel 154498 by: Ray Hunter Re: NEW SPAMMER - [PHP] New Krysalis version released 154497 by: Alexandru COSTIN Re: what's wrong with this? 154499 by: Nadim Attari Create a Report 154500 by: cavagnaro Re: Sessions 154502 by: Dave Alger Re: output compression and MSIE 154503 by: sebab.dialcom.com.pl 154505 by: Mario Oberrauch Multiple upload files with php 154504 by: Francisco Morales Multiple upload files with php problem!! 154507 by: Francisco Morales 154511 by: Sævar Öfjörð picture(s) in Excel 154508 by: jan 154509 by: cavagnaro Using PHP with windows logon 154510 by: Brenton Dobell 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--- I'm trying to understand how the code works within the preg_replace function but the manual is just obscure as the examples are. Anyway, I am looking to use it to replace \\ in a string with / and I can not figure how how. At first, I thought I could just do: $filevalue = preg_replace('\\', /, $filevalue); but it doesn't do anything. If someone could relate what it is and what the parts mean between the (), I would appreciate it. thanks ---End Message--- ---BeginMessage--- - Original Message - From: Micah Montoy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 4:01 PM Subject: [PHP] preg_replace - understanding I'm trying to understand how the code works within the preg_replace function but the manual is just obscure as the examples are. Anyway, I am looking to use it to replace \\ in a string with / and I can not figure how how. At first, I thought I could just do: $filevalue = preg_replace('\\', /, $filevalue); but it doesn't do anything. If someone could relate what it is and what the parts mean between the (), I would appreciate it. thanks You're not using the function correctly. You've got the search string and replace string tied up into one input there. They need to be separate. $filevalue = preg_replace('\\', '/', $filevalue); http://www.php.net/manual/en/function.preg-replace.php However you should
RE: [PHP] session data missing
-Original Message- From: ulf sundin [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 01:01 After creating a new session with session_start() and inserting a few values e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file /tmp/sess_{session_id} is created. The problem is that this file is empty! 0 bytes. no data is stored. I'm using php 4.0.6 on linux with apache 1.3 something. Just doing session_start() will create the file. Are you also session_register()-ing your session vars? The $HTTP_SESSION_VARS array isn't like the $_SESSION array introduced in PHP 4.1 -- it's values are not automatically registered. You still have to use session_register(), thus: session_start(); session_register('foo'); $HTTP_SESSION_VARS['foo'] = 'bar'; HTH Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] seeing strange things?
-Original Message- From: Micah Montoy [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 01:37 A couple more things and I'll stop bugging everyone. I'm trying to get the file name of the string. If it includes the extension that's fine as well. I thought the code below would do this but its not. $filevalue = str_replace(, /, $filevalue); //get specific file name $parts = explode(/,$filevalue); $file_name = $parts[count($parts)]; //line 42 Its giving me error: Notice: Undefined offset: 6 in c:\inetpub\wwwroot\webpage10\example\u_images\act_load_imgs.ph p on line 42 This is because count() returns the number of elements in the array, but because the indexes start at zero the highest offset is count($parts)-1 -- so when you try to access element count($parts), PHP throws a wobbly. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] include/require inside of function
-Original Message- From: Ow Mun Heng [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 03:44 I finally got it. Thanks. All I needed to do was just define global $page_title inside the function to denote that I wanted to use that variable. One other quick question, in my original code (per below) the function create_global() was used to create_globals on demand. But this involved a lot of jumping, from one function to another just to create the globals on demand. Is this efficient (more?? less??) compared to just stating global $page_title inside the function? I don't think create_global() is of any use to you in this situation -- you're just wasting the time taken to do the function call and return. Just do either: function org_display_title_code() { global $page_title; echo 'This is title1 - ' . $page_title; } Or: function org_display_title_code() { echo 'This is title1 - ' . $GLOBALS['page_title']; } Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP4 and PHP5 at one machine
-Original Message- From: Milan Reznicek [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 07:38 Yes all these things I know, because already I'm running these two servers, but both with PHP4. But now I came accros the problem of php4ts.dll. Because in both versiones it has the same name. And if I have the old one my \WINNT\SYSTEM32 the server which is running PHP5 won't start, and if i put there the newer one the one with PHP4 won't start. That's my problem. Do you know how to solve this? Don't put either php4apache.dll (or equivalent) or php4ts.dll in your Windows directory. Put the files for each version in separate directories specific to the version (say, C:\php\4.3.2\dlls and C:\php\5.0.0\dlls), then in your Apache .conf file specifically name this location in your LoadModule command -- for instance: Module php4_module c:/php/4.3.2/dlls/php4apache.dll This has worked fine for me for a while now. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Text boxes posted to MySQL record that contain quotes
Vernon wrote: I know that using stripslashes will remove \ using php but I'm having trouble with posting quotation marks in a text record field. Anyone know how I can get them to post to the database? It's basically like an email and I'd like anything written to be able to post. Use htmlentities() to convert quotes to HTML entities. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] seeing strange things?
Micah Montoy wrote: A couple more things and I'll stop bugging everyone. I'm trying to get the file name of the string. If it includes the extension that's fine as well. pathinfo() should do the job for you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Using PHP with windows logon
I think if php runs under IIS and IIS is set up to do so, the variable (phpinfo() will tell you its name) is set. I don't know much more. Brenton Dobell wrote: Hello all, I just have a quick question, I am not sure that it is even possible but im gonna take a whack anyways, basically what i want to know is, can you use your windows logon as set it as a variable in php?? eg I log onto a windows machine using brenton can i use a php script to set that as a variable, I have seen a similar type function before but i have no idea how it works, I know windows sets the variable %username% that as a network administrator i use in shortcuts to point to their home drive.. Hopefully i can do this :P Cheers in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP forum
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Ok some of you might not like this, others of you will know exactly what I mean, but it just reminded me so much of this forum that I am sure some of you will catch the humor in it: http://www.mac-forums.com/forums/showpost.php?postid=5736postcount=85 Please keep your flames directed at me instead of the mailing list so we can keep this thread to one post. Cheers! What's in a name? That which we call a rose by any other name would smell as sweet. - Shakespeare Goodness me! I first saw that sometime in a year that started with 19 :-) -- Quod subigo farinam $email =~ s/oz$/au/o; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Create a Report
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I'm using MySQL and PHP for building a website, however now I need to create a report with something like this: - {Title} {Description} {Zone1} Detail Zone1.Topic1 DetailZone1.Topic2 DetailZone1.Topic3 {Zone2} Detail Zone2.Topic1 DetailZone2.Topic2 {Zone3} Detail Zone3.Topic1 DetailZone3.Topic2 DetailZone3.Topic3 DetailZone3.Topic4 - I have 2 tables named Zone1 and Zone1detail where I do a join to get values I need. How ever don't know how to make something like this. Can anyone help? Thanks in advance Depends on how you have structured your tables. There should be a common field between the tables on which you can join. -- Quod subigo farinam $email =~ s/oz$/au/o; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() - how to attach file to the message???
i know that in mail-form i need input type=file name=attach but i don't know how to write message headers to send file with e-mail. please help me. szparag. IncrediMail - Email has finally evolved - Click Here
RE: [PHP] Please assist - been on this for hours - Permissions on server
On Tue, 2003-07-08 at 07:21, Steve Jackson wrote: If I set permissions of my server root to chmod 777 that's a security risk right? How do I set my server to allow me to write a file to my web root from another directory using PHP? Or is it a Unix problem? I have a generator file writes a string to a text file and then renames the text file as a PHP file however it occurred to me while I was doing this that chmod 777 the root might not be a good idea. Anyone have a simple fix or idea for this? Change the ownership on the directory to whichever user apache is running as (this is the User directive in your httpd.conf file). Then you can restrict the permissions on that directory. You could probably make it 600 if you want. Can this be done automatically with PHP? I want a file to be written to the root directory by PHP and not have to get the web server admin to change ownership privaleges on the root. Basically does anyone know how to get PHP to see what the server name and group is and then assign the writing rights to the script? This will allow me to generate a file on the fly. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] picture(s) in Excel
Use this class: http://phpclasses.web4u.cz/browse.html/package/767.html and insert_bitmap() method of a Worksheet object. jan wrote: Hi there! I'd like to ask if there is any work-around available for saving picture(s) (BMP/JPG/PNG) in *.xls file. I need to create (using PHP) dynamically xls file with some pictures in it. thanks Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() - how to attach file to the message???
Use this class: http://www.phpclasses.org/mimemessage szparag wrote: i know that in mail-form i need input type=file name=attach but i don't know how to write message headers to send file with e-mail. please help me. szparag. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mail() - how to attach file to the message???
this worked for me but i did some editing and censoring oso maybe a tiny bug got in. ///SETUP strings $subject='hi there, this is not a Viagra business proposal, '; $mailto = '[EMAIL PROTECTED],[EMAIL PROTECTED]';// for multiple recipients, use comma '[EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]' $From = 'Your website' [EMAIL PROTECTED]'; // gets shown as mail sender. can be anything. $message = \nThis is a backup created by a script on your site. \nThe location of the script is .__FILE__.'.'; $filedata = getyourcontentsomehow(); //create a filename for the email. the date and time at the start of the filename make it easy to sort it. $filename = date(Y_m_d__H_i).'anytext'..sql; //prepare mail body $filedata = chunk_split(base64_encode($filedata)); $type = application/octet-stream; $encoding = base64; mt_srand((double)microtime()*100); $boundary = '--b'.md5(uniqid(mt_rand())) . getmypid(); //as long as it starts with -- it should work $mailbody = From: Your website script\n .MIME-Version: 1.0\n .Content-Type: multipart/mixed; boundary=\$boundary\\n\n .This is a MIME encoded message. \n\n .--$boundary\n .Content-Type: text/plain\n; .Content-Transfer-Encoding: 8bit\n\n .$message . \n\n\n--$boundary; $data = Content-Type: $type.; name = \$filename\\n .Content-Transfer-Encoding: $encoding .\n\n$filedata\n; $mailbody .= \n$data\n--$boundary .--\n; //send mail mail($mailto, $subject , ' ', $mailbody) or die ('Could not send email!'); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] linking with home directory path
I have a script that contains style sheets and I can't seem to link it on my Windows 2000 IIS server. It works perfectly fine on my Windows XP IIS server. Here is what I am trying to do. The index.php file (which links to the style sheets) is located in the MyScript folder and inside that folder is another folder called themes (where the style sheets are located). I am doing the following, which works fine on a Windows XP IIS server, but not my Windows 2000. // Path to script files (absolute file path) $HomeDir = c:/inetpub/wwwroot/MyScript/; // Name of style folder $ThemeFolder = default; //--- Then later in the page, I link the style sheet like this ---// echo link rel='stylesheet' type='text/css' href='.$HomeDir.themes/.$ThemeFolder./style.css' ; Like I said before, the style sheets load up fine on my Windows XP IIS server, but not the Windows 2000. In order to get it to work on the Windows 2000 IIS server, I have to link the style sheets relative to the folder I am working in, but I want to be able to move certain files into other directories without manually linking each one, so that's why I am linking them from the absolute home directory. Is there some setting in the php.ini file that deals with this? If anyone has suggestions, please let me know. I assume the above code would work on Linux systems without problems (given the correct home directory path). Can anyone verify this? Thanks a lot. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cookie header and location header.
In PHP4.3.x If I set a cookie with setcookie and send a location header immediately. I find no problem for the task. That is, ?php setcookie(testcookie,teststr,time()+36); header (Location:nextpage.php); ? And testcookie can be found in the latter page. However, I can't In PHP4.1.x What's the problem? A compromised method of using meta refresh of zero second is used. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sessions
Thanks to all who posted. Well, I managed to track down the problem. The PHP system was set to use /tmp for its session.save_path but there was no /tmp directiory. Strange because on my test site I don't have a /tmp directory... I'm guessing my ISP has taken care of that separately. Anyway I created a tmp folder and everything seems fine. Thanks again. Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.497 / Virus Database: 296 - Release Date: 04/07/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Form being filled out automatically....
I've got a problem. I have a form that the user fills out and then hits submit on and it sends an e-mail. My problem is that I have one AOL user that claims that when ever he goes back to the form, it doesn't present the form - it just sends the message. It appears that for some reason $HTTP_POST_VARS[EMAIL] has a default value or it's a cache issue. Any ideas Here is the psudo-code... if( ! isset( $HTTP_POST_VARS[EMail] ) ) { form method=POST onsubmit=return validate(this) name=MailForm // Rest of form stuff } else { // send message here } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail() - how to attach file to the message???
do you want to send a file via mail (mime-type of the file?) or do you want to attach the file to a mail (multipart?)? the mail-format is defined in rfc2045 and following. but if you don't want to build your own function, there are good mime-mail-classes out there. (e.g. http://www.phpguru.org/mime.mail.html) ciao SVEN Szparag [EMAIL PROTECTED] schrieb im Newsbeitrag news:[EMAIL PROTECTED] i know that in mail-form i need input type=file name=attach but i don't know how to write message headers to send file with e-mail. please help me. szparag. IncrediMail - Email has finally evolved - Click Here
RE: [PHP] XML
Hi List Firstly, thanks for the replies and mostly for the accommodating attitude to this, arguable non-PHP subject. I don't want this thread to become a flame war on why one should use XML, or why not. I do have personal issues wrt XML and the way it works, and although I cannot *yet* see the need, it doesn't mean that there isn't one. My original post should have made this clear, but it seems it didn't. I have laid to rest my reservations wrt XML, and am more interested in understanding the entire process in the hope that 1) I will see the need, and 2) understand how all those XML jargon fits together ( XML, XSL, XSLT, DTD, DOMXML, phew...) That was why I gave a brief summary of where I am atm wrt understanding what it is. What I still don't know much about, and at last, this is where the PHP comes in, is once I have this XML file, whereto from here using PHP ( you see, it should be clear that I want to use PHP as my one and only trusty tool. As I stated, and correct me, the XML file contains the structured data, and the XSL file contains the look and feel and the XSL file is written in XSLT language. My understanding is further that, again focused only on web applications here, one would have an XML file in your web folder, along with it's XSL file. These files would be linked by means of calls or references to each other inside the files. Having these two files (oh, and the dtd which can be used to verify the XML, but doesn't seem necessary from what I can see), as I understand it, gives the basis from where one would then parse the XML into XHTML in order to actually see anything in a browser via one of two routes: 1) client side via the browser's built in XML parser - arguably leaving the old Netscape/IE gap wrt compatibility, or 2) server side parsing with the built-in XML parser that comes with the webserver (IIS or Apache in my case) - with this approach being in my mind the best if you want to make sure you don't run into browser issues. This is where my PHP question really starts: On apache.org they talk about the XML support of apache etc, and in the PHP documentation there are lots of XML functions and yet more jargon like DOMXML etc, which is not clear for me what to do now (should I elect to parse server side). If someone can just give me a quick and easy tour on what to do and what is needed from here to actually parse and display the contents correctly, I should have enough to keep me busy for a while, and hopefully help me to increase my knowledge and understanding so I won't ask stupid questions on this list ;) Thanks again for the input. On Wed, 2003-07-09 at 00:36, Ray Hunter wrote: I see that not many sites require the use of xml/xsl(t). Many sites can just use html and database to accomplish 99.9% of the work. I always suggest that when you have tons of data that you need to send to the user that it is a good idea. Especially now that xslt is growing up :) I like to use xml and xsl for various reasons, mainly i can really separate the logic and presentation. All data is keep in the xml file and presentation in the xsl file. So when i need to make changes in the presentation then i only change the xsl file and never really have to touch the logic (php) code. This is really, really great for some sights that are extremely complex. Also in php i can create standards that my xml files will follow (dtds, schema) and allowing me to create modules (functionality) very efficiently and timely. Also as mentioned xml provides a format for transfering data. However, i would not use it with databases unless it is large amounts of data. However, i have used xml for creating sql queries and setting up configureation files which are extremely reliabe. -- BigDog On Tue, 2003-07-08 at 15:51, Jeff Harris wrote: |-Original Message- |From: Petre Agenbag [mailto:[EMAIL PROTECTED] |Sent: Tuesday, July 08, 2003 6:27 AM |To: [EMAIL PROTECTED] |Subject: [PHP] XML | | |Hi List | |Firstly, this question is arguable more about XML than PHP, but they are |interlinked, so I hope it is topical for this list. | |Firstly, Where I come from: | |I am VERY comfortable with PHP/MySQL on Linux and understand all those |concepts. | |Now I'm trying to see the benefits of XML, and quite frankly, I just |cannot see why one would want to use it... | [snip] On Jul 8, 2003, Joe Harman claimed that: |Okay Petre... You have asked the question that I always wanted to ask!!! |I can't wait to see peoples answer... I simply can't find a use for it |either | |Joe This probably should be on another list, but it might give someone an idea on how to create something in PHP. I've been trying to figure out if some of what I'm doing would be good for XML. The answer for that is no, use a database. It seems to me, that XML is a way of encoding data for the transmission between two processors. For
Re: [PHP] Form being filled out automatically....
On Wed, 09 Jul 2003 07:00:38 -0500, you wrote: I've got a problem. I have a form that the user fills out and then hits submit on and it sends an e-mail. My problem is that I have one AOL user that claims that when ever he goes back to the form, it doesn't present the form - it just sends the message. It appears that for some reason $HTTP_POST_VARS[EMAIL] has a default value or it's a cache issue. Any ideas Here is the psudo-code... if( ! isset( $HTTP_POST_VARS[EMail] ) ) { The obvious thing to do is change all instances of EMail to emailaddress or somesuch, and see if the problem still exists. Do you know anyone on AOL who isn't having the problem? Your guesses as to cause seem reasonable to me, but without an example of their browser to test against, you're working blind. form method=POST onsubmit=return validate(this) name=MailForm Hmm... or maybe AOL is doing something wacky with onsubmit()? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] picture(s) in Excel
Hi ! thanks. yes, that's the solution for BMP files. I would prefer using PNG of JPG format. Is it possible ? Jan On Wed, 2003-07-09 at 13:34, Marek Kilimajer wrote: Use this class: http://phpclasses.web4u.cz/browse.html/package/767.html and insert_bitmap() method of a Worksheet object. jan wrote: Hi there! I'd like to ask if there is any work-around available for saving picture(s) (BMP/JPG/PNG) in *.xls file. I need to create (using PHP) dynamically xls file with some pictures in it. thanks Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form being filled out automatically....
On Wed, 09 Jul 2003 13:23:59 +0100, David Otton wrote: On Wed, 09 Jul 2003 07:00:38 -0500, you wrote: if( ! isset( $HTTP_POST_VARS[EMail] ) ) { The obvious thing to do is change all instances of EMail to emailaddress or somesuch, and see if the problem still exists. Do you know anyone on AOL who isn't having the problem? Hmmm... I'll give that a try. And to the best of my knowledge this is the ONLY user having the problem. I don't know for certain that others are using AOL but I'm pretty sure they are and aren't having the problem. Your guesses as to cause seem reasonable to me, but without an example of their browser to test against, you're working blind. form method=POST onsubmit=return validate(this) name=MailForm Hmm... or maybe AOL is doing something wacky with onsubmit()? Could be! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, MySQL and Flash
Does anyone know of any articles on integrating PHP, MySQL and Flash to perform a drag and drop routine for updating a db? Specifically, I have a client who is _INSISTING_ that I integrate a drag and drop feature into his railcar storage application. He wants to be able to view two railcar storage tracks, Track A and Track B, then drag and drop cars from Track A to Track B ( or Track B to Track A ). Once he positions ( orders ) all the cars properly on each track, I need to update a MySQL db to reflect the changes. I have already developed the above feature so that he can do this 'textually', but he is _determined_ that he must have the graphic 'drag and drop' feature. There may be another method ( Javascript ? ) to accomplish the same effect. I am certainly open to any advice and/or opinions. Any pointers would be _greatly_ appreciated. Thanks, Randy Rankin
RE: [PHP] PHP forum
me three! j/k. -Dan On Wed, 2003-07-09 at 00:21, PHP4 Emailer wrote: HOLY COW, I never laughed so hard in my life, This is DEAD ON, for what happens in this exact forum. Damn that [EMAIL PROTECTED] is funny!! And I've only been here for about 3 months now. I've see about every one of those in that short time. Boy that cracks me up. Good find Richard!! ha... :} -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 10:42 PM To: PHP General Subject: [PHP] PHP forum Ok some of you might not like this, others of you will know exactly what I mean, but it just reminded me so much of this forum that I am sure some of you will catch the humor in it: http://www.mac-forums.com/forums/showpost.php?postid=5736postcount=85 Please keep your flames directed at me instead of the mailing list so we can keep this thread to one post. Cheers! What's in a name? That which we call a rose by any other name would smell as sweet. - Shakespeare -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP, MySQL and Flash
Why don't you just write a program in Java? It would be simple to do, wouldn't require Flash, and might make your life easier. -Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] picture(s) in Excel
You can explore the possibility of Web Archives. This is how a web archive starts: MIME-Version: 1.0 X-Document-Type: Worksheet Content-Type: multipart/related; boundary==_NextPart_01C3461B.AE5C1F00 This document is a Web archive file. If you are seeing this message, this means your browser or editor doesn't support Web archive files. For more information on the Web archive format, go to http://officeupdate.microsoft.com/office/webarchive.htm --=_NextPart_01C3461B.AE5C1F00 Content-Location: file:///C:/8B52764B/obrazok.htm Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1250 html xmlns:v=3Durn:schemas-microsoft-com:vml xmlns:o=3Durn:schemas-microsoft-com:office:office xmlns:x=3Durn:schemas-microsoft-com:office:excel xmlns=3Dhttp://www.w3.org/TR/REC-html40; head meta http-equiv=3DContent-Type content=3Dtext/html; charset=3Dwindows-125= 0 meta name=3DProgId content=3DExcel.Sheet meta name=3DGenerator content=3DMicrosoft Excel 10 ... and so goes the head tag. body div id=3Dobrazok_11330 align=3Dcenter x:publishsource=3DExcel table x:str border=3D0 cellpadding=3D0 cellspacing=3D0 width=3D512 style= =3D'border-collapse: collapse;table-layout:fixed;width:384pt' col width=3D64 span=3D8 style=3D'width:48pt' tr height=3D17 style=3D'height:12.75pt' td height=3D17 class=3Dxl1511330 width=3D64 style=3D'height:12.75pt;widt= h:48pt'halo/td . As you can see it is a simple mime multipart message with some html tags in it, there are plenty of classes that can help you to build this. Image will be in another part. Also check out the above mentioned link. jan wrote: Hi ! thanks. yes, that's the solution for BMP files. I would prefer using PNG of JPG format. Is it possible ? Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Bug or just a strange behaivor?
Hi, Let's get right to it... When I try to do this: ? echo $_COOKIE['test.1']; ? It doesn't work (needless to say there is a cookie that goes by this name) So, when I did this: ? foreach($_COOKIE as $cook = $val) { echo $val . - .$cook .br; } ? I got: ec1c9edd209143432f36fsd29af410ef27 - test_1 Notice the _ (underscore) instead of . (dot) So I though that you couldn't have dots in your array names... Just to be sure I wrote a small test program like this: ? $d['donald.1'] = Donald duck; echo $d['donald.1']; ? This however gave me the output: Donald duck # /usr/local/jail/apache/bin/php -v PHP 4.3.1 (cli) (built: Apr 2 2003 11:25:25) Copyright (c) 1997-2002 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies So... anyone know what's up? -- Marcus Hufvudsson Artech administrator Office: +46-500-427788 Email: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Looping or what?
The code below is suppose to replace some images and links but when I run it the page just seems to hang and eventually times out. Am I Looping somewhere and not realising it? Thanks Zac $i = $c01_1; $imgLst = ''; function imgRplc($val){ global $imgLst; global $i; $imgLst .= div class=\figTtl\Fig. $i/divimg src=\$val[1]\ /,; return 'div class=fig(Fig.'.$i.')/div'; } // first remove pics and add a reference to the end of the doc for those that are required while(preg_match(/img type=\reg\ src/,$disp)){ $disp = preg_replace_callback(/img type=\reg\ src=\(.+)\ alt=(.+) \//i, 'imgRplc', $disp,1); $i++; } // now remove all other pics $disp = preg_replace(/img (.+) \//i, '', $disp); // remove bigPic links target=bigPic $disp = preg_replace(/a (.+) target=\bigPic\(.+)\/a/i, '\\2', $disp); // next find shopping links and mark up $disp = preg_replace(/a href=\(.+)\(.*)(.+)\/a/i, 'div class=shpLnkLink to: \\3 (Enter into your browser: http://www.lasersailing.com\\1)/div', $disp); // remove paragraphs $disp = preg_replace(/\/p(\s*)p/i, 'br /br /', $disp); $disp = preg_replace(/p/i, '', $disp); $disp = preg_replace(/\/p/i, '', $disp); echo $disp; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Big problem....need help
I have a table like this: - product_id-mark_name-category_name - -1- aaa - catg 1 - -2- bbb - catg 2 - -3- aaa - catg 1 - -4- ddd - catg 1 - -5- bbb - catg 2 - and so on I want to show all the mark_name in a category only once (if they more than once) I have this code: .. $sql = SELECT * FROM products, category WHERE category.name_category=products.name_category and category_id=.$_GET['category_id'] ; $rezultat = mysql_query($sql); while ($row=mysql_fetch_array($rezultat)) { echo bName:/b .$row[mark_name].br\n; } .. When i choose the category catg 1 the result is Name: aaa Name: aaa Name: ddd As you can see the name aaa appears 2 times insted 1. How to make the result look like this: Name: aaa Name: ddd
[PHP] Headers and server
Sorry if anyone has seen anything like this before but: All I want to do is get a script to write a file to the root directory. I get permission problems. Is there any way around this or am I going to go crazy trying. Obviously I can't have users setting the root directory to CHMOD 777, I can't expect users to get system admins to change ownerships on files, so is there a way in PHP script to write to the root after I have executed this script? The problem comes in the re-name of the script: function generate_page($formid, $pagename) { // Give the function the string to be generated including formid passed from // previous form // Begin string $string = ?php // include the files from output fns to get functions which design the page include ('output_fns.php'); db_connect(); \$query = \select * from goldfish_content where PageID='$formid'\; \$result = mysql_query(\$query) or die(\Error: Query failure withBR\$queryBR\.mysql_error()); while (\$array = mysql_fetch_array(\$result)) { \$HeadTitle = \\{\$array[\HeadTitle\]}\; \$PageTitle = \\{\$array[\Title\]}\; \$BodyText = \\{\$array[\BodyText\]}\; \$Picture1 = \\{\$array[\PictureOne\]}\; \$Picture2 = \\{\$array[\PictureTwo\]}\; \$CatID = \\{\$array[\CatID\]}\; } // carry the variable head title in the page and do the page header do_html_header(\$HeadTitle); // carry variables into do_html_index() function in output_fns. // Page title = The headline of the page // Body text = The text body, can include html commands. // Picture 1 = picture or graphic that appears above the title if required. // Picture 2 = Picture that appears right hand side on the basic output_fns // CatID = Category which is used for determining which links appear on each page // Section name = Allows you to specify extra functions to output_fns.php to be unique to the page (requires hard coding) do_html_index(\$PageTitle, \$BodyText, \$Picture1, \$Picture2, \$CatID, \$SECTION_NAME); // put the page footer in position do_html_footer(); ?; // end of string // Define the filename to write to. $filename = 'test.txt'; // Open the file for overwriting. $fp = fopen($filename, w); // Write the string to the file $write = fputs($fp, $string); // Close the file fclose($fp); // rename the page as a php file // everything works fine until I try to rename this file as the form $pagename var in the root. I get permission denied. rename ($filename, ../$pagename.php); // end of function. } // call the function. generate_page($formid, $pagename); ? The page generates great and everything is hunky dory if the root is chmoded 777 but I have a feeling I'm wasting my time with this route unless someone has a better idea. Steve Jackson Web Development and Marketing Manager Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP forum
me four! Couldn't resist, and I loke the top posty thingie too. JB -Original Message- From: Dan Anderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 7:39 AM To: PHP4 Emailer Cc: Richard Baskett; [EMAIL PROTECTED] Subject: RE: [PHP] PHP forum me three! j/k. -Dan On Wed, 2003-07-09 at 00:21, PHP4 Emailer wrote: HOLY COW, I never laughed so hard in my life, This is DEAD ON, for what happens in this exact forum. Damn that [EMAIL PROTECTED] is funny!! And I've only been here for about 3 months now. I've see about every one of those in that short time. Boy that cracks me up. Good find Richard!! ha... :} -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 10:42 PM To: PHP General Subject: [PHP] PHP forum Ok some of you might not like this, others of you will know exactly what I mean, but it just reminded me so much of this forum that I am sure some of you will catch the humor in it: http://www.mac-forums.com/forums/showpost.php?postid=5736postcount=85 Please keep your flames directed at me instead of the mailing list so we can keep this thread to one post. Cheers! What's in a name? That which we call a rose by any other name would smell as sweet. - Shakespeare -- 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] Refresh PHP
Ralph, Before anything, I would like to thank you for the time you are spending with my problem! Ok. I changed using $_SESSION and the problem still happens. I printed both, $_SESSION and $HTTP_SESSION_VARS and they are the same... not the current user, but the last logged. It's funny that in the next page, after login, if I print $_SESSION or $HTTP_SESSION_VARS they are right, but when I call another page (using a link), like some report, it appears the wrong user. All pages has the same header, setting no cache... any ideas? Thank you Mauricio Valente - Original Message - From: Ralph Guzman [EMAIL PROTECTED] To: 'Mauricio' [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 6:57 PM Subject: RE: [PHP] Refresh PHP I though you were passing the variable through the url. If you have this stored in a session, then try replacing $_GET with $_SESSION -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 1:56 PM To: 'PHP' Subject: Re: [PHP] Refresh PHP Doing this, it works. The variable 'url_variable' is changed when it pass over the if. But I don't want to use a get variable, it could be easily changed by the users... its my problem... Maurício Valente - Original Message - From: Ralph Guzman [EMAIL PROTECTED] To: 'Mauricio' [EMAIL PROTECTED]; 'PHP' [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 4:05 PM Subject: RE: [PHP] Refresh PHP How about: if($_GET['url_variable'] != $url_variable){ $url_variable = $_GET['url_variable']; session_register('url_variable') } -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 11:14 AM To: PHP Subject: Re: [PHP] Refresh PHP Hello Ralph, Actually, after calling session_destroy() I reset those variables assigning an empty value like you said. But it still doesn't work. I did a test after destroying session variables, printing them. They are empty. Another weird thing is that when a login as joao them logoff, exclude IE cache, going in Tools Internet Option..., and login again with another user, this way the variable are printed correctly. It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and Netscape 7. - Original Message - From: Ralph Guzman [EMAIL PROTECTED] To: 'Mauricio' [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 2:11 PM Subject: RE: [PHP] Refresh PHP Rather than using session_destroy() reset the session variable by assigning it an empty value. For example, lets say your url looks something like this: http://www.mydomain.com/?url_variable=Mauricio then do the following: if($_GET['url_variable'] != $url_variable){ $url_variable = ; session_register('url_variable') } -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 7:02 AM To: PHP Subject: [PHP] Refresh PHP Hi people! Did anyone get this situation? I'm creating a Site that uses 3 session variables. One of them I always print at the top of the page, it's the name of the user. There is a link that calls the function session_destroy(). Everytime that I follow this link and log in with another user, that session variable printed doesn't change, but if I press F5 in IE or Netscape them it brings the right user. I can't make the page return the current user login, it always came with the last user logged. I tried to add some headers to set no cache in all php pages, but it doesn't work. Anyone can help me??? Thanks PS: Sorry about my poor english... Maurício Valente -- 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Big problem....need help
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le Mercredi 9 Juillet 2003 15:13, phpu a écrit : I have a table like this: .. $sql = SELECT * FROM products, category WHERE category.name_category=products.name_category and category_id=.$_GET['category_id'] ; When i choose the category catg 1 the result is Name: aaa Name: aaa Name: ddd As you can see the name aaa appears 2 times insted 1. How to make the result look like this: Name: aaa Name: ddd Use GROUP BY $sql = SELECT * FROM products, category WHERE category.name_category=products.name_category and category_id=.$_GET['category_id'] GROUP BY products.mark_name; - -- ,, (° Nicolas Costes /|\ IUT de La Roche / Yon ( ^ ) Clé publique: http://www.keyserver.net/ ^ ^ http://www.gnu.org/philosophy/can-you-trust.fr.html -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/DB2GNc2aXy7LuOgRAmE6AKCIeGpWg78san/72M7vbhwJXQKXbQCfVxAJ OgayWbAh0cOXc5OCdVy2uWs= =vH6U -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP forum
I should also add that another 685 posts would say RTFM about lightbulbs. Steve Jackson Web Development and Marketing Manager Viola Systems Ltd. http://www.violasystems.com [EMAIL PROTECTED] Mobile +358 50 343 5159 -Original Message- From: Richard Baskett [mailto:[EMAIL PROTECTED] Sent: 9. heinäkuuta 2003 6:42 To: PHP General Subject: [PHP] PHP forum Ok some of you might not like this, others of you will know exactly what I mean, but it just reminded me so much of this forum that I am sure some of you will catch the humor in it: http://www.mac-forums.com/forums/showpost.php?postid=5736postcount=85 Please keep your flames directed at me instead of the mailing list so we can keep this thread to one post. Cheers! What's in a name? That which we call a rose by any other name would smell as sweet. - Shakespeare -- 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] Can php/mysql handle 10000s of records
From: Adam Gerson [EMAIL PROTECTED] Date: Wed Jul 9, 2003 9:48:20 AM America/New_York To: [EMAIL PROTECTED] Subject: Can php/mysql handle 1000's of records? I know this questions is a little of topic, but I figured the members of this list would have experience in this area. I am writing an attendance system in php/mysql for my school. We have a little less then 1000 students. For every day of the school year one record will be entered into a table for each student representing their attendance status (present, absent, late, etc...). I also have several other supporting tables for relationships. When it comes to reporting and querying this DB I am worried that it will very quickly become very large and slow. Can mysql handle this? Are there any techniques to speed it up? I will trying indexing major columns. I have also considered keeping all previous days attendance in a separate table from the current days attendance and moving things over in the middle of the night. This way any operations on the current days data will go quickly, but reports on long term things will still be slow. Good idea? Thanks, Adam --- Adam Gerson Systems Administrator / Computer Teacher Columbia Grammar and Prep School 212-749-6200 [EMAIL PROTECTED] www.cgps.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Antithesis to array_unique
Having STFM I am wondering if anyone knows of a quick antithesis to array_unique? We have an array in which we need to return all duplicate values instead of the non-duplicates. Thanks Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How configure PHP parser 4.3.x in IIS version 6.0?
[EMAIL PROTECTED] wrote: I use the dll php4isapi.dll and it doesn't work, Could someone give me a hand? Most of us don't have crystal balls. What does it do when it doesn't work? How is it set up? Give us some information! -- 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] Can php/mysql handle 10000s of records
[snip] I am writing an attendance system in php/mysql for my school. We have a little less then 1000 students. For every day of the school year one record will be entered into a table for each student representing their attendance status (present, absent, late, etc...). I also have several other supporting tables for relationships. When it comes to reporting and querying this DB I am worried that it will very quickly become very large and slow. Can mysql handle this? Are there any techniques to speed it up? I will trying indexing major columns. I have also considered keeping all previous days attendance in a separate table from the current days attendance and moving things over in the middle of the night. This way any operations on the current days data will go quickly, but reports on long term things will still be slow. Good idea? [/snip] The short answer is that 1s of records is no problem dependent upon the server, good coding, and good database optimization. We process millions of records each day with PHP and MySQL (today there are 58M records to be processed). Over time we have found bottlenecks and cleared them up. This is being done on a sub-1Ghz server (but I am looking forward to an updrade!). HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can php/mysql handle 10000s of records
It can handle 1,000,000 records without breaking a sweat. On Wed, 2003-07-09 at 09:54, Adam Gerson wrote: From: Adam Gerson [EMAIL PROTECTED] Date: Wed Jul 9, 2003 9:48:20 AM America/New_York To: [EMAIL PROTECTED] Subject: Can php/mysql handle 1000's of records? I know this questions is a little of topic, but I figured the members of this list would have experience in this area. I am writing an attendance system in php/mysql for my school. We have a little less then 1000 students. For every day of the school year one record will be entered into a table for each student representing their attendance status (present, absent, late, etc...). I also have several other supporting tables for relationships. When it comes to reporting and querying this DB I am worried that it will very quickly become very large and slow. Can mysql handle this? Are there any techniques to speed it up? I will trying indexing major columns. I have also considered keeping all previous days attendance in a separate table from the current days attendance and moving things over in the middle of the night. This way any operations on the current days data will go quickly, but reports on long term things will still be slow. Good idea? Thanks, Adam --- Adam Gerson Systems Administrator / Computer Teacher Columbia Grammar and Prep School 212-749-6200 [EMAIL PROTECTED] www.cgps.org -- Adam Voigt ([EMAIL PROTECTED]) Linux/Unix Network Administrator The Cryptocomm Group -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Antithesis to array_unique
Hello, This is a reply to an e-mail that you wrote on Wed, 9 Jul 2003 at 14:55, lines prefixed by '' were originally written by you. Having STFM I am wondering if anyone knows of a quick antithesis to array_unique? We have an array in which we need to return all duplicate values instead of the non-duplicates.=20 How about: $array1 = array(dupe,dupe,another item); $valuecount = array(); foreach($array1 as $value){ if(isset($valuecount[$value])){ $valuecount[$value]++; } else { $valuecount[$value] = 1; } } $dupes = array(); foreach($valuecount as $value=$count){ if($count1){ array_push($dupes,$value); } } // $dupes now contains all duplicate values. There may be a quicker way of doing it though... David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Bug or just a strange behaivor?
So I though that you couldn't have dots in your array names... Just to be sure I wrote a small test program like this: [snip] So... anyone know what's up? I believe that if you do it manually in a script, it works fine. But if PHP gets/sets the value from POST, GET, COOKIE, etc. it converts the dot to an underscore. Using the same test script (using donald.1), store it in a cookie and then retrieve it. Send it as POST or GET then try to display the value. Really good odds are that the dot will be converted. Again, I belive this is in the documentation, but I can't rightly remember where. :| Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: __get, __set, __clone
Hi Greg, thanks for the example. I think i now understand a bit more. I just need a confirmation on this $table-FirstName = 'Greg'; $table-LastName = 'Beaver'; This will actually call __set and it will create a member variable named FristName with the value Greg. And if you call $table-FirstName and it is not set it will return false right ? Honestly i find this way of coding no so clean. Maybe it is because i am used to do all my sets by hand $this-SetFirstName($first_name){ $this-first_name= $first_name; } $this-GetFirstName(){ if(!isset($this-first_name)){ return false; }else{ return $this-first_name; } } SO what are the advantages to use __get, __set. Aviously the way i do it, i do it i have to re have to redoit for all my variables. But also i was told to never access a variable directly so i have the feeling like i am doing a capital sin :D Yann On Wed, 2003-07-09 at 02:59, Yann Larrivee wrote: -Forwarded Message- From: Greg Beaver [EMAIL PROTECTED] To: Yann Larrivee [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] [EMAIL PROTECTED] Subject: Re: __get, __set, __clone Date: 08 Jul 2003 22:13:37 -0400 Hi Yann, What you are trying to do is possible in PHP 4, actually: ?php class MyTester { function MyTester() { $this-var_name1 = value1; $this-var_name2 = value2; } } $test = new MyTester; var_dump($test); // shows two variables, $var_name1 and $var_name2 ? Here is sample code that uses __set to allow you to transparently declare an object that allows you to set database values just by setting properties. ?php class UsesSetForMysql { private $_db; private $_table; private $_row; private $_keyname; function __construct($server, $user, $password, $database, $table, $keyname, $keyvalue) { $this-_db = mysql_connect($server, $user, $password); $this-_keyname = $keyname; $this-_table = $table; if ($this-_db) { $test = mysql_select_db($this-_db, $database); if ($test) { $a = mysql_query('SELECT * FROM ' . $this-_table . ' WHERE ' . $this-_keyname . ' = ' . $keyvalue . ''); if ($a) { $this-_row = mysql_fetch_array($a, MYSQL_ASSOC); } } else { mysql_close($this-_db); $this-_db = false; } } } function __destruct() { if ($this-_db) { mysql_close($this-_db); $this-_db = false; } } function __set($name, $value) { if (isset($this-_row) $this-_row) { $this-_row[$name] = $value; $a = mysql_query('UPDATE ' . $this-_table . SET $name = \$value\ WHERE . $this-_keyname . ' = ' . $this-_row[$this-_keyname] . ''); if ($a) { $keyvalue = $this-_row[$name]; if ($name == $this-_keyname) { $keyvalue = $value; } $a = mysql_query('SELECT * FROM ' . $this-_table . ' WHERE ' . $this-_keyname . ' = ' . $keyvalue . ''); $this-_row = mysql_fetch_array($a, MYSQL_ASSOC); } } } function __get($name, $value) { if (isset($this-_row) is_array($this-_row)) { if (isset($this-_row[$name])) { $value = $this-_row[$name]; return true; } else { return false; } } } } $table = new UsesSetForMysql('localhost', 'dummy', 'madeup', 'mytable', 'mykey', 6); $table-FirstName = 'Greg'; $table-LastName = 'Beaver'; // etc. ? :) Greg Yann Larrivee wrote: Hi, in the past 2 days i have been looking into php5 and it's new features. I am not a psecialiste of OOP (only been OOPing for 2 month) For a moment i tought that __set would allow me not to have to define a methode __set that would set a value to a member variable. It seems like we have to define the class __set and __get. for example i tought i would be able to do. class a{ function __construct(){ $this-__set(var_name1,value1); $this-__set(var_name2,value2); } } I read these 2 tutorial http://www.phpbuilder.com/columns/argerich20030411.php3?page=5 (the explanation seems really bad to me and does not show any usefull way to use these functions) http://talks.php.net/show/php5intro/25 This one well i comes back to the same thing as if i code it my self. So my big question is why , when , how do we use these features (__get,__set) For a moment i tought i would save me time, but if i have to redefine them what is the point ? I
[PHP] Re: NEW SPAMMER - [PHP] New Krysalis version released
Ryan A wrote: Didnt we just have a thread about spamming like this on the list? If it's a PHP-related product being announced, it isn't spam to me (and in fact, it's rather valuable), unless the announcement posts become repetitive. Steve -- Steve Magruder Consulting - http://consulting.stevemagruder.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP4 and PHP5 at one machine
Well, it is not possible to run two seperate php4ts.dll file in the same file path with the same file name even though they have different version. One workaround to it would be to compile the older version into a different file name while making sure the script point to that different file name but it got to be tough to do that. Because you'll be modifying the codes and compile it, into windows files and so on. Milan Reznicek [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Yes all these things I know, because already I'm running these two servers, but both with PHP4. But now I came accros the problem of php4ts.dll. Because in both versiones it has the same name. And if I have the old one my \WINNT\SYSTEM32 the server which is running PHP5 won't start, and if i put there the newer one the one with PHP4 won't start. That's my problem. Do you know how to solve this? Milan -- -- Milan Reznicek Software Developer e-mail: [EMAIL PROTECTED] Burhan Khalid [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Tuesday, July 8, 2003, 8:42:16 PM, Milan wrote: MR is there any posibility to run PHP4 and PHP5 at one machine, with two MR Apache servers running at the same time. MR Windows 2000 SP3 MR Apache 1.3.27/PHP 4.3.0 MR Apache 2.0.46/PHP 5.0.0b1 Yes it is possible. If you want both of the servers to be running at one time, then you'll have to change the Listen directive on one of them, since both will default to port 80. So, change one to something else, like 8080. Then access it with the port number http://address:port As far as the PHP install goes, you can have two PHP installs (one for each server), you just have to make sure where the .ini files are stored, and that the configuration directives for PHP (such as LoadModule, etc.) point to the right direction for each server. I also believe that the Apache Service Monitor can handle more than one Apache install, so you'll have a convienient place to control your servers. -- Regards, Burhan Khalid phplist[at]meidomus[dot]com http://www.meidomus.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Compiling PHP
I went over what you commented on - thanks for the input. Most everything did indeed stay. This is what I get when going a make install now: Installing PHP CLI binary:/usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing PHP SAPI module [activating module `php4' in /etc/httpd/conf/httpd.conf] cp libs/libphp4.so /usr/lib/apache/libphp4.so cp: cannot stat `libs/libphp4.so': No such file or directory apxs:Break: Command failed with rc=1 make: *** [install-sapi] Error 1 BTW, this all stems from another admin on the server wanting to upgrade apache to 1.3.27 - when that was done, my php written in my scripts started failing. It doesn't even work now. Whenever I have a script that passes a value (example: a link going to somewhere.php?w=4), it does not process at all (nothing happens - so w doesn't do anything). Everything worked fine until this started... My config file I am using is now: ./configure --with-apxs=/usr/sbin/apxs --with-gd --with-mysql --with-png --w ith-pear --with-config-file-path=/usr/local/apache --with-zlib --with-jpeg --with-ttf --with-regex=php --with-db --with-gdbm --enable-mbstring --enable -mm=shared --enable-xml --with-db3 --with-pgsql=shared --with-ldap Thanks for any help, -Mike -Original Message- From: Ralph Guzman [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 5:51 PM To: 'Mike At Spy'; [EMAIL PROTECTED] Subject: RE: [PHP] Compiling PHP The error you are providing here is because you do not have the required libraries installed. Some of these modules require that the programs or libraries be installed, php does not install them for you. This is an extensive config. Are you sure you need all these. I see that you are trying to enable pgsql, mySQL, interbase. Will you be running all these databases on you server? I've looked through your config, and below are some notes I made. Hope this helps. .. --prefix=/usr is there a reason why you must install php to /usr. The default directory is /usr/local/lib? --with-apxs=/usr/sbin/apxs is your apache compiled with mod_so for apxs support? http://httpd.apache.org/docs/programs/apxs.html --enable-safe-mode this may restrict some php functions --with-exec-dir=/usr/bin this will allow executables in your /usr/bin directory. This might be a security risk. Why not let it default to /usr/local/php/bin? --with-zlib I think this should be --with-zlib-dir=DIR http://www.php.net/zlib --with-regex=system PHP supports regular expressions by default. Why don't you use --with-regex=php http://www.php.net/regex --with-ttf do you have the FreeType libraries installed? http://www.php.net/image --with-db does your server support this type of database? http://www.php.net/manual/en/ref.dbm.php --with-gdbm does your server support this type of database? --with-mbstring do you need multi-byte character support? http://www.php.net/mbstring --with-mbstr-enc-trans not sure what this does. --with-libdir not sure what this does. --with-interbase=shared are you running Interbase on your server? http://www.php.net/manual/en/ref.ibase.php --with-pgsql=shared are you running PostgreSQL on your server? http://www.php.net/manual/en/ref.pgsql.php --with-ldap do you have LDAP libraries installed? http://www.php.net/manual/en/ref.ldap.php --with-imap-ssl I think this should be --with-imap-ssl=[DIR] http://www.php.net/imap --with-mysql are you running MySQL on your server? http://www.php.net/manual/en/ref.mysql.php --with-gd Do you have the GD library installed? http://www.php.net/manual/en/ref.image.php --with-png Do you have PNG library installed? http://www.php.net/manual/en/ref.image.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
Re: [PHP] Refresh PHP
PHP session functions and $_SESSION work kind of funny with Internet Explorer while this problem rarely happen in 3rd party browser due to the bad design of Internet Explorer... It's a microsoft problem. I have this similiar problem with Internet Explorer. The workaround to the problem I have is to eliminate the use of session_destroy(). Someone anyone login, a new session token will be created anyway. Shockingly, when going from one webpage to another, Internet Explorer sometime grab a wrong session token. Mauricio [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Ralph, Before anything, I would like to thank you for the time you are spending with my problem! Ok. I changed using $_SESSION and the problem still happens. I printed both, $_SESSION and $HTTP_SESSION_VARS and they are the same... not the current user, but the last logged. It's funny that in the next page, after login, if I print $_SESSION or $HTTP_SESSION_VARS they are right, but when I call another page (using a link), like some report, it appears the wrong user. All pages has the same header, setting no cache... any ideas? Thank you Mauricio Valente - Original Message - From: Ralph Guzman [EMAIL PROTECTED] To: 'Mauricio' [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 6:57 PM Subject: RE: [PHP] Refresh PHP I though you were passing the variable through the url. If you have this stored in a session, then try replacing $_GET with $_SESSION -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 1:56 PM To: 'PHP' Subject: Re: [PHP] Refresh PHP Doing this, it works. The variable 'url_variable' is changed when it pass over the if. But I don't want to use a get variable, it could be easily changed by the users... its my problem... Maurício Valente - Original Message - From: Ralph Guzman [EMAIL PROTECTED] To: 'Mauricio' [EMAIL PROTECTED]; 'PHP' [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 4:05 PM Subject: RE: [PHP] Refresh PHP How about: if($_GET['url_variable'] != $url_variable){ $url_variable = $_GET['url_variable']; session_register('url_variable') } -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 11:14 AM To: PHP Subject: Re: [PHP] Refresh PHP Hello Ralph, Actually, after calling session_destroy() I reset those variables assigning an empty value like you said. But it still doesn't work. I did a test after destroying session variables, printing them. They are empty. Another weird thing is that when a login as joao them logoff, exclude IE cache, going in Tools Internet Option..., and login again with another user, this way the variable are printed correctly. It happens in any windows version (95,98,ME,2K,XP) using IE 6.0 and Netscape 7. - Original Message - From: Ralph Guzman [EMAIL PROTECTED] To: 'Mauricio' [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 2:11 PM Subject: RE: [PHP] Refresh PHP Rather than using session_destroy() reset the session variable by assigning it an empty value. For example, lets say your url looks something like this: http://www.mydomain.com/?url_variable=Mauricio then do the following: if($_GET['url_variable'] != $url_variable){ $url_variable = ; session_register('url_variable') } -Original Message- From: Mauricio [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 7:02 AM To: PHP Subject: [PHP] Refresh PHP Hi people! Did anyone get this situation? I'm creating a Site that uses 3 session variables. One of them I always print at the top of the page, it's the name of the user. There is a link that calls the function session_destroy(). Everytime that I follow this link and log in with another user, that session variable printed doesn't change, but if I press F5 in IE or Netscape them it brings the right user. I can't make the page return the current user login, it always came with the last user logged. I tried to add some headers to set no cache in all php pages, but it doesn't work. Anyone can help me??? Thanks PS: Sorry about my poor english... Maurício Valente -- 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 -- PHP General Mailing
RE: [PHP] PHP Bug or just a strange behaivor?
-Original Message- From: Marcus Hufvudsson [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 13:56 Hi, Let's get right to it... When I try to do this: ? echo $_COOKIE['test.1']; ? It doesn't work (needless to say there is a cookie that goes by this name) So, when I did this: ? foreach($_COOKIE as $cook = $val) { echo $val . - .$cook .br; } ? I got: ec1c9edd209143432f36fsd29af410ef27 - test_1 Notice the _ (underscore) instead of . (dot) Because, when register_globals is set to On, the names of all GET, POST and COOKIE parameters will be used as variable names, they may only contain characters which are legal in PHP variable names. PHP automagically converts all other characters to _ on the fly as they are loaded into the $_GET, $_POST and $_COOKIE arrays and, if register_globals is set, the equivalent global variables. So I though that you couldn't have dots in your array names... There's no problem with this -- it's purely that GET, POST and COOKIE names must conform to PHP variable naming rules. This is documented, if somewhat minimally, at http://uk2.php.net/manual/en/language.variables.external.php#language.variab les.external.dot-in-names. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mcrypt warning
Hi All, I have the following function: function encrypt ($x) { $ini = parse_ini_file ($GLOBALS['INI_PATH']); $td = mcrypt_module_open ('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), MCRYPT_RIJNDAEL_256); mcrypt_generic_init ($td, $ini[key], $iv); $encrypted_data = mcrypt_generic ($td, $x); mcrypt_generic_deinit ($td); mcrypt_module_close ($td); return bin2hex($encrypted_data); } I get the following PHP Warning in my logs, however, the code executes ok: [Wed Jul 9 10:25:49 2003] [error] PHP Warning: mcrypt_generic_init(): Iv size incorrect; supplied length: 0, needed: 8 in /usr/local/apache/htdocs-uat-retail/include/nocheck.iostream.class.php on line 87 I have read into mcrypt, tried a couple things, but nothing will get rid of that error. Could someone show me what I've done wrong? -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: simple ereg() question
Eddy-Das [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] ereg(.+) Thank you -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] To All Those Seeking XML PHP Wisdom!
Found a brand new tutorial... just came out today... http://www.sitepoint.com/article/1165 Joe Harman Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac. - George Carlen
RE: [PHP] Antithesis to array_unique
-Original Message- From: David Nicholson [mailto:[EMAIL PROTECTED] Sent: 09 July 2003 15:08 This is a reply to an e-mail that you wrote on Wed, 9 Jul 2003 at 14:55, lines prefixed by '' were originally written by you. Having STFM I am wondering if anyone knows of a quick antithesis to array_unique? We have an array in which we need to return all duplicate values instead of the non-duplicates.=20 How about: $array1 = array(dupe,dupe,another item); $valuecount = array(); foreach($array1 as $value){ if(isset($valuecount[$value])){ $valuecount[$value]++; } else { $valuecount[$value] = 1; } } $dupes = array(); foreach($valuecount as $value=$count){ if($count1){ array_push($dupes,$value); } } // $dupes now contains all duplicate values. There may be a quicker way of doing it though... Well, for a kick-off, how about making use of array_count_values() (http://www.php.net/array_count_values)? $array1 = array(dupe,dupe,another item); $dupes = array(); foreach(array_count_values($array1) as $value=$count){ if($count1){ $dupes[] = $value; } } I think judicious applications of array_unique() and array_diff() could also do the job, although I don't know how this compares for efficiency: $dupes = array_unique(array_diff($array1, array_unique($array1))); Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Steve - Re: [PHP] Re: NEW SPAMMER - [PHP] New Krysalis version released
Hey, Cool, I guess it boils down to a matter of opinion then, but if you feel all PHP related products are not spam (commercial or not) everytime the 3 sites I am in touch with releases a new php product will be sure to let you know! I hope you dont have any complaints. Cheers, -Ryan - Original Message - From: Steve Magruder [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 3:08 PM Subject: [PHP] Re: NEW SPAMMER - [PHP] New Krysalis version released Ryan A wrote: Didnt we just have a thread about spamming like this on the list? If it's a PHP-related product being announced, it isn't spam to me (and in fact, it's rather valuable), unless the announcement posts become repetitive. Steve -- Steve Magruder Consulting - http://consulting.stevemagruder.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] Regex nightmare:(
i need to uses reg ex to change a href=url to a href=url target=_blank the brackets have to be represented using lt; and gt; I have tried so many ways, but none work. here is an example of my faliure. $body = preg_replace(/(href=\/?)(\w+)(gt;\/?)/e,'\\1'.'\\2'./'target=_blank/ '.'\\3', $body); Thanks
RE: [PHP] session data missing
After creating a new session with session_start() and inserting a few values e.g $HTTP_SESSION_VARS['foo'] = 'bar'; a file /tmp/sess_{session_id} is created. The problem is that this file is empty! 0 bytes. no data is stored. I'm using php 4.0.6 on linux with apache 1.3 something. Check the register_globals setting in php.ini. If it is set to On, then code like this: session_start(); $foo = 'bar'; session_register('foo'); echo $foo; If register_globals is set to Off, then code as you are already doing: session_start(); $HTTP_SESSION_VARS['foo'] = 'bar'; echo {$HTTP_SESSION_VARS['foo']}; Kirk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can php/mysql handle 10000s of records
Suprisingly MySQL is very good, as the others have said... I've been involved in a few sites that have been known to hammer the DB pretty hard.. And it's stood up to the test... Hmmm... I am sure others here can validate this... But I think the size limit for the database is about 4 gigs!!! That's a ton... The last company I had worked for had a huge customer database... But on a different system... But similar.. And it was only 280 megs!!! It contain records for over 58,000 customers... And inventory, accounting... Blah blah Probably the most critical thing to remember is efficient code... And optimizd use of MySQL... If you follow that, MySQL and PHP will scream... There are somethings you can do for MySQL... I was trying to locate an article for you that I read just the other day... But they were talking about indexing MySQL... I am sure the other members of this board can point you in the right direction... Have a great day Joe Harman http://www.HarmanMedia.com Everything is funny as long as it is happening to somebody else. - Will Rogers -Original Message- From: Adam Gerson [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 9:54 AM To: [EMAIL PROTECTED] Subject: [PHP] Can php/mysql handle 1s of records From: Adam Gerson [EMAIL PROTECTED] Date: Wed Jul 9, 2003 9:48:20 AM America/New_York To: [EMAIL PROTECTED] Subject: Can php/mysql handle 1000's of records? I know this questions is a little of topic, but I figured the members of this list would have experience in this area. I am writing an attendance system in php/mysql for my school. We have a little less then 1000 students. For every day of the school year one record will be entered into a table for each student representing their attendance status (present, absent, late, etc...). I also have several other supporting tables for relationships. When it comes to reporting and querying this DB I am worried that it will very quickly become very large and slow. Can mysql handle this? Are there any techniques to speed it up? I will trying indexing major columns. I have also considered keeping all previous days attendance in a separate table from the current days attendance and moving things over in the middle of the night. This way any operations on the current days data will go quickly, but reports on long term things will still be slow. Good idea? Thanks, Adam --- Adam Gerson Systems Administrator / Computer Teacher Columbia Grammar and Prep School 212-749-6200 [EMAIL PROTECTED] www.cgps.org -- 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] Using PHP with windows logon
On Wed, 2003-07-09 at 03:32, Brenton Dobell wrote: can you use your windows logon as set it as a variable in php? U should probably look at how activex does it. I know that asp scripts do it all the time and possibly some com objects can set that for you. I have connected to exchange and used the username login (they type in) to authenticate against. -- BigDog -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: __get, __set, __clone
Yann Larrivee wrote: Hi Greg, thanks for the example. I think i now understand a bit more. I just need a confirmation on this $table-FirstName = 'Greg'; $table-LastName = 'Beaver'; This will actually call __set and it will create a member variable named FristName with the value Greg. Not necessarily. __set is called only if it is defined. You can implement __set the way that you will throw an error if FirstName is being set to 'Greg': class Table { private $properties; function __set($name, $value) { switch($name) { case 'FirstName': if($value=='Greg') { echo Table: Warning: Greg is forbidden here!; return; } if($value=='') { echo Table: Warning: FirstName cannot be empty!; return; } break; default: echo Table: Warning: Unknown property '$name'!; return; } $this-properties[$name]=$value; } } And if you call $table-FirstName and it is not set it will return false right ? Again, here is called the __get method (if defined). And again if implemented, it can return anything. SO what are the advantages to use __get, __set. You have more control over the state of your object, your properties cannot be set to something you don't want. You can also create properties on the fly with the __get method. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] XML
U should read the docs on domxml. There is alot of examples in there on how to do that and xslt. Here are tons of tutorials to on phpbuilder.com, phpbeginner.com. -- BigDog On Wed, 2003-07-09 at 06:02, Petre Agenbag wrote: Hi List Firstly, thanks for the replies and mostly for the accommodating attitude to this, arguable non-PHP subject. I don't want this thread to become a flame war on why one should use XML, or why not. I do have personal issues wrt XML and the way it works, and although I cannot *yet* see the need, it doesn't mean that there isn't one. My original post should have made this clear, but it seems it didn't. I have laid to rest my reservations wrt XML, and am more interested in understanding the entire process in the hope that 1) I will see the need, and 2) understand how all those XML jargon fits together ( XML, XSL, XSLT, DTD, DOMXML, phew...) That was why I gave a brief summary of where I am atm wrt understanding what it is. What I still don't know much about, and at last, this is where the PHP comes in, is once I have this XML file, whereto from here using PHP ( you see, it should be clear that I want to use PHP as my one and only trusty tool. As I stated, and correct me, the XML file contains the structured data, and the XSL file contains the look and feel and the XSL file is written in XSLT language. My understanding is further that, again focused only on web applications here, one would have an XML file in your web folder, along with it's XSL file. These files would be linked by means of calls or references to each other inside the files. Having these two files (oh, and the dtd which can be used to verify the XML, but doesn't seem necessary from what I can see), as I understand it, gives the basis from where one would then parse the XML into XHTML in order to actually see anything in a browser via one of two routes: 1) client side via the browser's built in XML parser - arguably leaving the old Netscape/IE gap wrt compatibility, or 2) server side parsing with the built-in XML parser that comes with the webserver (IIS or Apache in my case) - with this approach being in my mind the best if you want to make sure you don't run into browser issues. This is where my PHP question really starts: On apache.org they talk about the XML support of apache etc, and in the PHP documentation there are lots of XML functions and yet more jargon like DOMXML etc, which is not clear for me what to do now (should I elect to parse server side). If someone can just give me a quick and easy tour on what to do and what is needed from here to actually parse and display the contents correctly, I should have enough to keep me busy for a while, and hopefully help me to increase my knowledge and understanding so I won't ask stupid questions on this list ;) Thanks again for the input. On Wed, 2003-07-09 at 00:36, Ray Hunter wrote: I see that not many sites require the use of xml/xsl(t). Many sites can just use html and database to accomplish 99.9% of the work. I always suggest that when you have tons of data that you need to send to the user that it is a good idea. Especially now that xslt is growing up :) I like to use xml and xsl for various reasons, mainly i can really separate the logic and presentation. All data is keep in the xml file and presentation in the xsl file. So when i need to make changes in the presentation then i only change the xsl file and never really have to touch the logic (php) code. This is really, really great for some sights that are extremely complex. Also in php i can create standards that my xml files will follow (dtds, schema) and allowing me to create modules (functionality) very efficiently and timely. Also as mentioned xml provides a format for transfering data. However, i would not use it with databases unless it is large amounts of data. However, i have used xml for creating sql queries and setting up configureation files which are extremely reliabe. -- BigDog On Tue, 2003-07-08 at 15:51, Jeff Harris wrote: |-Original Message- |From: Petre Agenbag [mailto:[EMAIL PROTECTED] |Sent: Tuesday, July 08, 2003 6:27 AM |To: [EMAIL PROTECTED] |Subject: [PHP] XML | | |Hi List | |Firstly, this question is arguable more about XML than PHP, but they are |interlinked, so I hope it is topical for this list. | |Firstly, Where I come from: | |I am VERY comfortable with PHP/MySQL on Linux and understand all those |concepts. | |Now I'm trying to see the benefits of XML, and quite frankly, I just |cannot see why one would want to use it... | [snip] On Jul 8, 2003, Joe Harman claimed that: |Okay Petre... You have asked the question that I always wanted to ask!!! |I can't wait to see peoples answer... I simply can't find a use for it |either | |Joe
[PHP] client running
My sysadmin installed PHP as a client on my linux server. I have a script that I developed that opens a socket to accept data feed. This script works great if I run it off my windows pc using the cgi version of php but when I get it to the server it runs and it doesn't do anything. I did get an error message cause I had the mysql username wrong so it is reading the script. I checked the syntax with the -l command and I ran it with -a as well and nothing I created a test script that simply echoed my name and it worked great. any ideas? Thanks Randy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] linking with home directory
I have a script that contains style sheets and I can't seem to link it on my Windows 2000 IIS server. It works perfectly fine on my Windows XP IIS server. Here is what I am trying to do. The index.php file (which links to the style sheets) is located in the MyScript folder and inside that folder is another folder called themes (where the style sheets are located). I am doing the following, which works fine on a Windows XP IIS server, but not my Windows 2000. // Path to script files (absolute file path) $HomeDir = c:/inetpub/wwwroot/MyScript/; // Name of style folder $ThemeFolder = default; //--- Then later in the page, I link the style sheet like this ---// echo link rel='stylesheet' type='text/css' href='.$HomeDir.themes/.$ThemeFolder./style.css' ; Like I said before, the style sheets load up fine on my Windows XP IIS server, but not the Windows 2000. In order to get it to work on the Windows 2000 IIS server, I have to link the style sheets relative to the folder I am working in, but I want to be able to move certain files into other directories without manually linking each one, so that's why I am linking them from the absolute home directory. Is there some setting in the php.ini file that deals with this? If anyone has suggestions, please let me know. I assume the above code would work on Linux systems without problems (given the correct home directory path). Can anyone verify this? Thanks a lot. Matt P.S. Sorry if this is a duplicate question. I didn't get any responses before, so I wasn't sure if it went through or not. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Can php/mysql handle 10000s of records
[snip] Suprisingly MySQL is very good, as the others have said... I've been involved in a few sites that have been known to hammer the DB pretty hard.. And it's stood up to the test... Hmmm... I am sure others here can validate this... But I think the size limit for the database is about 4 gigs!!! That's a ton... [/snip] Actually you can set tables to exceed 4Gb ... some of the tables we have are currently in excess of 45Gb -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_SESSION act funny...
Noticed that if I assign data to a $_SESSION array and go to the next webpage then you'll have that new data. If you go to the next webpage by using the same file (webpage) or a $_SERVER['PHP_SELF'], the data in the $_SESSION array remain the same, it does not change as it should. But if you do the browser refresh, the data would remain the same which it should be. How do I do a workaround to the problem. I would appreciate any help... --snip-- File -- page1.php ? // Let's say $_SESSION['test'] already have the data as 'one'... @session_start(); $SID = session_name().=.session_id(); if ($_SESSION['test'] == one) { $_SESSION['test'] = two }; if ($_SESSION['test'] == two) { $_SESSION['test'] = three }; if ($_SESSION['test'] == three) { $_SESSION['test'] = four }; if ($_SESSION['test'] == four) { $_SESSION['test'] = one }; echo a href='page1.php?$SID'Next Page/a; ? --snip-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] linking with home directory
First, I'd create a simple test to see what the value of $newDir = $HomeDir.themes/.$ThemeFolder; print $newDir; And see what that yields. You might have a problem with your slashes. I find it extremely useful to have test variables print to the screen along the way to ensure that each new part of my code is receiving the correct information. It helps isolate where the problem data or logic lies. (becomes increasingly useful as you use many functions, classes, includes or just generally large scripts). -M -Original Message- From: mpalermo [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 11:37 AM To: [EMAIL PROTECTED] Subject: [PHP] linking with home directory is evaluating to with the string addition: // Path to script files (absolute file path) $HomeDir = c:/inetpub/wwwroot/MyScript/; // Name of style folder $ThemeFolder = default; //--- Then later in the page, I link the style sheet like this ---// echo link rel='stylesheet' type='text/css' href='.$HomeDir.themes/.$ThemeFolder./style.css' ; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] linking with home directory
[snip] Like I said before, the style sheets load up fine on my Windows XP IIS server, but not the Windows 2000. In order to get it to work on the Windows 2000 IIS server, I have to link the style sheets relative to the folder I am working in, but I want to be able to move certain files into other directories without manually linking each one, so that's why I am linking them from the absolute home directory. [/snip] When you are testing the scripts, are testing them on the same machine that is serving the pages? If you are, does the XP server still link the style sheets correctly if you test the script from a different machine? Just trying to get a little more info. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] linking with home directory
The XP and 2000 are two different machines. = Original Message From Matt Matijevich [EMAIL PROTECTED] = [snip] Like I said before, the style sheets load up fine on my Windows XP IIS server, but not the Windows 2000. In order to get it to work on the Windows 2000 IIS server, I have to link the style sheets relative to the folder I am working in, but I want to be able to move certain files into other directories without manually linking each one, so that's why I am linking them from the absolute home directory. [/snip] When you are testing the scripts, are testing them on the same machine that is serving the pages? If you are, does the XP server still link the style sheets correctly if you test the script from a different machine? Just trying to get a little more info. -- 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] linking with home directory
I have done that, and it displays the correct location. I don't know what else to do. Is there maybe something in the php.ini file? = Original Message From Mike Brum [EMAIL PROTECTED] = First, I'd create a simple test to see what the value of $newDir = $HomeDir.themes/.$ThemeFolder; print $newDir; And see what that yields. You might have a problem with your slashes. I find it extremely useful to have test variables print to the screen along the way to ensure that each new part of my code is receiving the correct information. It helps isolate where the problem data or logic lies. (becomes increasingly useful as you use many functions, classes, includes or just generally large scripts). -M -Original Message- From: mpalermo [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 11:37 AM To: [EMAIL PROTECTED] Subject: [PHP] linking with home directory is evaluating to with the string addition: // Path to script files (absolute file path) $HomeDir = c:/inetpub/wwwroot/MyScript/; // Name of style folder $ThemeFolder = default; //--- Then later in the page, I link the style sheet like this ---// echo link rel='stylesheet' type='text/css' href='.$HomeDir.themes/.$ThemeFolder./style.css' ; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] linking with home directory
I mean, when you actually call the script on the XP machine, where do you test it at? Do you use a browser that is on the XP machine that is running IIS, or do you do it from a different machine? Matt Palermo [EMAIL PROTECTED] 07/09/03 10:52AM The XP and 2000 are two different machines. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] linking with home directory path
Hello, This is a reply to an e-mail that you wrote on Wed, 9 Jul 2003 at 12:51, lines prefixed by '' were originally written by you. // Path to script files (absolute file path) $HomeDir = c:/inetpub/wwwroot/MyScript/; // Name of style folder $ThemeFolder = default; //-Then later in the page, I link the style sheet like this ---// echo link rel='stylesheet' type='text/css' href='.$HomeDir.themes/.$ThemeFolder./style.css' Doing this will mean that your script will only work correctly when viewed on webserver computer. Remote browsers will not be able to access the style sheet as you are referencing it as a file on your server machine. Is this what you intended? David. -- phpmachine :: The quick and easy to use service providing you with professionally developed PHP scripts :: http://www.phpmachine.com/ Professional Web Development by David Nicholson http://www.djnicholson.com/ QuizSender.com - How well do your friends actually know you? http://www.quizsender.com/ (developed entirely in PHP) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] linking with home directory
I am testing it from the same machine for right now. = Original Message From Matt Matijevich [EMAIL PROTECTED] = I mean, when you actually call the script on the XP machine, where do you test it at? Do you use a browser that is on the XP machine that is running IIS, or do you do it from a different machine? Matt Palermo [EMAIL PROTECTED] 07/09/03 10:52AM The XP and 2000 are two different machines. -- 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] $_SESSION act funny...
Scott Fletcher wrote: ? // Let's say $_SESSION['test'] already have the data as 'one'... @session_start(); $SID = session_name().=.session_id(); if ($_SESSION['test'] == one) { $_SESSION['test'] = two }; $_SESSION['test'] is now 'two', so the next test is true if ($_SESSION['test'] == two) { $_SESSION['test'] = three }; $_SESSION['test'] is now 'three', so the next test is true if ($_SESSION['test'] == three) { $_SESSION['test'] = four }; $_SESSION['test'] is now 'four', so the next test is true if ($_SESSION['test'] == four) { $_SESSION['test'] = one }; $_SESSION['test'] is now 'one' again echo a href='page1.php?$SID'Next Page/a; ? --snip-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] linking with home directory
Maybe you should try to reference it from http://localhost/MyScript/default/style.css ? -M -Original Message- From: Matt Palermo [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 12:02 PM To: Matt Matijevich; php-general Subject: RE: [PHP] linking with home directory I am testing it from the same machine for right now. = Original Message From Matt Matijevich [EMAIL PROTECTED] = I mean, when you actually call the script on the XP machine, where do you test it at? Do you use a browser that is on the XP machine that is running IIS, or do you do it from a different machine? Matt Palermo [EMAIL PROTECTED] 07/09/03 10:52AM The XP and 2000 are two different machines. -- 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] Simple forms query
I know this has prob been gone through hundreds of times... I have a form, and I want to display all the form variables on the target page - without having to use separate print statements for each variable. tks - Enda Nagle +353 86 168 0774 [EMAIL PROTECTED]www.nightsol.net - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Simple forms query
[snip] I have a form, and I want to display all the form variables on the target page - without having to use separate print statements for each variable. [/snip] print_r($_POST); or print_r($_GET); hth -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple forms query
I am not 100% sure but I think you could use the $_POST array or the $_GET array (depending on the method of your form) with the print_r function. Enda Nagle [EMAIL PROTECTED] 07/09/03 11:04AM I know this has prob been gone through hundreds of times... I have a form, and I want to display all the form variables on the target page - without having to use separate print statements for each variable. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Big problem....need help
It isn't work. it gives me an error at this line. - Original Message - From: Nicolas Costes [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 4:49 PM Subject: Re: [PHP] Big problemneed help -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Le Mercredi 9 Juillet 2003 15:13, phpu a écrit : I have a table like this: .. $sql = SELECT * FROM products, category WHERE category.name_category=products.name_category and category_id=.$_GET['category_id'] ; When i choose the category catg 1 the result is Name: aaa Name: aaa Name: ddd As you can see the name aaa appears 2 times insted 1. How to make the result look like this: Name: aaa Name: ddd Use GROUP BY $sql = SELECT * FROM products, category WHERE category.name_category=products.name_category and category_id=.$_GET['category_id'] GROUP BY products.mark_name; - -- ,, (° Nicolas Costes /|\ IUT de La Roche / Yon ( ^ ) Clé publique: http://www.keyserver.net/ ^ ^ http://www.gnu.org/philosophy/can-you-trust.fr.html -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE/DB2GNc2aXy7LuOgRAmE6AKCIeGpWg78san/72M7vbhwJXQKXbQCfVxAJ OgayWbAh0cOXc5OCdVy2uWs= =vH6U -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] Simple forms query
Hi guys, Thanks a mil - works great. I'm trying to develop a shopping cart in PHP/MySQL so I'll no doubt be back soon with more queries - thanks Enda -- -Original Message- From: Matt Matijevich [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 5:17 PM To: Subject: Re: [PHP] Simple forms query I am not 100% sure but I think you could use the $_POST array or the $_GET array (depending on the method of your form) with the print_r function. Enda Nagle [EMAIL PROTECTED] 07/09/03 11:04AM I know this has prob been gone through hundreds of times... I have a form, and I want to display all the form variables on the target page - without having to use separate print statements for each variable. -- 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] $_SESSION act funny...
If you go to the next webpage by using the same file (webpage) or a $_SERVER['PHP_SELF'], the data in the $_SESSION array remain the same, it does not change as it should. snip if ($_SESSION['test'] == one) { $_SESSION['test'] = two }; if ($_SESSION['test'] == two) { $_SESSION['test'] = three }; if ($_SESSION['test'] == three) { $_SESSION['test'] = four }; if ($_SESSION['test'] == four) { $_SESSION['test'] = one }; The code above will always result in $_SESSION['test'] == 'one', if you start from any of the four tested values. Is there some other behavior you are expecting? - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SESSION act funny...
I'm kind of expecting them to change because using the hyperlink to go to the next webpage should be treated as such for the same file (webpage file). The reason I'm using the same file is because of the navigation menu with all of the menu options that go to the include file... Mike Migurski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If you go to the next webpage by using the same file (webpage) or a $_SERVER['PHP_SELF'], the data in the $_SESSION array remain the same, it does not change as it should. snip if ($_SESSION['test'] == one) { $_SESSION['test'] = two }; if ($_SESSION['test'] == two) { $_SESSION['test'] = three }; if ($_SESSION['test'] == three) { $_SESSION['test'] = four }; if ($_SESSION['test'] == four) { $_SESSION['test'] = one }; The code above will always result in $_SESSION['test'] == 'one', if you start from any of the four tested values. Is there some other behavior you are expecting? - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] $_SESSION act funny...
Oh Ha ha... I see what you meant.. The $_SESSION['test'] had already been changed from one to two, then three, then four, then back to one. I didn't see that coming.. I thought it just start at one and haven't changed at all. Thanks!!! Scott Fletcher [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm kind of expecting them to change because using the hyperlink to go to the next webpage should be treated as such for the same file (webpage file). The reason I'm using the same file is because of the navigation menu with all of the menu options that go to the include file... Mike Migurski [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] If you go to the next webpage by using the same file (webpage) or a $_SERVER['PHP_SELF'], the data in the $_SESSION array remain the same, it does not change as it should. snip if ($_SESSION['test'] == one) { $_SESSION['test'] = two }; if ($_SESSION['test'] == two) { $_SESSION['test'] = three }; if ($_SESSION['test'] == three) { $_SESSION['test'] = four }; if ($_SESSION['test'] == four) { $_SESSION['test'] = one }; The code above will always result in $_SESSION['test'] == 'one', if you start from any of the four tested values. Is there some other behavior you are expecting? - michal migurski- contact info and pgp key: sf/cahttp://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php