[PHP] sessions problem, need help
Hello, I'm new to sessions and I know a little php, but don't use it enough to remember it. I'm trying to use sessions for a couple of reasons. I will explain as i go along. My index.html is this (www.loveobjects.com) -not porn my host uses version 4.0.6 html head script language=javascript !-- var cWidth=0, cHeight=0; fsize=12; function clientSize() { if( typeof( window.innerWidth ) == 'number' ) { //Non-IE cWidth = window.innerWidth; cHeight = window.innerHeight; } else { if( document.documentElement ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {//IE 6+ in 'standards compliant mode' cWidth = document.documentElement.clientWidth; cHeight = document.documentElement.clientHeight; } else { if( document.body ( document.body.clientWidth || document.body.clientHeight ) ) { //IE 4 compatible cWidth = document.body.clientWidth; cHeight = document.body.clientHeight; } } } location.replace('http://www.loveobjects.com/test_1.php?w='+cWidth+'h='+cHeight+'fSize='+fsize); } -- /script /head body bgcolor=#00; onload=javascript:clientSize();/body /html You can see that it gets the client window size and sets a default font size, then redirects, sending along the vars in the url string. The test_1.php looks like this. ?php session_start(); header(Cache-control: private); $HTTP_SESSION_VARS['width'] = $HTTP_GET_VARS['w']; $HTTP_SESSION_VARS['height'] = $HTTP_GET_VARS['h']; $HTTP_SESSION_VARS['fontS'] = $HTTP_GET_VARS['fSize']; $HTTP_SESSION_VARS['fontC'] = $HTTP_GET_VARS['cFont']; $HTTP_SESSION_VARS['id'] = session_id(); header(Location: http://www.loveobjects.com/test_2.php?id=.$HTTP_SESSION_VARS['id']); ? But, this gives me a 404. I've tried to use a link instead of the header() such as: print(a href=\/test_2.php?id=.$HTTP_SESSION_VARS['id'].this/a); Which will create a href=./test_2.php?id=b5c93c1f165018cda39d0d751d27d368this/a and show in the status bar as http://www.loveobjects.com/test_2.php?id=b5c93c1f165018cda39d0d751d27d368 but this gives me a 404 too. (The _ is there in test_2.php. in the above line. You just don't see it with the whole link underlined). I don't want to pass along the client and font vars by means of the GET vars to test_2.php. I want them in the session vars. I want to be able to change the font size, or let the user change the font size. And I don't want a font size var hanging around in the url string. I also want to limit what info and be bookmarked. I also don't want to rely on cookies to send the session id and other stuff. test_2.php looks like this: ?php session_start(); header(Cache-control: private); require($_SERVER[DOCUMENT_ROOT] . Pagemaker.class); $pagemaker = new Pagemaker; $pagemaker-set_fontsize($HTTP_SESSION_VARS['fontC'],$HTTP_SESSION_VARS['FontC']); $pagemaker-set_stdwidth($HTTP_SESSION_VARS['width']); $pagemaker-set_stdheight($HTTP_SESSION_VARS['height']); $pagemaker-find(test_1); //print($pagemaker-Errno); print($pagemaker-Error); print($pagemaker-haltmsg); print($pagemaker-contents); ? Pagemaker.class worked before I started wwith all this session stuff. (with different code ofcourse) Please help. Any suggestions will be helpful. Thanks Noel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file not opening in internet explorer
Ok, someone help him out. Maybe, just maybe the file belongs to someone else than you. I had that happen to me once too. CuteFTP can show you that. Is this possible people? What happened when you checked the permissions? 644? Then CHMOD it 644 again yourself to see if it makes a difference. http://192.168.0.1/bdoi_change/sundar.html dear john, i checked the file permission by fileperms and its giving me 644 i.e. rw-r-r. what should i change my CHMOD to so that i can view my file in internet explorer? thanks, diksha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file not opening in internet explorer
On Wednesday 19 February 2003 15:27, DIKSHA NEEL wrote: $fp = fopen(\bdoi_change\sundar.html, w); i am able to write to this file through my php page filecheck.php and even am able to read the written contents. but when i enter http://192.168.0.1/bdoi_change/sundar.html in my internet explorer address bar, it says the page cannot be displayed. the file permissions are rw-r-r Stupid question -- are you running a webserver? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The fact that 47 PEOPLE are yelling and sweat is cascading down my SPINAL COLUMN is fairly enjoyable!! */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: file not opening in internet explorer
At 09:07 19.02.2003, John Taylor-Johnston said: [snip] What happened when you checked the permissions? 644? Then CHMOD it 644 again yourself to see if it makes a difference. [snip] Make sure the webserver can read/execute the directory, too. -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file not opening in internet explorer
dear john, i made the CHMOD myself to 644. but the file is still not opening. do u have any more ideas? Sorry no. Tapped out. But I'm not a pro coder myself. Someone will answer. Someone is awake and coding. Come on guys. Give the lady a break. and i am not 'he'.i am 'she'. I stand corrected :( Sorry. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file not opening in internet explorer
the file permissions are rw-r-r Stupid question -- are you running a webserver? Charming isn't he? /* The fact that 47 PEOPLE are yelling and sweat is cascading down my SPINAL COLUMN is fairly enjoyable!! */ Indeed. Help the colleague out Jason, or get off the channel. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] file not opening in internet explorer
At 08:27 19.02.2003, DIKSHA NEEL said: [snip] $fp = fopen(\bdoi_change\sundar.html, w); i am able to write to this file through my php page filecheck.php and even am able to read the written contents. but when i enter http://192.168.0.1/bdoi_change/sundar.html in my internet explorer address bar, it says the page cannot be displayed. the file permissions are rw-r-r [snip] A couple of questions: - what operating system are you (and the webserver) on? - what webserver brand do you use? - to what directory is the document root for the webserver configured? - what is the url of filecheck.php? -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file not opening in internet explorer
On Wed, Feb 19, 2003 at 07:27:02AM -, DIKSHA NEEL wrote: hi all, Hi Diksha, $fp = fopen(\bdoi_change\sundar.html, w); Mind your slashes. Is this PHP script running on a unix/Linux box, or in MS Windows? If it's unix, remember that a backslash is *not* the characters used to identify directories. i am able to write to this file through my php page filecheck.php and even am able to read the written contents. but when i enter http://192.168.0.1/bdoi_change/sundar.html in my internet explorer address bar, it says the page cannot be displayed. Remember that from fopen()'s perspective, the root directory is whatever is root to the web server's process. And a URL's root directory is the DocumentRoot directive in your Apache configuration. If you have pointed your DocumentRoot at your operating system's root directory, then the above setup should work, but otherwise, you need to fopen() the file relative to your DocumentRoot. And check your web server's log files. Apache will keep a log of every HTTP request that's made. That log will always tell you exactly what's happening, and where the system is looking for files. the file permissions are rw-r-r No they're not. They might be rw-r--r--, but not what you put. When you talk about file modes, it's safer to refer to them in octal. So rw-r--r-- would be 644, and rw-rw-rw- would be 666. Less confusion. p -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever it.canada, hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] BBS software in PHP?
Can anyone recommend a simple (and free) BBS module/software written in PHP. preferably something that writes to a DB and preferably PoserSQL. I would like to add some bulletin board functionality to my web pages but don't feel like reinventing the wheel :) Jc -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] DB row selection
Hello, I recently learnt that with the code as stated below, I can select one row: $query = SELECT * FROM polls ORDER BY pollID ASC LIMIT 0,1; However as far as I could figure out, I can only select the top row or tell it at what rownumber to start and end. What if I wanted to select the bottom row? Would I have to do an extra query to count the rows and then select it with LIMIT? Or is there a way to do this without an extra query? thx, Hans -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDF_OPEN_IMAGE
I am lost on this pdf_open_image(); i am creating an image... can i do this $image = ImageCreateTrueColor(100, 100); $red = ImageColorAllocate ($image, 255, 0, 0); $blue = ImageColorAllocate ($image, 0, 0, 255); ImageFilledRectangle($image, 0, 0, 100, 100, $red); ImageFilledRectangle($image, 20, 20, 80, 80, $blue); $temp1 = pdf_open_image($pdf, jpeg, memory, $image LOST ME HERE !! please show me the way ! Thanks Joel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB row selection
At 10:57 19.02.2003, you said: [snip] Hello, I recently learnt that with the code as stated below, I can select one row: $query = SELECT * FROM polls ORDER BY pollID ASC LIMIT 0,1; However as far as I could figure out, I can only select the top row or tell it at what rownumber to start and end. What if I wanted to select the bottom row? Would I have to do an extra query to count the rows and then select it with LIMIT? [snip] $query = SELECT * FROM polls ORDER BY pollID DESC LIMIT 0,1; -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Block direct image loads but allow them in PHP
[snip] if(isset($i)) { //codeImageURL decodes $i into an image path that we can work with $link=codeImageURL($i); if($link!= (isAdmin() || !isThisFileBlocked($link))) { header(Cache-control: private); header(Content-type: image/jpg); header(Content-Disposition: attachment; filename=.$link); $fp = fopen($link, 'r'); fpassthru($fp); fclose($fp); } else echo Error: Couldn't decode image URLbr\n; } Michael Have you tried header('Content-type: image/jpeg') ? Note the 'e'... Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB row selection
That's weird.. that was the first thing I tried (DESC), but it gave me a syntax error at runtime.. however, when I tried it now, it worked.. I probably had another error that confused me. Thx a bunch :-) Ernest E Vogelsinger [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 10:57 19.02.2003, you said: [snip] Hello, I recently learnt that with the code as stated below, I can select one row: $query = SELECT * FROM polls ORDER BY pollID ASC LIMIT 0,1; However as far as I could figure out, I can only select the top row or tell it at what rownumber to start and end. What if I wanted to select the bottom row? Would I have to do an extra query to count the rows and then select it with LIMIT? [snip] $query = SELECT * FROM polls ORDER BY pollID DESC LIMIT 0,1; -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB row selection
same thing $query = SELECT * FROM polls ORDER BY pollID DESC LIMIT 1; dont need both params for LIMIT. just the num of rows u want back works too. Joel Hans Prins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... That's weird.. that was the first thing I tried (DESC), but it gave me a syntax error at runtime.. however, when I tried it now, it worked.. I probably had another error that confused me. Thx a bunch :-) Ernest E Vogelsinger [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 10:57 19.02.2003, you said: [snip] Hello, I recently learnt that with the code as stated below, I can select one row: $query = SELECT * FROM polls ORDER BY pollID ASC LIMIT 0,1; However as far as I could figure out, I can only select the top row or tell it at what rownumber to start and end. What if I wanted to select the bottom row? Would I have to do an extra query to count the rows and then select it with LIMIT? [snip] $query = SELECT * FROM polls ORDER BY pollID DESC LIMIT 0,1; -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing info to forms
Greetings all, Whenever I run the code below, it bombs out with error Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /home/data/ClientWebs/chrisplay/CustAmend.php on line 15 = Basically, I am trying to pass info from an array from a previous page, where $row['ClientID'] is one of the fields I want to populate my page with...here`s the code for the whole page .. === ?php //Create SQL to get Client Info $sSQLGetClient = Select * FROM Client . $sSQLGetClient = where ClientID = . '$row['ClientID']' ; $ResGetClient = mysql_query($sSQLGetClient); if (!$ResGetClient) { echo(PError performing query: . mysql_error() . /P); exit(); } $row = mysql_fetch_array($ResGetClient); ? === 5 days into PHP so this stuff is all new...perhaps I`m missing the boat totally. I visited PHP.com and phpfreaks but couldn`t find info on passing variables between forms. Thanks in advance for any assistance. -- Chris Blake Office : (011) 782-0840 Cell : 083 985 0379 It is reported that somewhere in the world, every 15 seconds, a woman gives birth to a child. She must be found and stopped. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB row selection
You might want to look at mysql_data_seek() HTH RVW Quoting Hans Prins [EMAIL PROTECTED]: ### Hello, ### I recently learnt that with the code as stated below, I can select one ### row: ### ### $query = SELECT * FROM polls ORDER BY pollID ASC LIMIT 0,1; ### ### However as far as I could figure out, I can only select the top row or ### tell ### it at what rownumber to start and end. What if I wanted to select the ### bottom ### row? Would I have to do an extra query to count the rows and then select ### it ### with LIMIT? ### ### Or is there a way to do this without an extra query? ### ### thx, ### ### Hans ### ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### -- Richard Whitney * Transcend Development Producing the next phase of your internet presence. [EMAIL PROTECTED] * http://xend.net* 602-971-2791 * * * * * *__** _/ \___ * * / *\** */ * * \ **/\_ |\ / \_ / \ / \/\ / \ /\ / \ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing info to forms
Quoting Chris Blake [EMAIL PROTECTED]: ### Greetings all, ### ### Whenever I run the code below, it bombs out with error ### ### ### Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or ### `T_NUM_STRING' in /home/data/ClientWebs/chrisplay/CustAmend.php on line ### 15 ### = ### ### Basically, I am trying to pass info from an array from a previous page, ### where $row['ClientID'] is one of the fields I want to populate my page ### with...here`s the code for the whole page .. ### ### === ### ### ?php ### //Create SQL to get Client Info ### $sSQLGetClient = Select * FROM Client . $sSQLGetClient = where ClientID = . '$row['ClientID']' ; should be: *** Note the concatenator (.) *** ### $sSQLGetClient .= where ClientID = . '$row['ClientID']' ; ### ### $ResGetClient = mysql_query($sSQLGetClient); ### if (!$ResGetClient) { ### echo(PError performing query: . mysql_error() . ### /P); ### exit(); ###} ### ### $row = mysql_fetch_array($ResGetClient); ### ### ? ### ### === ### ### 5 days into PHP so this stuff is all new...perhaps I`m missing the boat ### totally. I visited PHP.com and phpfreaks but couldn`t find info on ### passing variables between forms. ### ### Thanks in advance for any assistance. ### ### -- ### Chris Blake ### Office : (011) 782-0840 ### Cell : 083 985 0379 ### It is reported that somewhere in the world, every 15 seconds, a woman ### gives birth to a child. She must be found and stopped. ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### -- Richard Whitney * Transcend Development Producing the next phase of your internet presence. [EMAIL PROTECTED] * http://xend.net* 602-971-2791 * * * * * *__** _/ \___ * * / *\** */ * * \ **/\_ |\ / \_ / \ / \/\ / \ /\ / \ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Passing info to forms
Quoting Chris Blake [EMAIL PROTECTED]: ### Greetings all, ### ### Whenever I run the code below, it bombs out with error ### ### ### Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or ### `T_NUM_STRING' in /home/data/ClientWebs/chrisplay/CustAmend.php on line ### 15 ### = ### ### Basically, I am trying to pass info from an array from a previous page, ### where $row['ClientID'] is one of the fields I want to populate my page ### with...here`s the code for the whole page .. ### ### === ### ### ?php ### //Create SQL to get Client Info ### $sSQLGetClient = Select * FROM Client . don't forget to terminate your lines with a ; (semicolon) ### $sSQLGetClient = Select * FROM Client ; ### $sSQLGetClient = where ClientID = . '$row['ClientID']' ; ### ### $ResGetClient = mysql_query($sSQLGetClient); ### if (!$ResGetClient) { ### echo(PError performing query: . mysql_error() . ### /P); ### exit(); ###} ### ### $row = mysql_fetch_array($ResGetClient); ### ### ? ### ### === ### ### 5 days into PHP so this stuff is all new...perhaps I`m missing the boat ### totally. I visited PHP.com and phpfreaks but couldn`t find info on ### passing variables between forms. ### ### Thanks in advance for any assistance. ### ### -- ### Chris Blake ### Office : (011) 782-0840 ### Cell : 083 985 0379 ### It is reported that somewhere in the world, every 15 seconds, a woman ### gives birth to a child. She must be found and stopped. ### ### ### -- ### PHP General Mailing List (http://www.php.net/) ### To unsubscribe, visit: http://www.php.net/unsub.php ### ### -- Richard Whitney * Transcend Development Producing the next phase of your internet presence. [EMAIL PROTECTED] * http://xend.net* 602-971-2791 * * * * * *__** _/ \___ * * / *\** */ * * \ **/\_ |\ / \_ / \ / \/\ / \ /\ / \ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] escaping quotes for redisplay
-Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: 18 February 2003 18:11 PS: I am using htmlentities() on the output before displaying it in the browser, but it doesn't apply to singlequotes. Ahem! I quote from http://www.php.net/manual/en/function.htmlentities.php: ... the optional second quote_style parameter lets you define what will be done with 'single' and double quotes. It takes on one of three constants with the default being ENT_COMPAT: Constant Name Description ENT_COMPAT Will convert double-quotes and leave single- quotes alone. ENT_QUOTES Will convert both double and single quotes. ENT_NOQUOTES Will leave both double and single quotes unconverted. So just use htmlentities($output, ENT_QUOTES). 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] online tutorial
dear all, i am a final year engineering student and have started studying PHP since last 10 days. can anybody suggest some good online tutorial for mastering PHP? regards, diksha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] BBS software in PHP?
PoserSQL? do you mean PostgreSQL? my favorite is PHPBB (www.phpbb.com) HTH t. -Message d'origine- De : Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] Envoye : mercredi 19 fevrier 2003 10:25 A : [EMAIL PROTECTED] Objet : [PHP] BBS software in PHP? Can anyone recommend a simple (and free) BBS module/software written in PHP. preferably something that writes to a DB and preferably PoserSQL. I would like to add some bulletin board functionality to my web pages but don't feel like reinventing the wheel :) Jc -- 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] BBS software in PHP?
On Wednesday 19 Feb 2003 9:25 am, Jean-Christian Imbeault wrote: Can anyone recommend a simple (and free) BBS module/software written in PHP. preferably something that writes to a DB and preferably PoserSQL. If you want a simple and non bloated forum software you could do worse than use www.phorum.org. Cheers John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] online tutorial
dear all, i am a final year engineering student and have started studying PHP since last 10 days. can anybody suggest some good online tutorial for mastering PHP? regards, diksha. Hi Diskha try these urls... http://www.zend.com/zend/tut/ http://www.php.net/manual/en/tutorial.php http://www.devshed.com/Server_Side/PHP Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] online tutorial
http://www.devshed.com http://www.phpfreaks.com Search Google - PHP Tutorials - Original Message - From: DIKSHA NEEL [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 11:50 AM Subject: [PHP] online tutorial dear all, i am a final year engineering student and have started studying PHP since last 10 days. can anybody suggest some good online tutorial for mastering PHP? regards, diksha. -- 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] limit contral
Hi, all I'm quite new to php and still finding my way round and came across a problem. I'm making a script that pulls property (house) from a mysql database in categories e.g. there cat1, cat2 ect and in each category I only want to show 10 properties a time then click next to show the next 10 properties in that catorgy. here is the main part of the script http://www.smoothdesign.com/green/ if anyone can help that would be great. James [EMAIL PROTECTED]
[PHP] Backticks and echo
Hello everyone I reread the manual again on the topic of backticks and from that I have security / usabilitiy issue. Here is the issue: When I check formdata from a simple form I use regular expression to make sure the input confirms to certain guidlines before including them into my scripts. Basically this means excluding special character like the above mentioned backticks. Well so far so good. When the input is wrong I'd like to redisplay the wrong input and ask the user to correct these. Now here comes the issue as far as I understand the manual the text inbetween backticks is executed and the output is included in place. This happens when I echo the text out. So if I don't allow backticks in my input field and I want to redisplay that input I execute the code right? Meaning I can'T redisplay the text as the user inputed it. When I use escapeshellcmd to prevent any execution I redisplay the input differently than the users input. This will confuse most users and is not as wished from a usability standpoint. So have I missunderstood the way backticks work or is this an unresolvable issue? Any help greatly appreciated Stefan
Re: [PHP] Backticks and echo
At 13:27 19.02.2003, [EMAIL PROTECTED] said: [snip] happens when I echo the text out. So if I don't allow backticks in my input field and I want to redisplay that input I execute the code right? Meaning I can'T redisplay the text as the user inputed it. When I use escapeshellcmd to prevent any execution I redisplay the input differently than the users input. This will confuse most users and is not as wished from a usability standpoint. So have I missunderstood the way backticks work or is this an unresolvable issue? [snip] No, you don't execute backticks if you display them. Look at these examples: // directly execute the command using backticks $files = `ls -al .`; // create a command and execute it $cmd = '`ls -al . `'; eval(\$files = $cmd;); // outputting the command in a form input field doesn't execute echo 'input type=text name=whatever value=' . $cmd . ''; -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] limit contral
James Shergold wrote: Hi, all I'm quite new to php and still finding my way round and came across a problem. I'm making a script that pulls property (house) from a mysql database in categories e.g. there cat1, cat2 ect and in each category I only want to show 10 properties a time then click next to show the next 10 properties in that catorgy. here is the main part of the script http://www.smoothdesign.com/green/ if anyone can help that would be great. James [EMAIL PROTECTED] Hi James, You can limit the number of results using SQL: SELECT foo FROM bar ORDER by blah LIMIT 10 As for showing a page at a time - I have not done this before in PHP, but it is referred to as paging. Have a search on google and I am sure you will find a solution. Jono -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] hi
hi jason, my file is opening perfectly fine now. thanks. take care, diksha. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Recursion with database tables
Hi all, I am still pretty new to PHP, but I was chatting to a friend the other day and he put some thoughts into my head about how tables are laid out and processed. At the moment I have three tables: Topic, Message, Comment. A topic has messages and each message can have comments. I have set this up with a table each and a field for the id of the parent (e.g. a comment will have the id of the message that it refers to). My mate said to me that I should really put all of this in one big table with a parent and child field. He said that my code should then figure out what is the child of what and how it is displayed. I have two questions about this: 1. First, is this idea of using one big table with parent/child fields better than my seperate table approach? 2. Secondly, how would I write the logic for the single table approach. Any help or advice or links to documentation would be great. Cheers, Jono -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] limit contral
At 13:11 19.02.2003, James Shergold said: [snip] I'm making a script that pulls property (house) from a mysql database in categories e.g. there cat1, cat2 ect and in each category I only want to show 10 properties a time then click next to show the next 10 properties in that catorgy. [snip] Limiting the SQL result set brings you half the way there, as Jono already pointed out: SELECT foo FROM bar ORDER by blah LIMIT 10 For paging, you might additionally tell the database where to start by adding the OFFSET parameter: SELECT foo FROM bar ORDER by blah OFFSET 0 LIMIT 10 SELECT foo FROM bar ORDER by blah OFFSET 10 LIMIT 10 SELECT foo FROM bar ORDER by blah OFFSET 20 LIMIT 10 Note: This syntax is for PostgreSQL; MySQL also allows a slightly different syntax: SELECT foo FROM bar ORDER by blah LIMIT 0,10 SELECT foo FROM bar ORDER by blah LIMIT 10,10 SELECT foo FROM bar ORDER by blah LIMIT 20,10 From the MySQL manual (http://www.mysql.com/doc/en/SELECT.html): SELECT [STRAIGHT_JOIN] ... [LIMIT [offset,] rows | rows OFFSET offset] HTH, -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Best way to sort a multidimentional array....
Hello, I need to manipulate, the following data in a number of diffierent ways (specifics follow). Telephone extension number - 4 digits in the range 2000-2119 Total time on phone - seconds integer values Total No. of calls - integer value Name - A persons name I'm purposely NOT using a database table for this data. I'm storing the data in a multidemensional array, the stucture of which is below, and I need to sort it by Total Time On Phone in decending order, which is the first element of the 'embedded' array. I have got an idea of how to write a function to do this, I'm sure I can get it too work. But I figured someone must have had to do something like this b4 and so was after any advice/code and/or a more elegant way of achieving what I what? Any ideas/comments would be well recieved. Thanks A lot Best Wishes Roland Tarver //just filled with some descriptive default values $extensionsDetails = array('Total Time On Phone', 'Total Number of calls', 'name of person'); // a hash of extention numbers and the $extensionsDetails array (above) $telData = array( // management '2000' = $extensionsDetails, '2001' = $extensionsDetails, '2002' = $extensionsDetails, '2003' = $extensionsDetails, '2004' = $extensionsDetails, '2005' = $extensionsDetails, // sales '2020' = $extensionsDetails, '2021' = $extensionsDetails, '2022' = $extensionsDetails, '2023' = $extensionsDetails, '2024' = $extensionsDetails, '2025' = $extensionsDetails, '2026' = $extensionsDetails, '2027' = $extensionsDetails, '2028' = $extensionsDetails, '2029' = $extensionsDetails, '2030' = $extensionsDetails, '2031' = $extensionsDetails, '2032' = $extensionsDetails, '2033' = $extensionsDetails, '2034' = $extensionsDetails, '2035' = $extensionsDetails, '2036' = $extensionsDetails, '2037' = $extensionsDetails, '2040' = $extensionsDetails, '2041' = $extensionsDetails, '2043' = $extensionsDetails, '2044' = $extensionsDetails, '2045' = $extensionsDetails, '2046' = $extensionsDetails, '2047' = $extensionsDetails, '2048' = $extensionsDetails, '2049' = $extensionsDetails, '2050' = $extensionsDetails, '2051' = $extensionsDetails, '2052' = $extensionsDetails, '2053' = $extensionsDetails, '2054' = $extensionsDetails, // media/production '2101' = $extensionsDetails, '2102' = $extensionsDetails, '2103' = $extensionsDetails, '2104' = $extensionsDetails, '2105' = $extensionsDetails, '2106' = $extensionsDetails, '2107' = $extensionsDetails, '2111' = $extensionsDetails, '2112' = $extensionsDetails, ); // end TelData array -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] is it possible to retrieve email from HOTMAIL
I wonder if it is possible to retrieve emails from an email account say in hotmail, yahoo, or any other email provider. silly hah ..? Thanx in advance. _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to retrieve email from HOTMAIL
Abu Musaab wrote: I wonder if it is possible to retrieve emails from an email account say in hotmail, yahoo, or any other email provider. silly hah ..? Thanx in advance. _ Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail I would suggest you look into using sockets to do this. You can open a connection to any server with fsockopen() and then send data with fgets(). It should be possible because a web browser works on telnet port 80, so there is no reason why you should be able to do it in PHP. The thing you need to know is what kind of conversation the script needs to have with the server. Try accessing the site in telnet port 80 and see what happens. Jono -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
At 14:43 19.02.2003, Jono Bacon said: [snip] At the moment I have three tables: Topic, Message, Comment. A topic has messages and each message can have comments. I have set this up with a table each and a field for the id of the parent (e.g. a comment will have the id of the message that it refers to). My mate said to me that I should really put all of this in one big table with a parent and child field. He said that my code should then figure out what is the child of what and how it is displayed. This are one-to-many relationships? If yes, then your mate is wrong, you can't easily implement one-to-many using a single table. A problem like yours is usually laid out like this (pseudocode): TABLE TOPIC id integer primary key; topicvarchar; TABLE MESSAGE id integer primary key; id_topic integer foreign key references TOPIC(id); message text; TABLE COMMENT id integer primary key; id_message integer foreign key references MESSAGE(id); comment text; I have two questions about this: 1. First, is this idea of using one big table with parent/child fields better than my seperate table approach? See above. 2. Secondly, how would I write the logic for the single table approach. Forget it, use the approach above :) -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
Ernest E Vogelsinger wrote: At 14:43 19.02.2003, Jono Bacon said: [snip] At the moment I have three tables: Topic, Message, Comment. A topic has messages and each message can have comments. I have set this up with a table each and a field for the id of the parent (e.g. a comment will have the id of the message that it refers to). My mate said to me that I should really put all of this in one big table with a parent and child field. He said that my code should then figure out what is the child of what and how it is displayed. This are one-to-many relationships? If yes, then your mate is wrong, you can't easily implement one-to-many using a single table. snip Hi Ernest, Thanks for your swift response. The code that you posed is the technique I have used at the moment. This technique works fine, but like my mate said, this limits me to a single parent for a comment/message. I admit that is unlikely that I would need more than one parent, but what would happen if I changed the parent - would this model still work fine? I am considering sticking with this technique - it seems to make more sense and I thought it would be quicker for queries as I wouldnt have to query a single table with a million rows. One questions though - if I delete a topic, I need to delete all of its child messages and all of the child comments from each message. What is the best technique to do this? This has been driving me up the wall as it seems to involve some kind of looping and recursion. Jono -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] is it possible to retrieve email from HOTMAIL
I wonder if it is possible to retrieve emails from an email account say in hotmail, yahoo, or any other email provider. silly hah ..? Thanx in advance. EXPLAINING MY IDEA (in other words): I mean making a script that goes to my email in, say Hotmail, and get all the messages and store them in a database on my own site. so that when I or any subscribed user in the site enters his account, he finds new messages directed to him. Of course the email here is an email account on the server of the hosting company of the site. I hope my exlanation does not need an explanation. _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Best way to sort a multidimentional array....
-Original Message- From: Mark Cubitt [mailto:[EMAIL PROTECTED]] Sent: 19 February 2003 12:43 I need to manipulate, the following data in a number of diffierent ways I'm storing the data in a multidemensional array, the stucture of which is below, and I need to sort it by Total Time On Phone in decending order, which is the first element of the 'embedded' array. //just filled with some descriptive default values $extensionsDetails = array('Total Time On Phone', 'Total Number of calls', 'name of person'); // a hash of extention numbers and the $extensionsDetails array (above) $telData = array( // management '2000' = $extensionsDetails, '2001' = $extensionsDetails, Use usort() with a callback that compares the 'Total Time On Phone' elements. Something like: function compTime($a, $b) { return $a[0]==$b[0]?0:($a[0]$b[0]?1:-1); } usort($telData, 'compTime'); 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] security issues on shared servers
Thanks. Looks like a properly configured safe mode could eliminate a lot of problems. A few follow-up questions: 1. I see in the PHP doc comments a patch for Apache (http://luxik.cdi.cz/~devik/apache/) that runs different virtual hosts as different users. Anyone know anything about it, in terms of safety, effectiveness, stability, speed? 2. With safe mode enabled and all shell-access functions disabled through disabled_functions, it looks like most to all of problem (1) in my original email would be eliminated. But how do you specify the backtick operator in disabled_functions? --Dave On Tuesday, February 18, 2003, at 09:27 PM, Jason Sheets wrote: If your hosting provider has enabled safe mode then others can not include scripts that have a different uid than the owner of the current script, that prevents them from including your code. As far as the files go you could checksum them or if you are honestly concerned about them being changed store them in your database where only you have write access, the problem with that is that for your application to connect to your database it must know the db password, if the other users have shell access they can read your applications source code and connect to your db as your application. Bottom line, safe mode makes PHP a lot safer in multi user environments but you are always going to be exposed when you go with a multi user environment. Any programming language/application encounters these problems when introduced into a large multi user environment, switching programming languages would not alleviate these security issues. On Tue, 2003-02-18 at 15:49, David Feldman wrote: I run a PHP-based Web site hosted on a shared UNIX server provided by a pretty standard Web hosting company -- as I imagine do many people. There are a lot of users on this server, and I know nothing about them. Apache (and thus PHP) generally runs as www or nobody, so although each user on this shared server has a separate account, all PHP scripts run as the same user. As such, I have a few security concerns: 1. I restrict access to certain portions of my site, either with ..htaccess/.htpasswd files or with a PHP equivalent. This works fine for anyone using a Web browser, but it leaves a security hole: One can write a PHP script that circumvents the Apache access restrictions, either by calling a UNIX shell command (using passthru(), backticks, etc., only some of which are blocked on my server), or, more disturbingly, by using the include command. Using either of these methods in a publicly available page can circumvent htaccess- or PHP-based authorization and output the contents of a supposedly restricted file, _including_ a file in another user's Web site. 2. I am working on a PHP script that allows users to upload images, view them, and ultimately send them over email. All the problems listed in (1) apply, but in addition, these images' owner is www or nobody, the user PHP runs as. As such, not only could other users on the same shared server view these uploaded files, they could modify or delete them through a PHP script, and it doesn't matter what I set the access privileges to with chmod(), since they can call chmod() on the files themselves. Now, I can run a checksum at upload time and verify it later on to ensure that uploaded files haven't been changed. But that might still leave a few seconds (between upload and checksum) during which a file could be altered, and doesn't protect against deletions. Both (1) and (2) are disturbing to me, since if I'm protecting a portion of my site I don't want several hundred random people (whose only qualification is that they purchased Web space at the same company I did) to have access to it. Is there any way, short of a dedicated server or a wholesale switch to another server-side language, to avoid these problems? Thanks. --Dave -- -- -- David Feldman User Interface Designer -- 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] online tutorial
I originally learned PHP from the section in O'Reilly's book, Webmaster in a Nutshell. I did have extensive prior programming experience though. Since then, the PHP online manual has been more than sufficient. --Dave On Wednesday, February 19, 2003, at 07:10 AM, Awlad Hussain wrote: http://www.devshed.com http://www.phpfreaks.com Search Google - PHP Tutorials - Original Message - From: DIKSHA NEEL [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 11:50 AM Subject: [PHP] online tutorial dear all, i am a final year engineering student and have started studying PHP since last 10 days. can anybody suggest some good online tutorial for mastering PHP? regards, diksha. -- 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] is it possible to retrieve email from HOTMAIL
On Wed, 19 Feb 2003 12:57:42 +, you wrote: I wonder if it is possible to retrieve emails from an email account say in hotmail, yahoo, or any other email provider. http://people.freenet.de/courierdave/ http://httpmail.sourceforge.net/ http://www.geocities.com/ballarke/Projects/HttpMail/HttpMail.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
On Wed, 19 Feb 2003 13:56:49 +, you wrote: One questions though - if I delete a topic, I need to delete all of its child messages and all of the child comments from each message. What is the best technique to do this? This has been driving me up the wall as it seems to involve some kind of looping and recursion. make sure /all/ your comments have the correct topicid set. Then simply DELETE FROM comment WHERE topicid = x Otherwise, yes, in MySQL you have to recurse down the tree deleting comments. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
David Otton wrote: On Wed, 19 Feb 2003 13:56:49 +, you wrote: One questions though - if I delete a topic, I need to delete all of its child messages and all of the child comments from each message. What is the best technique to do this? This has been driving me up the wall as it seems to involve some kind of looping and recursion. make sure /all/ your comments have the correct topicid set. Then simply DELETE FROM comment WHERE topicid = x Otherwise, yes, in MySQL you have to recurse down the tree deleting comments. How would I go about recursing down the tree? Has anyone done this before? Jono -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] security issues on shared servers
OK, my question #2 below is answered by the docs: Safe mode disabled the backtick operator. But having turned on safe mode on my local test server, I have another question: Suddenly my include statements that user relative paths don't work. For example: include /absolute/path/to/include/file.php; works fine, but include include/file.php doesn't. I don't see anything in the docs about this...what's going on? Thanks again, --Dave On Wednesday, February 19, 2003, at 08:03 AM, David Feldman wrote: Thanks. Looks like a properly configured safe mode could eliminate a lot of problems. A few follow-up questions: 1. I see in the PHP doc comments a patch for Apache (http://luxik.cdi.cz/~devik/apache/) that runs different virtual hosts as different users. Anyone know anything about it, in terms of safety, effectiveness, stability, speed? 2. With safe mode enabled and all shell-access functions disabled through disabled_functions, it looks like most to all of problem (1) in my original email would be eliminated. But how do you specify the backtick operator in disabled_functions? --Dave On Tuesday, February 18, 2003, at 09:27 PM, Jason Sheets wrote: If your hosting provider has enabled safe mode then others can not include scripts that have a different uid than the owner of the current script, that prevents them from including your code. As far as the files go you could checksum them or if you are honestly concerned about them being changed store them in your database where only you have write access, the problem with that is that for your application to connect to your database it must know the db password, if the other users have shell access they can read your applications source code and connect to your db as your application. Bottom line, safe mode makes PHP a lot safer in multi user environments but you are always going to be exposed when you go with a multi user environment. Any programming language/application encounters these problems when introduced into a large multi user environment, switching programming languages would not alleviate these security issues. On Tue, 2003-02-18 at 15:49, David Feldman wrote: I run a PHP-based Web site hosted on a shared UNIX server provided by a pretty standard Web hosting company -- as I imagine do many people. There are a lot of users on this server, and I know nothing about them. Apache (and thus PHP) generally runs as www or nobody, so although each user on this shared server has a separate account, all PHP scripts run as the same user. As such, I have a few security concerns: 1. I restrict access to certain portions of my site, either with ..htaccess/.htpasswd files or with a PHP equivalent. This works fine for anyone using a Web browser, but it leaves a security hole: One can write a PHP script that circumvents the Apache access restrictions, either by calling a UNIX shell command (using passthru(), backticks, etc., only some of which are blocked on my server), or, more disturbingly, by using the include command. Using either of these methods in a publicly available page can circumvent htaccess- or PHP-based authorization and output the contents of a supposedly restricted file, _including_ a file in another user's Web site. 2. I am working on a PHP script that allows users to upload images, view them, and ultimately send them over email. All the problems listed in (1) apply, but in addition, these images' owner is www or nobody, the user PHP runs as. As such, not only could other users on the same shared server view these uploaded files, they could modify or delete them through a PHP script, and it doesn't matter what I set the access privileges to with chmod(), since they can call chmod() on the files themselves. Now, I can run a checksum at upload time and verify it later on to ensure that uploaded files haven't been changed. But that might still leave a few seconds (between upload and checksum) during which a file could be altered, and doesn't protect against deletions. Both (1) and (2) are disturbing to me, since if I'm protecting a portion of my site I don't want several hundred random people (whose only qualification is that they purchased Web space at the same company I did) to have access to it. Is there any way, short of a dedicated server or a wholesale switch to another server-side language, to avoid these problems? Thanks. --Dave - --- -- David Feldman User Interface Designer -- 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: Re[4]: [PHP] FTP not enabled in RedHat 7.x distro
On Mar 18 Feb 2003 16:00, [EMAIL PROTECTED] wrote: Very weird - I thought RedHat would have enabled it too. I did When I say RH, I mean RedHat. The diference seems to be that I'm on 7.3, while you're on 7.1. Still, it should be compiled with ftp support. copy-and-paste the problem command to check I was searching for the right one. Here's the error, just for clarity: - Fatal error: Call to undefined function: ftp_connect() in /home/www/script.php on line 2 ...and the line in question is like... ?php ftp_connect(); ? Anyway, maybe I should check the RH distro. Can you run the following on your box for me so I can compare please? RH = RedHat! :-) When you run phpinfo() the output gives you the configure line with which php was compiled, so check there if it was or wasn't compiled with ftp support. Saludos... :-) -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? - MartÃn Marqués |[EMAIL PROTECTED] Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
I'm assuming the comments don't include the topid id - if they did this would be trivial. So I'm assuming the following structure... Topics: topicid Messages: messageid topicid Comments: commentid messageid So, say you want to delete topic 23, and all messages/comments associated with it. First, select all the message ids which apply to that topic. eg SELECT messageid FROM messages WHERE topicid = '23'; Loop through the messageid fields that are returned by this, and for each one delete any associated comments eg if one of the messages on topic 23 had the messageid 12 DELETE FROM comments WHERE messageid = '12'; So that's the comments gone. Now delete the messages, and finally the topic itself DELETE FROM messages WHERE topicid = '23'; DELETE FROM topics WHERE topicid = '23'; And that's you. There's plenty of variations on this of course - rather than deleting the comments for each message separately, you could do that in one query by building up a list of all the messageids you need to get rid of, something like : DELETE FROM comments WHERE messageid IN ('12', '22', '34', '46'); or something like that - I can't remember the exact syntax offhand, but it would be something like that. HTH, Richy == Richard Black Senior Developer, DataVisibility Ltd - http://www.datavisibility.com Tel: 0141 951 3481 Email: [EMAIL PROTECTED] Jono Bacon jonobacon_lists@yTo: PHP General [EMAIL PROTECTED] ahoo.co.uk cc: Subject: Re: [PHP] Recursion with database tables 19/02/2003 14:16 Please respond to jonobacon_lists David Otton wrote: On Wed, 19 Feb 2003 13:56:49 +, you wrote: One questions though - if I delete a topic, I need to delete all of its child messages and all of the child comments from each message. What is the best technique to do this? This has been driving me up the wall as it seems to involve some kind of looping and recursion. make sure /all/ your comments have the correct topicid set. Then simply DELETE FROM comment WHERE topicid = x Otherwise, yes, in MySQL you have to recurse down the tree deleting comments. How would I go about recursing down the tree? Has anyone done this before? Jono -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
On Wed, 19 Feb 2003 14:16:47 +, you wrote: Otherwise, yes, in MySQL you have to recurse down the tree deleting comments. How would I go about recursing down the tree? Has anyone done this before? I have, but it's been a while. Something like (pseudo-code) . def delete_comments(a) : for b in a : c = SELECT commentid FROM comments WHERE parentcommentid = a if len(c) 0 : delete_comments(c) DELETE FROM comments WHERE commentid IN (a) return def main() : a = SELECT commentid FROM comments WHERE topicid = 1234 delete_comments(a) DELETE FROM topic WHERE topicid = 1234 where a is a list of commentids, b is a single commentid and c is a list of child commentids. This will delete the tree in a depth-first fashion. This is quite an intensive way of doing things (potentially many selects and deletes) but is just-about acceptable because you probably will delete an entire topic so infrequently. I recommend filling out the topicid on every post as the easier solution, though. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What happened to phpEdit???
Are you guys it works for in Europe, or outside the USA? I can traceroute to their site just fine, both phpEdit.com and phpEdit.net. And, I can use the IP 212.43.196.19; but it won't open the page. Is it technically feasible to block visitors from a specific country? John Nichel wrote: It works fine for me. So does www.phpedit.net Al wrote: Did you try the URL you posted? I tried that one and several others listed for phpEdit. All say the site is not responding. Bryan Lipscy wrote: Did you check google? http://ozu.arecom-sa.com/~marms/phpedit.net/ -Original Message- From: Al [mailto:[EMAIL PROTECTED]] Sent: Sunday, February 16, 2003 8:39 AM To: [EMAIL PROTECTED] Subject: [PHP] What happened to phpEdit??? Their site no longer responds. Surely, we haven't lost one of the best php editors. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php.ini for UNIX sendmail????
Not that I know of.. Found out the reason Yahoo reject the email I send to Yahoo is because the 'From: ' address isn't [EMAIL PROTECTED] with the proper domain name. What Yahoo got is root@chevy in the 'From: ' section of the email. This is the email that is send from the Unix server. So, I tried overriding it with the 'From: [EMAIL PROTECTED]' option in the mail function. Unfortunately that doesn't work because root@chevy override that 'From: ' option. The workaround to the problem in Unix is to use the hostname resolution in the /etc/hosts file. I'm not having much luck yet. Because I am only able to get Yahoo to accept my email if it is outside of the abcoa.com in the /etc/hosts file but return with an unknown error message for any email that end with abcoa.com. Robin Mordasiewicz [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Is there any way to specify to use a remote smtp server in the php.ini On Tue, 18 Feb 2003, Scott Fletcher wrote: Well, okay, even with the '\r\n' path, I still have problem. Here's the new script and I retested it. --clip-- $message = This is a test; mail([EMAIL PROTECTED], the subject, $message, From: webmaster@$SERVER_NAME\r\n .Return-Path: [EMAIL PROTECTED]\r\n .Reply-To: webmaster@$SERVER_NAME\r\n .X-Mailer: PHP/.phpversion().\r\n); --clip-- So far, I never got the email at yahoo and I never got the email at abcoa.com. Adam Voigt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Well your missing your \r\n at the end of your return path. On Tue, 2003-02-18 at 10:57, Scott Fletcher wrote: Here's the command... --clip-- mail([EMAIL PROTECTED], the subject, $message, From: webmaster@$SERVER_NAME\r\n .Return-Path: [EMAIL PROTECTED] .Reply-To: webmaster@$SERVER_NAME\r\n .X-Mailer: PHP/ . phpversion()); --clip-- The bad thing is that when I send the mail. I never get an email back when something is not working right by using the return-path. Adam Voigt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Oh, ok, well how about your PHP code then (the actual mail() line)? On Tue, 2003-02-18 at 10:34, Scott Fletcher wrote: Here's is the response to the command, 'where sendmail'. bash: where: command not found So, I don't have a where command but I did the phpinfo() and it showed . --clip-- Directive || Local Value || master value -- -- sendmail_from || no value || no value sendmail_path || /usr/sbin/sendmail -t -i || /usr/sbin/sendmail -t -i --clip-- I don't have email problem when I send email to anywhere, the only problem is the yahoo itself... Thanks... Adam Voigt [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Umm, are you asking for Sendmail's path? It's usually /usr/bin/sendmail -t -i but you can verify where it is on your system by typing where sendmail. On Tue, 2003-02-18 at 10:25, Scott Fletcher wrote: Hi! What is the appropriate filepath with the flag command for the sendmail on the UNIX machine?? I send an email to yahoo and got the error message which I'm going to paste it here... --clip-- - The following addresses had permanent fatal errors - [EMAIL PROTECTED] --- The transcript of the session follows --- ... while talking to mx2.mail.yahoo.com.: MAIL From:root@chevy SIZE=40 501 Syntax error in parameters or arguments 501 [EMAIL PROTECTED] Data format error --clip-- One thing I know for sure is that the sendmail is working and that hte PHP code is working. I don't think I did the bad php command. Could it be the sendmail command be set wrong??? Thanks, FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc -- Robin Mordasiewicz 416-207-7012 UNIX System Developer Primus Canada -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Find IP address
Hello, I'd like when a customer fill in a form to recover his IP address, is there a PHP function to do that ? Thanks, Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] safe mode not working
I've enabled safe mode on my local test server, but it doesn't seem to be working. If I run a script owned by one user (me), and within it include (using include()) another script or file owned by another user, the include is successful, whereas it shouldn't be in safe mode. I can verify through phpinfo() that safe_mode is on. And the problem occurs whether safe_mode_include_dir remains unset or set to an empty directory. Any ideas? Thanks, --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
At 15:16 19.02.2003, Jono Bacon spoke out and said: [snip] How would I go about recursing down the tree? Has anyone done this before? [snip] Given the DB layout I sketched before, you would: 1) delete all comments delete from COMMENT where id_message in ( select id from MESSAGE where id_topic in $id_topic); 2) delete all messages delete from MESSAGE where id_topic = $id_topic; 3) delete the topic delete from TOPIC where id = $id_topic; Wrap the whole stuff in a transaction if your database supports it and you'll be fine. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Passing emails to database
Hi, list Is there any way in PHP to pass the emails received automatically into a local MySQL database on the same machine (i.e. the fields datetime, from, to, message, subject, etc), without copying and pasting each message? Maybe by retrieving and parsing the Outlook Express files that keep the emails? (the e-mail is received by Outlook Express, and via browser from a Yahoo account). Thanks for any help Alberto
Re: [PHP] Find IP address
On Wed, 19 Feb 2003 14:59:27 +0100, you wrote: I'd like when a customer fill in a form to recover his IP address, is there a PHP function to do that ? echo ($_SERVER[REMOTE_ADDR]); Be warned: This is NOT a reliable way to identify a user. These days you are probably /more/ likely to get the address of a proxy than the address of the user. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Find IP address
Be warned: This is NOT a reliable way to identify a user. These days you are probably /more/ likely to get the address of a proxy than the address of the user. Is there a better way to be sure, I have the IP address of the user (the ISP ip address) Your suggestions are welcome. Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] upgrade from 4.0.6 to 4.3.0
Can I upgrade directly from version 4.0.6 to 4.3.0 or should I apply all the patched of the other versions as well. I have difficulty when trying to start Apache to get PHP up and running. It seems if some of the DLL's can not be loaded. Can anyone maybe help me on this? Billy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Recursion with database tables
At 14:56 19.02.2003, Jono Bacon spoke out and said: [snip] The code that you posed is the technique I have used at the moment. This technique works fine, but like my mate said, this limits me to a single parent for a comment/message. I admit that is unlikely that I would need more than one parent, but what would happen if I changed the parent - would this model still work fine? [snip] As long as you have one-to-many relationship this model will be fine. You can easily change the parent of a message by replacing the id_topic column with another (hopefully valid) topic id. If you have many-to-many you need an intermediate table to resolve: +-++--++---+ |TOPIC||MSG2TOPIC ||MESSAGE| +-++--++---+ | id | - |id_topic || id| | ... ||id_message| - | ... | +-++--++---+ To select all messages for a certain topic you would select * from MESSAGE where id in (select id_message from MSG2TOPIC where id_topic = $id_topic); or, using a join select m.* from MSG2TOPIC rel inner join MESSAGE m on m.id = rel.id_message where rel.id_topic = $id_topic; To select all topics for a particular message: select * from TOPIC where id in (select id_topic from MSG2TOPIC where id_message = $id_message); -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DB row selection
Thanks a lot guys, the feedback so far has been most usefull Hans Joel Colombo [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... same thing $query = SELECT * FROM polls ORDER BY pollID DESC LIMIT 1; dont need both params for LIMIT. just the num of rows u want back works too. Joel Hans Prins [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... That's weird.. that was the first thing I tried (DESC), but it gave me a syntax error at runtime.. however, when I tried it now, it worked.. I probably had another error that confused me. Thx a bunch :-) Ernest E Vogelsinger [EMAIL PROTECTED] schreef in bericht [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 10:57 19.02.2003, you said: [snip] Hello, I recently learnt that with the code as stated below, I can select one row: $query = SELECT * FROM polls ORDER BY pollID ASC LIMIT 0,1; However as far as I could figure out, I can only select the top row or tell it at what rownumber to start and end. What if I wanted to select the bottom row? Would I have to do an extra query to count the rows and then select it with LIMIT? [snip] $query = SELECT * FROM polls ORDER BY pollID DESC LIMIT 0,1; -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions or Cookies?
1, What i got to do for manages sessions in my RedHat 8, 2, What i got to do for manages cookies in my RedHat 8, I try to use session vars, but no work I try to use cookies, and when i open two browser, the same cookie is in two browser... this is a problem, I need to carry the user_id in my site, during the cookie life, when use cookies, the problems begin... always got the same cookie, in any browser that i open... :-) Sidar Lopez Cruz - Cero Riesgo, S.A.
Re: [PHP] BBS software in PHP?
I use phpBB ( http://www.phpbb.com ), and have been quite pleased with it. It supports MySQL, MSSQL, PostgreSQL, and Access. Jean-Christian Imbeault wrote: Can anyone recommend a simple (and free) BBS module/software written in PHP. preferably something that writes to a DB and preferably PoserSQL. I would like to add some bulletin board functionality to my web pages but don't feel like reinventing the wheel :) Jc -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Document(),passing argument
I am trying to get document() to work when the content of an xml file is passed as an argument using Sablotron. My goal is to apply this method to bringing in several xml files to the stylesheet. Below is the test situation. Can anyone see where I am going wrong? --- begin doc_test.php --- ?php $xsl = ./doc_test.xsl; $mydata = ./doc_test.xml; $arguments = array(); $arguments['mydata'] = $mydata; ob_start(); $_parser = xslt_create(); if( !$result = @xslt_process( $_parser,// resource xh $xml,// string xsl $xsl, NULL, $arguments, array() ) ) { printf( Sablotron Error (%s): br /strong%s/strong, xslt_errno($_parser), xslt_error($_parser) ); } ob_end_clean(); xslt_free($_parser); echo $result; ? --- end doc_test.php --- --- begin doc_test.xml --- ?xml version=1.0 ? foo barone/bar bartwo/bar barthree/bar /foo --- end doc_test.xml --- --- begin doc_test.xsl --- ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:template match=/ htmlbody xsl:apply-templates select=document('arg:/mydata') / xsl:apply-templates / /body/html /xsl:template xsl:template match=foo table tr xsl:for-each select=bar tdxsl:value-of select=. //td /xsl:for-each /tr /table /xsl:template /xsl:stylesheet --- end doc_test.xsl --- -- Bill Amsterdam, NL -- Bill Amsterdam, NL -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions or Cookies?
At 15:49 19.02.2003, Sidar Lopez Cruz spoke out and said: [snip] 1, What i got to do for manages sessions in my RedHat 8, 2, What i got to do for manages cookies in my RedHat 8, I try to use session vars, but no work I try to use cookies, and when i open two browser, the same cookie is in two browser... this is a problem, I need to carry the user_id in my site, during the cookie life, when use cookies, the problems begin... always got the same cookie, in any browser that i open... [snip] Cookies are always used by the browser within all windows (from the same browser). You may either instruct clients to use two different browsers (IE, Netscape) at the same time, which seems quite impractical, or simply disable cookies and go with url-based session variables: in your php.ini file, locate the entry session.use_cookie and set it to 0: session.use_cookie = 0 Then restart Apache. This will allow you to use different session ids within the same browser. However you need to find a mechanism to split that up - if a client works on your site and opens a new window with the same url (Ctrl+N, e.g.), the window will initially have the same url, hence the same session id. There's nothing you can do to detect if the request for a particular session comes from another browser window. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imagick version 0.9.5 released
Thanks to Christian Stocker for actually putting the newest release up. It's available here: http://pear.php.net/imagick/ Here are the recent changes: - functions added: imagick_newimagelist() imagick_pushlist() imagick_poplist() imagick_mosaic() imagick_setcompressiontype() imagick_setcompressionquality() - modified how all functions check to see if ImageMagick has been initialized. - added a number of new examples for demonstrating how to use image lists. - fixed bugs in _php_imagick_alloc_handle() and _php_imagick_clear_errors() causing core dump when working with image lists. I wasn't checking to make sure the structures I was examining were allocated. - thanks to James Huston ([EMAIL PROTECTED]) for suggesting imagick_setcompressiontype() and imagick_setcompressionquality() and testing them. - added supporting IMAGICK_COMPRESSION_* constants for use with imagick_setcompressiontype(). - renamed imagick_setcompression() to imagick_setcompressiontype(). (note: this was done before the new version was released so no users should be impacted.) -- Michael C. Montero Chief Technology Officer Community Connect Inc. Co-founder [EMAIL PROTECTED] -=-=-=-=-= Community Connect Inc. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The Premier Source of Interactive Online Communities149 Fifth Avenue http://www.CommunityConnectInc.com/ New York, NY 10010 http://www.AsianAvenue.com/ http://www.BlackPlanet.com/ Click into Asian AmericaThe World Is Yours http://www.MiGente.com/ http://www.DiversityJobMarket.com/ The Power of LatinosIn partnership with The New York Times - Your Message May Appear Below This Line -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What happened to phpEdit???
Al wrote: Are you guys it works for in Europe, or outside the USA? I can traceroute to their site just fine, both phpEdit.com and phpEdit.net. And, I can use the IP 212.43.196.19; but it won't open the ... and what about so called 'transparent proxy-cache' ? Ask your ISP. Or try http://www.php.net?blabla=huhu (if it is caching it can help) HTH -- Mirek Novak Anima Publishers, s.r.o. Prilucka 360, Zlin 760 01 Czech Republic tel/fax: +420577219132 GSM:+420603807837 jabber:[EMAIL PROTECTED] ICQ:119499448 AUTO.CZ http://www.auto.cz NEWS.AUTO.CZ http://news.auto.cz FORMULE1.CZ http://www.formule1.cz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Cannot add header information
I have a script which adds header information to a different page, on my server I get a Cannot add header information - headers already sent by. But on other servers it works fine, does any1 know why?? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What happened to phpEdit???
Mirek Novak wrote: Al wrote: Are you guys it works for in Europe, or outside the USA? I can traceroute to their site just fine, both phpEdit.com and phpEdit.net. And, I can use the IP 212.43.196.19; but it won't open the ... and what about so called 'transparent proxy-cache' ? Ask your ISP. Or try http://www.php.net?blabla=huhu (if it is caching it can help) HTH ofcourse :) http://www.phpedit.net?blabla=huhu but I've found something strange, above link doesn't work :( and with Mozilla (Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130) I've got refused when accessing http://www.phpedit.net but with MSIE 6.0... I've got through. There seems to be some redirects to somewhere ... -- Mirek Novak Anima Publishers, s.r.o. Prilucka 360, Zlin 760 01 Czech Republic tel/fax: +420577219132 GSM:+420603807837 jabber:[EMAIL PROTECTED] ICQ:119499448 AUTO.CZ http://www.auto.cz NEWS.AUTO.CZ http://news.auto.cz FORMULE1.CZ http://www.formule1.cz -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Javascript function
Hello, Example, I have this function : void function MyExampleFunction(){ document.form_name.element_name.focus(); } I'd like do something like that, I call the function like that : MyExampleFunction('form_name.element_name'); And do that : void function MyExampleFunction(theelement){ document.theelement.focus(); } but that's not work ? An idea ? Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Finally!!! A workaround to mail() in PHP...
Finally a workaround to the problem in mail() in PHP I did the posting somewhere, so I'll cut to the chase by posting it here My recent posting does not work too well --clip-- This is for any Unix or Linux machine using the Sendmail. However, no guarentee that it would work in Windows. Some SMTP won't accept e-mail with the From: host@domain without the suffix com, like domain.com, so using the From: [EMAIL PROTECTED] option in the $header in the mail() does not solve the problem for me. Someone suggest using the php.ini with the configuration by adding the -f [EMAIL PROTECTED] to the sendmail path. Example look like this --clip-- sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED] --clip-- This is not an option for me because it is limit to one user, not more than one and it override the From: [EMAIL PROTECTED] option in the $header in mail().. So, Finally there is a workaround to the problem and it is very simple Just add this entrie to the /etc/hosts file in Unix or Linux. Just substitute the word in bracket for a value --clip-- ip addressmachine's_host.domain.com --clip-- Example ... --clip-- 123.456.789.012 xyz.abc.com --clip-- Make sure your machine do the search order with the host first before the DNS or Nameserver. In my case in AIX, is /etc/netsvc.conf. Hope Make sure your machine is set to read the host file first before the DNS or the nameserver, if not then make some changes to it. In my case for AIX, it is /etc/netsvc.conf... Hope this help --clip-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP, LDAP - Can't delete from more than 1 group
I'm using PHP to add users to my ldap directory. When I create a user they can be added to 1 or more groups. When that user is deleted, I want to remove them from all groups. The code I wrote only removes them from the first group, then gives an error for any other group. Here is the code, followed by the output. function removeFromGroup($toDelete, $ds, $ldap, $baseGroupdn){ $groupList = $ldap-ldapGetGroupList(); for ($i=0; $i$groupList[count]; $i++){ if (sizeof($groupList[$i][memberuid]) != 0){ foreach ($groupList[$i][memberuid] as $val){ if ($val == $toDelete){ $cnGroup = cn= . $groupList[$i][cn][0] . ,$baseGroupdn; $info[memberUid][] = $toDelete; echo Deleting . $toDelete . from . $cnGroup . br; $r = ldap_mod_del($ds, $cnGroup, $info); } } } } } // end removeFromGroup and the output: Deleting testuser from cn=Administrators,ou=Groups,dc=test,dc=com Deleting testuser from cn=Users,ou=Groups,dc=test,dc=com Warning: LDAP: modify operation could not be completed. in /var/www/html/user/user_p.php on line 470 Deleting testuser from cn=Guests,ou=Groups,dc=test,dc=com Warning: LDAP: modify operation could not be completed. in /var/www/html/user/user_p.php on line 470 uid=testuser,ou=Users,dc=test,dc=com deleted... also, here's what is in /var/log/ldap Feb 19 10:32:58 Lunar slapd[5650]: conn=1938 op=2 MOD dn=cn=Domain Admins,ou=Groups,dc=test,dc=com Feb 19 10:32:59 Lunar slapd[5650]: conn=1938 op=2 RESULT tag=103 err=0 text= Feb 19 10:32:59 Lunar slapd[14339]: conn=1938 op=3 MOD dn=cn=Domain Users,ou=Groups,dc=test,dc=com Feb 19 10:32:59 Lunar slapd[14339]: conn=1938 op=3 RESULT tag=103 err=16 text=modify: delete values failed Feb 19 10:32:59 Lunar slapd[5648]: conn=1938 op=4 MOD dn=cn=Domain Guests,ou=Groups,dc=test,dc=com Feb 19 10:32:59 Lunar slapd[5648]: conn=1938 op=4 RESULT tag=103 err=16 text=modify: delete values failed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Javascript function
Hello, Example, I have this function : void function MyExampleFunction(){ document.form_name.element_name.focus(); } I'd like do something like that, I call the function like that : MyExampleFunction('form_name.element_name'); And do that : void function MyExampleFunction(theelement){ document.theelement.focus(); } but that's not work ? An idea ? Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Javascript function
You'll probably have better luck addressing your question to a list that supports JavaScript. Christian Ista wrote: Hello, Example, I have this function : void function MyExampleFunction(){ document.form_name.element_name.focus(); } I'd like do something like that, I call the function like that : MyExampleFunction('form_name.element_name'); And do that : void function MyExampleFunction(theelement){ document.theelement.focus(); } but that's not work ? An idea ? Christian, -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Javascript function
Try this. void function MyExampleFunction(theelement) { theelement.focus() } body onload=MyExampleFunction(document.form_name.element_name) The variable theelement will refer to document.form_name.element_name so there is no reason to repeat that portion in the function. Robbert van Andel -Original Message- From: Christian Ista [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 19, 2003 7:48 AM To: [EMAIL PROTECTED] Subject: [PHP] Javascript function Hello, Example, I have this function : void function MyExampleFunction(){ document.form_name.element_name.focus(); } I'd like do something like that, I call the function like that : MyExampleFunction('form_name.element_name'); And do that : void function MyExampleFunction(theelement){ document.theelement.focus(); } but that's not work ? An idea ? Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php, xml and mysql with netscape and ie
hi.. was just wondering when i use php xml and mysql (standard xml) it seems that netscape 4.7 and below wont see the web page with results from a mysql query on them... we dont know about ie5 or below yet but does anybody know why this is or how to fix it? the nature of the web pages is a table built with standard xml that goes into a loop to get all the rows in a table and show them on a web page but for strange reasons anything below netscape 7 ignores everything except the last entry in the mysql table... trying to get someone i know with ie5 or below to look and see if it doesnt work --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot add header information
At 15:33 19/02/03, you wrote: I have a script which adds header information to a different page, on my server I get a Cannot add header information - headers already sent by. But on other servers it works fine, does any1 know why?? Are you sure you did not edit a file? Take care that there is not __any__ output before the header() command. The error message you got gives you an indication where the output starts. Have a close look at that line. Remove all spaces and enters in the PHP files before ? or after ?. An error message before this error message is also output, for which PHP creates headers. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] file not opening in internet explorer
You may also need world execute on the file before it will work. I've had this problem myself with certain files and they would only show up once I had world execute on them. rw-r-r-x IF you are looking for a good tutorial there is an awesome book PHP and MySQL web development by welling and Thomson. You can also try my website out, it only has some basics on it right now, I haven't had any time lately to write any more information but I will shortly. www.theouterphere.com Kelly -Original Message- From: DIKSHA NEEL [mailto:[EMAIL PROTECTED]] Sent: February 19, 2003 12:27 AM To: [EMAIL PROTECTED] Subject: [PHP] file not opening in internet explorer hi all, $fp = fopen(\bdoi_change\sundar.html, w); i am able to write to this file through my php page filecheck.php and even am able to read the written contents. but when i enter http://192.168.0.1/bdoi_change/sundar.html in my internet explorer address bar, it says the page cannot be displayed. the file permissions are rw-r-r thanks in advance, regards, diksha. -- 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] Javascript function
If you realy need string parameter you could do some string parsing and the function would look something like this: /* * focusTheElement(string) * the parameter should have the folowing format : * 'form_name.element_name' */ fuction focusTheElement(element) { var form=element.substring(1,element.indexOf('.')); var child=element.substring(element.indexOf('.')+1,element.length); /* You should test the function and see if it works well use : alert(form); or document.write('form='+form+'br/'); alert(child); or document.write(child='+child+'br/); */ /* then you should do something like this: */ document.forms[form].elements[child].focus(); } or /* * focusTheElement(string) * the parameter should have the folowing format : * 'form_name.element_name' * I don't know if this function will improve the speed but it would do the job! */ fuction focusTheElement(element) { eval('document.'+element+'.focus();'); } If you do not ned a string parameter you could use what John Nichel wrote before me. On Wed, 2003-02-19 at 17:47, Christian Ista wrote: Hello, Example, I have this function : void function MyExampleFunction(){ document.form_name.element_name.focus(); } I'd like do something like that, I call the function like that : MyExampleFunction('form_name.element_name'); And do that : void function MyExampleFunction(theelement){ document.theelement.focus(); } but that's not work ? An idea ? Christian, -- Mincu Alexandru intelinet.ro Tel:+4 0745 369719 +4 021 3140021 www.intelinet.ro[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mail() using Return-Path: and Error-To:....
Hiya fellas I'm doing the test on sending emails and what I found is that I haven't got these two to to work which is Return-Path: and Error-To: Does anyone know why does it not work??? Here's my sample codes --clip-- $Header = From: [EMAIL PROTECTED]\r\n; $Header .= Return-Path: [EMAIL PROTECTED]\r\n; $Header .= Error-To: [EMAIL PROTECTED]\r\n; $Header .= MIME-Version: 1.0\r\n; $Header .= Content-type: text/plain; charset=iso-8859-1\r\n; $Header .= X-Priority: 3\r\n; $Header .= X-MSMail-Priority: Normal\r\n; $Header .= X-Mailer: PHP .phpversion().\r\n; mail([EMAIL PROTECTED],test,This is a test,$Header); --clip-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finally!!! A workaround to mail() in PHP...
I'd say an even simpler workaround would be to add '[EMAIL PROTECTED]' as the fifth parameter to the mail function - just as in example 3 of the docs. Danny. - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 3:43 PM Subject: [PHP] Finally!!! A workaround to mail() in PHP... Finally a workaround to the problem in mail() in PHP I did the posting somewhere, so I'll cut to the chase by posting it here My recent posting does not work too well --clip-- This is for any Unix or Linux machine using the Sendmail. However, no guarentee that it would work in Windows. Some SMTP won't accept e-mail with the From: host@domain without the suffix com, like domain.com, so using the From: [EMAIL PROTECTED] option in the $header in the mail() does not solve the problem for me. Someone suggest using the php.ini with the configuration by adding the -f [EMAIL PROTECTED] to the sendmail path. Example look like this --clip-- sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED] --clip-- This is not an option for me because it is limit to one user, not more than one and it override the From: [EMAIL PROTECTED] option in the $header in mail().. So, Finally there is a workaround to the problem and it is very simple Just add this entrie to the /etc/hosts file in Unix or Linux. Just substitute the word in bracket for a value --clip-- ip addressmachine's_host.domain.com --clip-- Example ... --clip-- 123.456.789.012 xyz.abc.com --clip-- Make sure your machine do the search order with the host first before the DNS or Nameserver. In my case in AIX, is /etc/netsvc.conf. Hope Make sure your machine is set to read the host file first before the DNS or the nameserver, if not then make some changes to it. In my case for AIX, it is /etc/netsvc.conf... Hope this help --clip-- -- 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] Finally!!! A workaround to mail() in PHP...
That doesn't work either because this machine's SMTP doesn't know it's user in it's own domain, so a modification of the /etc/hosts file is necessnary Danny Shepherd [EMAIL PROTECTED] wrote in message 023901c2d836$773f83c0$6400a8c0@DANNYS">news:023901c2d836$773f83c0$6400a8c0@DANNYS... I'd say an even simpler workaround would be to add '[EMAIL PROTECTED]' as the fifth parameter to the mail function - just as in example 3 of the docs. Danny. - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 3:43 PM Subject: [PHP] Finally!!! A workaround to mail() in PHP... Finally a workaround to the problem in mail() in PHP I did the posting somewhere, so I'll cut to the chase by posting it here My recent posting does not work too well --clip-- This is for any Unix or Linux machine using the Sendmail. However, no guarentee that it would work in Windows. Some SMTP won't accept e-mail with the From: host@domain without the suffix com, like domain.com, so using the From: [EMAIL PROTECTED] option in the $header in the mail() does not solve the problem for me. Someone suggest using the php.ini with the configuration by adding the -f [EMAIL PROTECTED] to the sendmail path. Example look like this --clip-- sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED] --clip-- This is not an option for me because it is limit to one user, not more than one and it override the From: [EMAIL PROTECTED] option in the $header in mail().. So, Finally there is a workaround to the problem and it is very simple Just add this entrie to the /etc/hosts file in Unix or Linux. Just substitute the word in bracket for a value --clip-- ip addressmachine's_host.domain.com --clip-- Example ... --clip-- 123.456.789.012 xyz.abc.com --clip-- Make sure your machine do the search order with the host first before the DNS or Nameserver. In my case in AIX, is /etc/netsvc.conf. Hope Make sure your machine is set to read the host file first before the DNS or the nameserver, if not then make some changes to it. In my case for AIX, it is /etc/netsvc.conf... Hope this help --clip-- -- 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] define(DOC_HOME_PATH, what goes here)
I want to define 3 constants DOC_HOME_PATH IMG_HOME_PATH CTL_HOME_PATH So that I can just do this img src=? echo IMG_HOME_PATH ?stuff/image.jpg a href=? echo DOC_HOME_PATH ?stuff/index.jspClick Here/a form action=? echo CTL_HOME_PATH ?stuff/process_order.php **do I need to echo? **not everything goes to stuff Right now I have define (DOC_HOME_PATH, d:/is/projects/killerspin/web/store/); define (IMG_HOME_PATH, d:/is/projects/killerspin/web/images/); define (CTL_HOME_PATH, d:/is/projects/killerspin/web/control/); This works fine for displaying images but not for form submission or links. I have also tried this define (DOC_HOME_PATH, http://localhost/killerspin/web/store/;); define (IMG_HOME_PATH, http://localhost/killerspin/web/images/;); define (CTL_HOME_PATH, http://localhost/killerspin/web/control/;); doesn't work. I have also tried a few other ways, but to no avail. Right now the config is Apache 2.0.43, PHP 4.3.0, Win Xp Pro, and an Access DB. For production this will be running on a windows server so I would also need to know to set up the same var for this enviroment. Thanks in advance --- Jonathan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] syntax question
Greetings... The following is the _third_ part of a script found in Julie Meloni's book PHP Essentials on page 118. The script dynmically generates a form box of field names, field types and field sizes for a mysql table depending on what the user chooses. My question is about syntax or logic in the following snippet: The variables: $field_name $field_type $field_length are carried over from the previous script. . $sql = CREATE TABLE $table_name (; for ($i = 0; $i count($field_name); $i++) { $sql .= $field_name[$i] $field_type[$i]; if ($field_length[$i] != ) { $sql .= ($field_length[$i]),; } else { $sql .= ,; } } $sql = substr($sql, 0, -1); $sql .= ); ... My question is about the snippet: . if ($field_length[$i] != ) { $sql .= ($field_length[$i]),; } else { $sql .= ,; } .. In that it would say that if the field_length variable is not empty then add the (number) and comma to the sql statement If it is empty, then just add a comma. The question: Is the reasoning that a comma *must* be added since this is _within_ a loop? As in: CREATE TABLE chairs ( id INT(5), item VARCHAR(50), desc TEXT , price FLOAT , // common should be deleted but there is no way of knowing this within the loop. // that's why after the loop closes there is a substr() function to delete the comma. ); And that after the loop ends, the comma is then deleted using the substr() function to complete the sql statement. TIA, Tony Ritter .. The complete script: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD TITLECreate a Database Table: Step 3/TITLE style p {font-family:arial; font-size: .75em;} input {border: 1px solid black;} th {font-family:arial; font-size: .75em; color:red;} h2 {font-family:arial; font-size: 1em;} /style /HEAD BODY h2Adding ?php echo $table_name; ? Table/h2 ? $sql = CREATE TABLE $table_name (; for ($i = 0; $i count($field_name); $i++) { $sql .= $field_name[$i] $field_type[$i]; if ($field_length[$i] != ) { $sql .= ($field_length[$i]),; } else { $sql .= ,; } } $sql = substr($sql, 0, -1); $sql .= ); $connection = mysql_connect(,,) or die(Couldn't connect to server.); $db = mysql_select_db(database, $connection) or die(Couldn't select database.); $sql_result = mysql_query($sql,$connection) or die(Couldn't execute query.); if (!$sql_result) { echo PCouldn't create table!; } else { echo P$table_name [table] has been created!; } ? /BODY /HTML -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Backticks and echo
you could always to a preg_replace() and replace the backticks with their #xxx; equal. Jim - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 4:27 AM Subject: [PHP] Backticks and echo Hello everyone I reread the manual again on the topic of backticks and from that I have security / usabilitiy issue. Here is the issue: When I check formdata from a simple form I use regular expression to make sure the input confirms to certain guidlines before including them into my scripts. Basically this means excluding special character like the above mentioned backticks. Well so far so good. When the input is wrong I'd like to redisplay the wrong input and ask the user to correct these. Now here comes the issue as far as I understand the manual the text inbetween backticks is executed and the output is included in place. This happens when I echo the text out. So if I don't allow backticks in my input field and I want to redisplay that input I execute the code right? Meaning I can'T redisplay the text as the user inputed it. When I use escapeshellcmd to prevent any execution I redisplay the input differently than the users input. This will confuse most users and is not as wished from a usability standpoint. So have I missunderstood the way backticks work or is this an unresolvable issue? Any help greatly appreciated Stefan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] prepend file
How can I get a prepend file to work out of my .htaccess file when the host provider is running safe-mode? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Array declarations
At 22:56 18.02.2003, Joachim Krebs spoke out and said: [snip] Is there any speed difference at all from the following two code blocks (miniscule or not)? If so, which is faster? $cfg[db][host] = ; $cfg[db][user] = ; $cfg[db][pass] = ; or $cfg[db] = array(host=, user=, pass=); [snip] The difference is minimal. On our 2xPIII/1GHz Dell server, iterating both methods 100.000 times, the second method performs 0.18 seconds faster than the first. This result is stable for more than 100 passes. -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax question
At 18:06 19.02.2003, Anthony Ritter spoke out and said: [snip] The question: Is the reasoning that a comma *must* be added since this is _within_ a loop? As in: CREATE TABLE chairs ( id INT(5), item VARCHAR(50), desc TEXT , price FLOAT , // common should be deleted but there is no way of knowing [snip] No. The reason for the comma is that SQL dictates that column names in a create table statement are separated by a comma. This is valid SQL: create table chairs( id int(5), item varchar(50), desc text, price float ); This is invalid and generates an SQL error when passed to the server: create table chairs( id int(5) item varchar(50) desc text price float ); -- O Ernest E. Vogelsinger (\) ICQ #13394035 ^ http://www.vogelsinger.at/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cannot add header information
G wrote: I have a script which adds header information to a different page, on my server I get a Cannot add header information - headers already sent by. But on other servers it works fine, does any1 know why?? ?php // error is the space after the last below - yes its a space ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sending uploaded images as mail attachments
I'm working on a script that allows the user to upload several images, then base64 encodes them and attaches them to an email to me. I'm having trouble getting the images readable on the other end. I've managed to get all the MIME types and message parts straight enough to be recognized as separate parts and as files of the proper types (though mostly by trial and error, and it's not quite working 100% yet), but the images aren't readable. Can anyone help? Is there an example somewhere? I'm guessing I'm just not formatting the email or inserting the encoded images quite right. Thanks. --Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What happened to phpEdit???
Tried both of your suggestions with IE6 and Moz. Nothing worked. I did get though via a link from a site in France. I sent an email to [EMAIL PROTECTED] using their message popup. I also mentioned that i had intended to make a contribution; but, that it would be pointless if I couldn't reach their site. We'll see. Mirek Novak wrote: Al wrote: Are you guys it works for in Europe, or outside the USA? I can traceroute to their site just fine, both phpEdit.com and phpEdit.net. And, I can use the IP 212.43.196.19; but it won't open the ... and what about so called 'transparent proxy-cache' ? Ask your ISP. Or try http://www.php.net?blabla=huhu (if it is caching it can help) HTH -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] syntax question
This is what I was getting at. The following is correct mysql syntax in which a comma must be added after each field - except for the last field - in this case price: i.e., . CREATE TABLE chairs( id int(5), item varchar(50), desc text, price float ); . However, within the loop in her script it says to add the comma after _each_ field since there is no way of knowing when the loop will end. Thus, why is she directing the script - after the loop has ended - to lop off the last comma by using the substr() function call as in: if ($field_length[$i] != ) { $sql .= ($field_length[$i]) , ; } else { $sql .= , ; } loop is finished. and then... $sql=substr($sql,0,-1); //which basically says to take the existing sql statement string from the beginning to the next to last character and return it to the variable $sql thus taking off the comma. Am I on the right track? Thank you. Tony Ritter ... Ernest E Vogelsinger [EMAIL PROTECTED] No. The reason for the comma is that SQL dictates that column names in a create table statement are separated by a comma. This is valid SQL: create table chairs( id int(5), item varchar(50), desc text, price float ); This is invalid and generates an SQL error when passed to the server: create table chairs( id int(5) item varchar(50) desc text price float ); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: sending uploaded images as mail attachments
http://www.phpguru.org/mime.mail.html makes it pretty easy. On Wed, 19 Feb 2003, David Feldman wrote: I'm working on a script that allows the user to upload several images, then base64 encodes them and attaches them to an email to me. I'm having trouble getting the images readable on the other end. I've managed to get all the MIME types and message parts straight enough to be recognized as separate parts and as files of the proper types (though mostly by trial and error, and it's not quite working 100% yet), but the images aren't readable. Can anyone help? Is there an example somewhere? I'm guessing I'm just not formatting the email or inserting the encoded images quite right. Thanks. --Dave -- 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] Cannot add header information
--- Chris Hayes [EMAIL PROTECTED] wrote: At 15:33 19/02/03, you wrote: I have a script which adds header information to a different page, on my server I get a Cannot add header information - headers already sent by. But on other servers it works fine, does any1 know why?? Are you sure you did not edit a file? Take care that there is not __any__ output before the header() command. The error message you got gives you an indication where the output starts. Have a close look at that line. Remove all spaces and enters in the PHP files before ? or after ?. An error message before this error message is also output, for which PHP creates headers. That last point is important. It is often likely that PHP is causing the output, because you have an error somewhere (and it's outputting the error message). If this script works elsewhere, perhaps you are using a function that your current PHP is not compiled with. So, for starters, place an exit just before your header: exit; header(...); This way, the redirect will not happen, and if there is output, you will see it on the screen. Get rid of it, whatever it is. :-) Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finally!!! A workaround to mail() in PHP...
The reason for this is due to the fact that PHP can override Sendmail but Sendmail can not override the Unix/Linux Operating System. So, once sendmail work without a problem in O/S, including inside the domain on the local network where hte machine reside and outside of the local network then you can safely use the 5th parameter... Scott Fletcher [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... That doesn't work either because this machine's SMTP doesn't know it's user in it's own domain, so a modification of the /etc/hosts file is necessnary Danny Shepherd [EMAIL PROTECTED] wrote in message 023901c2d836$773f83c0$6400a8c0@DANNYS">news:023901c2d836$773f83c0$6400a8c0@DANNYS... I'd say an even simpler workaround would be to add '[EMAIL PROTECTED]' as the fifth parameter to the mail function - just as in example 3 of the docs. Danny. - Original Message - From: Scott Fletcher [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 19, 2003 3:43 PM Subject: [PHP] Finally!!! A workaround to mail() in PHP... Finally a workaround to the problem in mail() in PHP I did the posting somewhere, so I'll cut to the chase by posting it here My recent posting does not work too well --clip-- This is for any Unix or Linux machine using the Sendmail. However, no guarentee that it would work in Windows. Some SMTP won't accept e-mail with the From: host@domain without the suffix com, like domain.com, so using the From: [EMAIL PROTECTED] option in the $header in the mail() does not solve the problem for me. Someone suggest using the php.ini with the configuration by adding the -f [EMAIL PROTECTED] to the sendmail path. Example look like this --clip-- sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED] --clip-- This is not an option for me because it is limit to one user, not more than one and it override the From: [EMAIL PROTECTED] option in the $header in mail().. So, Finally there is a workaround to the problem and it is very simple Just add this entrie to the /etc/hosts file in Unix or Linux. Just substitute the word in bracket for a value --clip-- ip addressmachine's_host.domain.com --clip-- Example ... --clip-- 123.456.789.012 xyz.abc.com --clip-- Make sure your machine do the search order with the host first before the DNS or Nameserver. In my case in AIX, is /etc/netsvc.conf. Hope Make sure your machine is set to read the host file first before the DNS or the nameserver, if not then make some changes to it. In my case for AIX, it is /etc/netsvc.conf... Hope this help --clip-- -- 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] Date/Time Logic
Hello Everyone, My php/mysql application needs to keep track of the first time that a User logs on to the site. Afterwards the User should be allowed either 3 days / 3 months/1 year of access to the site. Once the stipulated time period is over the system should invalidate the login of the user. The Admin/ User should get email notification about this. The notification part is easy the hard part to figure out is how to be able to keep and tab on the Time Period stipulated for a user. Thanks in advance Pushpinder Singh Garcha _ Web Architect
[PHP] Re: mail() using Return-Path: and Error-To:....
Okay, saw the other posting I made earlier today and someone spoke about using the 5th parameter, '[EMAIL PROTECTED]'. So, I tried it and it work with the Return-Path: and Error-To:... Finally!!! I have been working on the sendmail problem for a week and now I'm glad to see it coming to an end. Scott Fletcher [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hiya fellas I'm doing the test on sending emails and what I found is that I haven't got these two to to work which is Return-Path: and Error-To: Does anyone know why does it not work??? Here's my sample codes --clip-- $Header = From: [EMAIL PROTECTED]\r\n; $Header .= Return-Path: [EMAIL PROTECTED]\r\n; $Header .= Error-To: [EMAIL PROTECTED]\r\n; $Header .= MIME-Version: 1.0\r\n; $Header .= Content-type: text/plain; charset=iso-8859-1\r\n; $Header .= X-Priority: 3\r\n; $Header .= X-MSMail-Priority: Normal\r\n; $Header .= X-Mailer: PHP .phpversion().\r\n; mail([EMAIL PROTECTED],test,This is a test,$Header); --clip-- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Date/Time Logic
Store the timestamp of their first login to a database. Also store the number of days (3, 90, 365) that there account is valid. Setup a script to nightly go through the database and for any records where: first_login_timstamp + number_of_days right_now is true invalidate their login and send notifications. Pretty easy to do with the date/time functions in any database. Of if you can't use a database like that, store it all as numbers (timestamps - number of seconds since 1970...) and just do the math with 86400 seconds equalling one day. good luck! On Wed, 19 Feb 2003, Pushpinder Singh Garcha wrote: Hello Everyone, My php/mysql application needs to keep track of the first time that a User logs on to the site. Afterwards the User should be allowed either 3 days / 3 months/1 year of access to the site. Once the stipulated time period is over the system should invalidate the login of the user. The Admin/ User should get email notification about this. The notification part is easy the hard part to figure out is how to be able to keep and tab on the Time Period stipulated for a user. Thanks in advance Pushpinder Singh Garcha _ Web Architect -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] open_basedir Option
How do I set the php.ini setting open_basedir on a per-directory basis? Ideally, I would like to set it using .htaccess files... Joachim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Creating a file to write to?
Hi, I want to be able to check to see if a file exists and if so I want to be able to overwrite it. If it doesn't exist I want to be able to create it and then make sure it is writable. A lot of this I have found in the PHP manual, but I can't find anywhere on how to just create the file or overwrite it if it exists. Thanks for any help... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating a file to write to?
http://www.php.net/fopen fopen(filename,w); On Wed, 2003-02-19 at 13:13, Beauford.2002 wrote: Hi, I want to be able to check to see if a file exists and if so I want to be able to overwrite it. If it doesn't exist I want to be able to create it and then make sure it is writable. A lot of this I have found in the PHP manual, but I can't find anywhere on how to just create the file or overwrite it if it exists. Thanks for any help... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Adam Voigt ([EMAIL PROTECTED]) The Cryptocomm Group My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc signature.asc Description: This is a digitally signed message part
Re[2]: [PHP] syntax question
Hi, Thursday, February 20, 2003, 3:34:31 AM, you wrote: AR This is what I was getting at. AR The following is correct mysql syntax in which a comma must be added after AR each field - except for the last field - in this case price: AR i.e., AR . AR CREATE TABLE chairs( AR id int(5), AR item varchar(50), AR desc text, AR price float AR ); AR . AR However, within the loop in her script it says to add the comma after _each_ AR field since there is no way of knowing when the loop will end. AR Thus, why is she directing the script - after the loop has ended - to lop AR off the last comma by using the AR substr() function call you can rework the logic a bit and only add a comma if it is not the first run through the loop : $sql = CREATE TABLE $table_name (; for ($i = 0; $i count($field_name); $i++) { if($i) $sql .= ','; //first time i = 0 and this line ignored $sql .= $field_name[$i] $field_type[$i]; if ($field_length[$i] != ) { $sql .= ($field_length[$i]),; } } $sql .= ); But you are right there was a need to nuke the comma in the original script -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php