[PHP] count link clicks
How do I count how many times a user clicks on a certain link? (and put it into and array or variable I guess). I want to be able to repeat a certain action on the same page as many times as the user clicks on the link($PHP_SELF). Thanks, - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] count link clicks
I think I'm on the right track with: ?php $i = $value++; // Show first link echo 'a href='.$PHP_SELF.'?add_form='.$value.' New paragraph /a /font'; // Isert form html into $data_fields variable $data_fields = 'html html blah blah a href='.$PHP_SELF.'?add_form='.$value.' New paragraph /a'; while ($i = $value) { echo $data_fields; } ? The only problem is that it runs for an infinite number of times, I want it to run for as many times as the http://domain.com?add_form=1 (IE: 1 in this case) defines. - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] count link clicks
THANK YOU! THANK YOU! This does exactly what I need it to! I wish they thought me how to count at PHP kindergarten. - Vic -Original Message- From: Dave at Sinewaves.net [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 3:20 PM To: [EMAIL PROTECTED]; 'Rasmus Lerdorf'; 'vic' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] count link clicks -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 13, 2002 12:23 PM To: 'Rasmus Lerdorf'; 'vic' Cc: [EMAIL PROTECTED] Subject: RE: [PHP] count link clicks I think I'm on the right track with: ?php // // CHANGE THIS: // // $i = $value++; // /// // TO THIS: $value = $add_form + 1; // Show first link echo 'a href='.$PHP_SELF.'?add_form='.$value.' New paragraph /a /font'; // Isert form html into $data_fields variable $data_fields = 'html html blah blah a href='.$PHP_SELF.'?add_form='.$value.' New paragraph /a'; // CHANGE THIS: // // while ($i = $value) { // echo $data_fields; // } // // TO THIS: for($i=0; $i$add_form; $i++) { echo $data_fields; } ? The only problem is that it runs for an infinite number of times, I want it to run for as many times as the http://domain.com?add_form=1 (IE: 1 in this case) defines. - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql error
I get this error: Error submiting paragraph.You have an error in your SQL syntax near 'WHERE page_name='features' AND par_id='13' ' at line 1 But my code, I think is fine: // Insert the form information into the database mysql_query(INSERT INTO malibu_data SET heading='$heading', paragraph='$paragraph' WHERE page_name='$page_name' AND par_id='$par_id' ) or die ('Error submiting paragraph.'. mysql_error()); - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mysql error
Yes, thank you very much, I shouldn$B!G(Bt code late at night without any caffeine in me. - Vic -Original Message- From: @ Edwin [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 14, 2002 12:29 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] mysql error Looks like you're updating your table so instead of "INSERT INTO...", try: "UPDATE malibu_data SET ..." HTH, - E I get this error: Error submiting paragraph.You have an error in your SQL syntax near 'WHERE page_name='features' AND par_id='13' ' at line 1 But my code, I think is fine: // Insert the form information into the database mysql_query("INSERT INTO malibu_data SET heading='$heading', paragraph='$paragraph' WHERE page_name='$page_name' AND par_id='$par_id' ") or die ('Error submiting paragraph.'. mysql_error()); - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php _ $B%O%$%;%s%9$J>$r5$7Z$K9XF~(B MSN $B%7%g%C%T%s%0(B http://shopping.msn.co.jp/ __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] html parsing from html file through php
Hello, I am making an app that read from an html file outputted by MS word (ya its for those people that need to make webpages but don't know how o write html) anyway, using MS word is a requirement; After the user saves their .doc file as a web page (now and htm file) the php will take that html file from a dir on the server, open it, read it, and ignore anything that is from the beginning of the file up to and right after the body tag ends, then it must ignore anything at the end of the page up and including the body tags and the closing html tag. So basically after its done doing its thing I would have all the content of the page ready to be echoed inside another page that would be a sort of shell or template. I am loocking right now at regular expressions and file_open etc, but just to give you an idea and to see if anybody has any helpful pointers, this (yes, can u believe it?) is the beginning of the word2html translation that MS word does: (BAH!) (i have to get rid of this remember?) -- html xmlns:o=urn:schemas-microsoft-com:office:office xmlns:w=urn:schemas-microsoft-com:office:word xmlns:st1=urn:schemas-microsoft-com:office:smarttags xmlns=http://www.w3.org/TR/REC-html40; head meta http-equiv=Content-Type content=text/html; charset=windows-1252 meta name=ProgId content=Word.Document meta name=Generator content=Microsoft Word 10 meta name=Originator content=Microsoft Word 10 link rel=File-List href=community_files/filelist.xml titleCommunity/title o:SmartTagType namespaceuri=urn:schemas-microsoft-com:office:smarttags name=City/ o:SmartTagType namespaceuri=urn:schemas-microsoft-com:office:smarttags name=place/ !--[if gte mso 9]xml o:DocumentProperties o:AuthorJim Weathers/o:Author o:LastAuthorvic/o:LastAuthor o:Revision2/o:Revision o:TotalTime1/o:TotalTime o:Created2002-08-14T19:54:00Z/o:Created o:LastSaved2002-08-14T19:54:00Z/o:LastSaved o:Pages1/o:Pages o:Words79/o:Words o:Characters451/o:Characters o:Companyx-core/o:Company o:Lines3/o:Lines o:Paragraphs1/o:Paragraphs o:CharactersWithSpaces529/o:CharactersWithSpaces o:Version10.2625/o:Version /o:DocumentProperties /xml![endif]--!--[if gte mso 9]xml w:WordDocument w:SpellingStateClean/w:SpellingState w:GrammarStateClean/w:GrammarState w:DisplayHorizontalDrawingGridEvery0/w:DisplayHorizontalDrawingGridEv ery w:DisplayVerticalDrawingGridEvery0/w:DisplayVerticalDrawingGridEvery w:UseMarginsForDrawingGridOrigin/ w:Compatibility w:FootnoteLayoutLikeWW8/ w:ShapeLayoutLikeWW8/ w:AlignTablesRowByRow/ w:ForgetLastTabAlignment/ w:LayoutRawTableWidth/ w:LayoutTableRowsApart/ w:UseWord97LineBreakingRules/ /w:Compatibility w:BrowserLevelMicrosoftInternetExplorer4/w:BrowserLevel /w:WordDocument /xml![endif]--!--[if !mso]object classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D id=ieooui/object style st1\:*{behavior:url(#ieooui) } /style ![endif]-- style !-- /* Font Definitions */ font-face {font-family:Times; panose-1:2 2 6 3 5 4 5 2 3 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:536902279 -2147483648 8 0 511 0;} font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; mso-bidi-font-size:10.0pt; font-family:Times; mso-fareast-font-family:Times; mso-bidi-font-family:Times New Roman;} p.MsoBodyTextIndent, li.MsoBodyTextIndent, div.MsoBodyTextIndent {margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; mso-bidi-font-size:10.0pt; font-family:Verdana; mso-fareast-font-family:Times New Roman; mso-bidi-font-family:Times New Roman; mso-ansi-language:EN-AU; mso-fareast-language:EN-US;} span.SpellE {mso-style-name:; mso-spl-e:yes;} page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} -- /style !--[if gte mso 10] style /* Style Definitions */ table.MsoNormalTable {mso-style-name:Table Normal; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:Times;
[PHP] P.S. html parsing from html file through php
Actually I think there is even less work to be done, the paragraph spacing problem I talked about earlier can be avoided if I leave all that foobar tags and erase only: html xmlns:o=urn:schemas-microsoft-com:office:office xmlns:w=urn:schemas-microsoft-com:office:word xmlns:st1=urn:schemas-microsoft-com:office:smarttags xmlns=http://www.w3.org/TR/REC-html40; head meta http-equiv=Content-Type content=text/html; charset=windows-1252 meta name=ProgId content=Word.Document meta name=Generator content=Microsoft Word 10 meta name=Originator content=Microsoft Word 10 link rel=File-List href=community_files/filelist.xml titleCommunity/title o:SmartTagType namespaceuri=urn:schemas-microsoft-com:office:smarttags name=City/ o:SmartTagType namespaceuri=urn:schemas-microsoft-com:office:smarttags name=place/ --[Need everything here]- - in there, not the following tags ;) /head body lang=EN-US style='tab-interval:.5in' ---[Need everything in here]-- - in there, not the following tags ;) /body /html Thanks, maybe if someone can tell me how to learn to work with some search and replace function that would be neat0 - Vic -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 14, 2002 5:10 PM To: '[EMAIL PROTECTED]' Subject: html parsing from html file through php Hello, I am making an app that read from an html file outputted by MS word (ya its for those people that need to make webpages but don't know how o write html) anyway, using MS word is a requirement; After the user saves their .doc file as a web page (now and htm file) the php will take that html file from a dir on the server, open it, read it, and ignore anything that is from the beginning of the file up to and right after the body tag ends, then it must ignore anything at the end of the page up and including the body tags and the closing html tag. So basically after its done doing its thing I would have all the content of the page ready to be echoed inside another page that would be a sort of shell or template. I am loocking right now at regular expressions and file_open etc, but just to give you an idea and to see if anybody has any helpful pointers, this (yes, can u believe it?) is the beginning of the word2html translation that MS word does: (BAH!) (i have to get rid of this remember?) -- html xmlns:o=urn:schemas-microsoft-com:office:office xmlns:w=urn:schemas-microsoft-com:office:word xmlns:st1=urn:schemas-microsoft-com:office:smarttags xmlns=http://www.w3.org/TR/REC-html40; head meta http-equiv=Content-Type content=text/html; charset=windows-1252 meta name=ProgId content=Word.Document meta name=Generator content=Microsoft Word 10 meta name=Originator content=Microsoft Word 10 link rel=File-List href=community_files/filelist.xml titleCommunity/title o:SmartTagType namespaceuri=urn:schemas-microsoft-com:office:smarttags name=City/ o:SmartTagType namespaceuri=urn:schemas-microsoft-com:office:smarttags name=place/ !--[if gte mso 9]xml o:DocumentProperties o:AuthorJim Weathers/o:Author o:LastAuthorvic/o:LastAuthor o:Revision2/o:Revision o:TotalTime1/o:TotalTime o:Created2002-08-14T19:54:00Z/o:Created o:LastSaved2002-08-14T19:54:00Z/o:LastSaved o:Pages1/o:Pages o:Words79/o:Words o:Characters451/o:Characters o:Companyx-core/o:Company o:Lines3/o:Lines o:Paragraphs1/o:Paragraphs o:CharactersWithSpaces529/o:CharactersWithSpaces o:Version10.2625/o:Version /o:DocumentProperties /xml![endif]--!--[if gte mso 9]xml w:WordDocument w:SpellingStateClean/w:SpellingState w:GrammarStateClean/w:GrammarState w:DisplayHorizontalDrawingGridEvery0/w:DisplayHorizontalDrawingGridEv ery w:DisplayVerticalDrawingGridEvery0/w:DisplayVerticalDrawingGridEvery w:UseMarginsForDrawingGridOrigin/ w:Compatibility w:FootnoteLayoutLikeWW8/ w:ShapeLayoutLikeWW8/ w:AlignTablesRowByRow/ w:ForgetLastTabAlignment/ w:LayoutRawTableWidth/ w:LayoutTableRowsApart/ w:UseWord97LineBreakingRules/ /w:Compatibility w:BrowserLevelMicrosoftInternetExplorer4/w:BrowserLevel /w:WordDocument /xml![endif]--!--[if !mso]object classid=clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D id=ieooui/object style st1\:*{behavior:url(#ieooui) } /style ![endif]-- style !-- /* Font Definitions */ @font-face {font-family:Times; panose-1:2 2 6 3 5 4 5 2 3 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:536902279 -2147483648 8 0 511 0;} @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:536871559 0 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:; margin:0in;
[PHP] file_get_contents ( string filename [, int use_include_path])
Can someone explain me more abou the usage of this code: file_get_contents ( string filename [, int use_include_path]) I just got it from the annual, and I still don't get what they mean by string filename and int use_include_path Thanks, This has to do with the other question I posted earlier, yes - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how do i continue with ereg replace?
I want to have the ereg_replace action happen many times before the result is echoed, how do I do this? The following is the code that I have that obviously is flawed because the later variable as afar as ai know cancels out the first one... $good = ereg_replace(o:p/o:p, , $str); $good = ereg_replace(/head, , $str); //echo ereg_replace(/o:p, , $str); echo $good; help appreciated. - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] frames and variables
Has anyone here designed php sites that use a combination of php pages and html pages? What I want to know is how to pass a variable from nav_frame.php (at the top) to itself, AND to the data.php frame (lower frame, main body) I can pass variables to itself, (with the ?page_name=content.htm thingie attached to links, but I don't know how to make this accessible to both frames at the same time. Help appreciated, yes, I'm asking a lot of questions since this is a project for college and my due data is in 2 ... ooops 1 DAY! WhooHOO! - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] so nobody knows how do get rid of everything outside or certain tags?
I asked this question a while ago, and I am still seeking clarification, I fooled with ereg_replace and they only do a piece of what I want, I would like to know how to keep only a chunk of text defined between 2 tags let's say, div and /div and ignore everything else, I also have to search and replace certain tags between, but I know how to do that with ereg_replace. So can anyone help me echo only what is between the div tags? Please? - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] so nobody knows how do get rid of everything outside or certain tags?
Thanks, I tried this code first, and I wrote my script like this: ?php $file_name = $page_name.$ext or die ('Error 2'); $file = file($path.$file_name) or die ('Error 3'); $str = implode(' ', $file) or die ('Error 4'); // Original first tag //div class=Section1 // Original last tag ///div preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs); $everything_between_divs=$regs[1]; $good = implode(' ', $everything_between_divs) or die ('Error 5'); $clean = ereg_replace(o:p/o:p, , $regs[1]); echo $clean; ? - Vic -Original Message- From: Joseph W. Goff [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 15, 2002 12:54 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] so nobody knows how do get rid of everything outside or certain tags? preg_match('!div[^]+(.*)/div!Uis',$info,$regs); $everything_between_divs=$regs[1]; - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 15, 2002 11:44 AM Subject: RE: [PHP] so nobody knows how do get rid of everything outside or certain tags? [snip] I asked this question a while ago, and I am still seeking clarification, I fooled with ereg_replace and they only do a piece of what I want, I would like to know how to keep only a chunk of text defined between 2 tags let's say, div and /div and ignore everything else, I also have to search and replace certain tags between, but I know how to do that with ereg_replace. So can anyone help me echo only what is between the div tags? Please? [/snip] Why not take the the beginning div, everything in the middle, and the end /div tag and explode() them into an array and then get what you want and write it out? I didn't see your originl post and don't know if there was more detail available, but I hope this helps. Jay I'm not tense.just terribly, terribly alert *** * Texas PHP Developers Conf Spring 2003 * * T Bar M Resort Conference Center * * New Braunfels, Texas* * San Antonio Area PHP Developers Group * * Interested? Contact [EMAIL PROTECTED] * *** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] undefined offset bad argument
I get this error: Notice: Undefined offset: 1 in /home/victor/argilent-www/sites/malibu_place_2/index.php on line 104 Warning: Bad arguments to implode() in /home/victor/argilent-www/sites/malibu_place_2/index.php on line 106 Error 5 For this code: ?php $file_name = $page_name.$ext or die ('Error 2'); $file = file($path.$file_name) or die ('Error 3'); $str = implode(' ', $file) or die ('Error 4'); // Original first tag //div class=Section1 // Original last tag ///div preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs); $everything_between_divs=$regs[1]; $good = implode(' ', $everything_between_divs) or die ('Error 5'); $clean = ereg_replace(o:p/o:p, , $regs[1]); echo $clean; ? there might be something wrong with the reg exptession. Or the variables? Please help, thanks - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] good read on regular expressions
What is a good read on general expressions that a php programmer should check out? I am trying to familiarize myself with them so that I can pars the silly ms word html pages. - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] i some more help on the whole ereg thingy please
Hi, I hope you can help me a bit more, this is is my current script: (look after for more messages) ?php $file_name = $page_name.$ext or die ('Error 2'); $file = file($path.$file_name) or die ('Error 3'); $str = implode(' ', $file) or die ('Error 4'); // This is to check if the above code works // echo $str; // End check // Original first tag from the document I need to parse // div class=Section1 // Original last tag // /div preg_match('!div class=Section1[^]+(.*)/div!Uis',$str,$regs[1]); $everything_between_divs = $regs[1]; //echo $everything_between_divs; $good = implode(' ', $regs) or die ('Error 5'); // This is for later use to edit the contents of stuff between // the div tags - if I get the div tags to ever work $clean = ereg_replace(o:p/o:p, , $good); echo $clean; ? it doesn't work, what do you think I'm doing wrong? I get this error: Notice: Undefined offset: 1 in /home/victor/argilent-www/sites/malibu_place_2/index.php on line 104 Warning: Bad arguments to implode() in /home/victor/argilent-www/sites/malibu_place_2/index.php on line 106 Error 5 Thanks, - Vic __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] and or statement
What is the and or statement in php? I need this to see if the first statement is whatever, and or the second statement is whatever... if (!isset($PHP_AUTH_USER) and or blah($blah)) {} Thank you - vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PASSWORD()
Is PASSWORD() still usable? I used it in my scripts a while ago to encrypt and decript password strings that I stored into databases, but from some time all my scripts don't work (the login part) because I cannot do a mysql query like so: $sql = SELECT * FROM users WHERE username = '$PHP_AUTH_USER' AND password = PASSWORD('$PHP_AUTH_PW'); or: $sql = SELECT * FROM users WHERE username = '$username AND password = PASSWORD('$password'); is this wrong? Or am I just hallucinating? - vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session_unregister - but w00t about the back button?
I can logout with session_unregister - but w00t about the back button? This is probably so trivial that it has been discussed before, if anyone has some knowledge or link at hand mind passing it on? Thanks. - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session encode and session decode question
I'm trying to get the one variable I stored insite a session, the variable's name is $username I am trying to do it like this, but I think it's wrong: $PHPSESSID = session_encode(); $username = session_decode(); It tells me I have wrong parameters for session decode. What am I supposed to encode to get the variable from the session? - Victor www.argilent.com __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: session_unregister - but w00t about the back button?
K, thanks, i will sort of realized this, but I was wondering if the user is silly enough to leave the browser window open then someone can press the back button and go back, I will probably write a message somewhere to tell the user to close the browser window. To the one who asked about the session_destroy thingie, I did that and I did session_unregiste(blah) but does the order of these two count? -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 9:27 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP] Re: session_unregister - but w00t about the back button? I can logout with session_unregister - but w00t about the back button? This is probably so trivial that it has been discussed before, if anyone has some knowledge or link at hand mind passing it on? Thanks. If you are using Cookies, then everything is fine. Their cookies will be gone, and the back button will not alter that. If you pass the SID through the URL, and do session_unregister, again, they'll see the old data maybe, but as soon as they move forward, the new data will be in force. If you're worried about the back button and Security, you can try some headers() to convince the browsers not to cache (search archives for no-cache) but the bottom line is going to be User Education They either *quit* the browser, or risk that it's a stupid broken browser that ignored your request not to cache the data. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: session_unregister - but w00t about the back button?
I did a : session_unregister('xxx'); session_destroy(); header(Location: http://www.xxx.com/xxx;); and mozilla is the only browser out of ie6 netscape 4.7 and mozilla to respect the logout and not repost the data on reload or back request. Go mozilla. I guess the big boys somewhere are taking a nap. -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 10:32 PM To: victor; 'Richard Lynch'; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Re: session_unregister - but w00t about the back button? If you were REALLY concerned, you could use JavaScript (JavasCrap) to open a new window and close the parent... this way there would be no such thing as a back button... it'd be disabled. I think later version of JS can empty the history too (unsure though). It's not going to be fool proof for those w/o JS, but it would be an added level of security... Justin on 31/08/02 12:12 PM, victor ([EMAIL PROTECTED]) wrote: K, thanks, i will sort of realized this, but I was wondering if the user is silly enough to leave the browser window open then someone can press the back button and go back, I will probably write a message somewhere to tell the user to close the browser window. To the one who asked about the session_destroy thingie, I did that and I did session_unregiste(blah) but does the order of these two count? -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Friday, August 30, 2002 9:27 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP] Re: session_unregister - but w00t about the back button? I can logout with session_unregister - but w00t about the back button? This is probably so trivial that it has been discussed before, if anyone has some knowledge or link at hand mind passing it on? Thanks. If you are using Cookies, then everything is fine. Their cookies will be gone, and the back button will not alter that. If you pass the SID through the URL, and do session_unregister, again, they'll see the old data maybe, but as soon as they move forward, the new data will be in force. If you're worried about the back button and Security, you can try some headers() to convince the browsers not to cache (search archives for no-cache) but the bottom line is going to be User Education They either *quit* the browser, or risk that it's a stupid broken browser that ignored your request not to cache the data. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] calling sql results inoto variables
The silly me, I had an exit; inside the for loop and I was wondering why id only looped once, somebody slap me! - Victor www.argilent.com -Original Message- From: Victor [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 31, 2002 7:52 AM To: [EMAIL PROTECTED] Subject: [PHP] calling sql results inoto variables I'm trying to go about doing this: While there is data in an array, get and echo individual pieces from this array and execute a mysql query that gets the other info in the table where arraypiece. Stop when all arraypice have been echoed. The array gets its values from and checkbox form. I got that part: input type=checkbox name=check[] value='.$ID.' So I count the number of times there is something in $check, which I think is done like so: for($i = 0; $i sizeof($check); $i++) { echo $i; } that should give me the number of checboxes clicked. (it does, I verified) so, now I say: for($i = 0; $i sizeof($check); $i++) { # echo $i; echo 'p'; $data = $check[$i]; echo $data; which brings me to getting the rest of the data from the tables (the array I was talking about holds the ID) (aka the key) but I still need to put the key in the door. Ok, so no I would need to loop a mysql query for as long as there is data in the array, - since I only have one key for each row. Let me try to write it: for($i = 0; $i sizeof($check); $i++) { # echo $i; echo 'p'; $data = $check[$i]; #echo $data; mysql_query(SELECT * FROM table WHERE ID = '$data'); $db_ID = $row[ID]; $db_picture_name = $row[picture_name]; echo $db_ID; echo $db_picture_name; } Now, this should do the trick, let's test it ... testing ... Nope, mysql can't execute that query... Hmmm... I get this could not execute queryYou have an error in your SQL syntax near 'table WHERE ID = '1'' at line 1 no shit! I actually don't have a table called table! Fixed that, testing could not execute queryNo Database Selected ok, let's do that. (I've been up all nigh what do you want!) ok, now what?! I get NOTHING! NOTHING! WHHHT! I tried hardcoding the $ID, nothing, so that must be ok, as we have proved earlier, By this time I ended up with this code: for($i = 0; $i sizeof($check); $i++) { # echo $i; echo 'p'; $data = $check[$i]; #echo $data; mysql_query(SELECT * FROM kodak_user_pictures WHERE ID = '1') or die ('could not execute query '.mysql_error()); $db_ID = $row[ID]; $db_picture_name = $row[picture_name]; echo $db_ID; echo $db_picture_name; } of course it gives me nothing! What the hell is $row? Ok, let's fix that. for($i = 0; $i sizeof($check); $i++) { # echo $i; echo 'p'; $data = $check[$i]; #echo $data; $db_data = mysql_query(SELECT * FROM kodak_user_pictures WHERE ID = '1'); $row = mysql_fetch_array(db_data); $db_ID = $row[ID]; $db_picture_name = $row[picture_name]; echo $db_ID; echo $db_picture_name; } now I get this... I'm also getting tired... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource STUPID $ SIGN! (look near db_data, nope, the second one!) Ok, let's test ... Ok, good, let's switch the hardcoded 1 from the query back to the $data... Testing ... Ok, now it only gets one... Let's try a for each for($i = 0; $i sizeof($check); $i++) { # echo $i; echo 'p'; $data = $check[$i]; #echo $data; foreach ($data as $check[$i]) { $db_data = mysql_query(SELECT * FROM kodak_user_pictures WHERE ID = '$data'); $row = mysql_fetch_array($db_data); $db_ID = $row[ID]; $db_picture_name = $row[picture_name]; echo $db_ID; echo $db_picture_name; } } Warning: Invalid argument supplied for foreach() Ok... Not better, but let's see... Ok, now I ende up with this code: for($i = 0; $i sizeof($check); $i++) { # echo $i; echo 'p'; $data = $check[$i]; $db_data = (SELECT * FROM mytable WHERE ID = '$check[$i]'); $row = mysql_query($db_data); # $row = mysql_fetch_array($db_data); $db_ID = $row[ID]; $db_picture_name = $row[picture_name]; echo $db_ID; echo $db_picture_name; #echo $data; } I don';t know what to do, I get nothing, I think the error is that I do not know how to call the mysql query results into the variables fro echoing, please I beg you someone tell me. - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] newest entry in db
How can I use php to get the newest entry from mysql database? Ie, if I make a timestamp and then I want to retrieve the last timestamp I made how do I go about doing it? Any php or mysql documentation? - Victor www.argilent.com __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why do i get this error please tell me?
for($i = 0; $i sizeof($check); $i++) { # start repating query # turn pictures in order delete capability off mysql_query(UPDATE kodak_user_pictures SET order=1 WHERE ID='$check[$i]') # turn off pictures or die ('Unable to turn bit off '.mysql_error()); } # end repeat You have an error in your SQL syntax near 'order=1 WHERE ID='2'' at line 2 - Victor www.argilent.com __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] why do i get this error please tell me?
Yep, figured it just now, thanks anyway, ahhh.. You'd thing they put reserved names right besides the damn mysql command in the manual. Alas it shall not be so. - Victor www.argilent.com -Original Message- From: Chris Knipe [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 31, 2002 1:30 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] why do i get this error please tell me? You have an error in your SQL syntax near 'order=1 WHERE ID='2'' at line 2 ORDER is a reserved word in MySQL. Change the query and escape order aswell 'order'='1' WHERE ID='2' Or, rename the order column to something else. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: [PHP-DB] RE: [PHP] why do i get this error please tell me?
I meant besides the UPDATE or SELECT or any filed that those words might interfere with... - Victor www.argilent.com -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 31, 2002 2:18 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] RE: [PHP] why do i get this error please tell me? Ahem. Why not check out the MySQL docs for reserved words (they _are_ right there ...): http://www.mysql.com/doc/en/Reserved_words.html PHP Docs are for PHP. MySQL Docs are for MySQL. PHP != MySQL. -Original Message- From: victor [mailto:[EMAIL PROTECTED]] Sent: Saturday, August 31, 2002 1:35 PM To: 'Chris Knipe'; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] why do i get this error please tell me? Yep, figured it just now, thanks anyway, ahhh.. You'd thing they put reserved names right besides the damn mysql command in the manual. Alas it shall not be so. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why is html code written like this? hr /
When I learned html it was always written like this: /hr now I see people write it like this: hr /... why? - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] why is html code written like this? hr /
Ok, but is this kind of html compliant with old browsers like Netscape 4? Is it compliant with most new browsers? - Victor www.argilent.com -Original Message- From: Adrian Murphy [mailto:[EMAIL PROTECTED]] Sent: Monday, September 02, 2002 7:13 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] why is html code written like this? hr / thats xhtml - it's xml comliant html. tags must be closed so a tag like hr which didn't have a closing tag is written hr / so,for example in php the nl2br() function now produces br / instead of the old br - Original Message - From: Victor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, September 02, 2002 12:16 PM Subject: [PHP] why is html code written like this? hr / When I learned html it was always written like this: /hr now I see people write it like this: hr /... why? - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP checkbox/hidden field question
Some check box info here too: http://www.experts-exchange.com/Web/Web_Languages/PHP/Q_20117420.html - Victor www.argilent.com -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED]] Sent: Monday, September 02, 2002 7:24 AM To: PHP Subject: Re: [PHP] Re: PHP checkbox/hidden field question You are wrong, this is from HTML 4.01 specification: value = /cdata/ cid:[EMAIL PROTECTED] [CA] cid:[EMAIL PROTECTED] This attribute specifies the initial value cid:[EMAIL PROTECTED] of the control. It is optional except when the type cid:[EMAIL PROTECTED] attribute has the value radio or checkbox. Upon submiting a form, only successfull checkboxes are submited, so on the next page you only need this loop: foreach($d_c_arr as $i) { echo 'input type=hidden name=d_c_arr[] value='. htmlspecialchars($i).''; } $d_c_arr contains only checked checkboxes. Marek Erwin wrote: I am executing the follwoing statement as part of a while loop. This is part of a form and I wish to pass the name and value of the checkbox as a hidden field only is the checkbox is checked. Can you suggest how I can accomplish this task? tdinput type=checkbox name=d_c_arr[] value=?php echo $db-f(order_id) ?/td As you might know, checkboxes don't have the VALUE attribute. HTML won't even submit the VALUE attribute to the next page. You will only have an array containing 0's and 1's, the results of the checkboxes. So, on the next page, you will have to lookup the values again. Then print the hidden input's to the page in a for loop, while looping trough $d_c_arr. HTH Erwin __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help, array values echoed as Array on loop!
I have tried both ways to loop through an array and output the data and verify that the array is an array and I get no erros but I get this value, which should not be so. Here I'm checking if it's an array: if (!is_array($ID_arr)) { # show error if no array echo '$ID_arr is not an array.'; } here I'm counting the keys but it only outputs as 1: $key = count($ID_arr); echo $key; here are two loops that do the same thing and they both output Array: for($i = 0; $i count($ID_arr); $i++) { echo $ID_arr[$i]; } foreach($ID_arr as $ind_picture) { echo $ind_picture; } Why? If it helps, in order to get the array, the values were taken from a database and exploded from a coma delimited string. $ID_arr[] = explode(',', $pictures); # make db data into array This is the string: 15,16,17,18,19 I want each array element to contain = 15 = 16 = 17 etc... why does it echo as Array? - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] help, array values echoed as Array on loop!
Thank you, I figured it out 30 seconds after I posted the question, you were right about the problem. - Victor www.argilent.com -Original Message- From: Chris Wesley [mailto:[EMAIL PROTECTED]] Sent: Monday, September 02, 2002 4:11 PM To: 'PHP' Cc: Victor Subject: Re: [PHP] help, array values echoed as Array on loop! On Mon, 2 Sep 2002, Victor wrote: $ID_arr[] = explode(',', $pictures); # make db data into array This is the string: 15,16,17,18,19 why does it echo as Array? ... because you've created an array ($ID_arr) with an array as the first value (the result of the call to explode()). Take the brackets off $ID_arr, and you'll get what you want. You don't want your array in an array ... you just want an array. $ID_arr = explode(',', $pictures); If you really wanted your array in the array, then loop over $ID_arr[0]. (I doubt that's what you were going for, though.) hth, ~Chris __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp question
I took the scriopt from php manual and adapted it to my needs, but I get an error: Warning: ftp_put(): user_pictures/vic/: No such file or directory in /home/victor/argilent-www/sites/kodak/upload_picture.php on line 103 This is the code: # set up basic connection $conn_id = ftp_connect($ftp_server); # login with username and password $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass); # check connection if ((!$conn_id) || (!$login_result)) { echo 'FTP connection has failed.'; exit; } $destination = $picture_location.'/'.$f_username.'/'; # upload the file $upload = ftp_put($conn_id, $destination, $picture, FTP_BINARY); # check upload status if (!$upload) { echo 'FTP upload has failed.'; } # close the FTP stream ftp_close($conn_id); I added the destination variable so that I can easily edit the destination if I sweitch servers, I'm guessing the error occurs because php doesn't know where to take the file from?! I'm guessing here, but it would be nice if someone tough me a bit more about ftp with php. user_pictures/vic is the directory the $picture has to go in, but I dunno why it doesn't work. - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: ftp question
Actually, that is the correct path. Which is why I don't understand why it's not working. And as a user I'm using myself... waitaminute, the folders are created by the user www, and I argilent may not have write permission, maybe that's why it's not working. I should try with a folder I create as me to see if I can write to it. - Victor www.argilent.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Monday, September 02, 2002 9:46 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: ftp question Hi, Your script upload the file to /home/victor/argilent-www/sites/kodak/user_pictures/vic/ are you sure that is the correct path name? If its not, just put the entier name and not only a part of it. -- Merci de nous avoir choisi. - Thanks you for your choice. Nicos - CHAILLAN Nicolas [EMAIL PROTECTED] [EMAIL PROTECTED] www.GroupAKT.com - Hébergement Group. www.WorldAKT.com - Hébergement de sites Internet Victor [EMAIL PROTECTED] a écrit dans le message de news: 01c252ea$36e90160$[EMAIL PROTECTED] I took the scriopt from php manual and adapted it to my needs, but I get an error: Warning: ftp_put(): user_pictures/vic/: No such file or directory in /home/victor/argilent-www/sites/kodak/upload_picture.php on line 103 This is the code: # set up basic connection $conn_id = ftp_connect($ftp_server); # login with username and password $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass); # check connection if ((!$conn_id) || (!$login_result)) { echo 'FTP connection has failed.'; exit; } $destination = $picture_location.'/'.$f_username.'/'; # upload the file $upload = ftp_put($conn_id, $destination, $picture, FTP_BINARY); # check upload status if (!$upload) { echo 'FTP upload has failed.'; } # close the FTP stream ftp_close($conn_id); I added the destination variable so that I can easily edit the destination if I sweitch servers, I'm guessing the error occurs because php doesn't know where to take the file from?! I'm guessing here, but it would be nice if someone tough me a bit more about ftp with php. user_pictures/vic is the directory the $picture has to go in, but I dunno why it doesn't work. - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] continuation to the ftp story
The problem with my other php - well - problem was that the destination and file variables were reversed, I think, no I changed them, but I get this error when I try to ftp a file to a server: Warning: ftp_put(): error opening /home/victor/sites/kodak/user_pictures/vic Can user permissions cause this error? I also tried appending a '/' after the destination, but my error now read s as: Warning: ftp_put(): error opening /home/victor/sites/kodak/user_pictures/vic/ It also brakes at: echo 'FTP upload has failed.'; so that's where the problem is, I just don't know what the problem is. The ftp code is this: if someone could help it'd be nice. # set up basic connection $conn_id = ftp_connect($ftp_server) or die ('Could not establish FTP connection'); # login with username and password $login_result = ftp_login($conn_id, $ftp_user, $ftp_pass) or die ('Could not login'); # check connection if ((!$conn_id) || (!$login_result)) { echo 'FTP connection has failed.'; exit; } $destination = $picture_location.$f_username.'/'; # upload the file $upload = ftp_put($conn_id, $picture, $destination, FTP_BINARY); # check upload status if (!$upload) { echo 'FTP upload has failed.'; exit; } # close the FTP stream ftp_close($conn_id); - Victor www.argilent.com __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading file
? phpinfo(); ? tell you most things about php and some things about web server and dbs - Victor www.argilent.com -Original Message- From: Clemson Chan [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 4:04 PM To: [EMAIL PROTECTED] Subject: [PHP] Uploading file Hi, I am new to this group. I am trying to figure out how to let people to upload image files to my website. My ISP is using PHP 3 (I believe). If someone can give me simple example, that will be great. Thanks. --Clemson How can I tell what version of PHP is running on the system (linux)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put
Well I'm having the same problem... no useful suggestions from ME yet. :) - Victor www.argilent.com -Original Message- From: Jason Romero [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 5:13 PM To: [EMAIL PROTECTED] Subject: [PHP] ftp_put I am having problems getting the ftp_put command to upload a file to an apache server i get this error Warning: error opening C:\\WINDOWS\\Desktop\\Jason\\jjmckay\\testaudio.mp3 in /home/virtual/site31/fst/var/www/html/clientadmin/mp3upload.php on line 32 here is the code $dest = /var/www/html/public/$user/; $upload = ftp_put($FTP, $dest, $source_file, FTP_BINARY); if ($upload) echo it worked; else echo it didnt work; the $source_file is pulled from a form on the previous page any suggestions? Jason Romero -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] emacs on win32
This is somewhat php related: how do you get syntax highlighting and coloring (whatever) for php in the windows version of emacs? - Victor www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ending a session
Why not unregistered the session variables first, destroy the session second and redirect the user with a header location to a plain html page that includes a one line JavaScript in the body tag like onload+thiswindow cloase or something like that, and a message that please closes this window for complete logout. That's what I do and it works, in mozilla the script closes the window, in i.e. it asks that the user verify if they want to close the window, if they say no, then the user sees the message that please close this window to logout and that would pretty much take care of everything as far as I know. - Victor www.argilent.com -Original Message- From: Raphael Hamzagic [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 5:32 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] ending a session Of course Gurhan, I have read all the php manual. How can I send a message when the user closes the browser to destroy the session? Thanks in advance Raphael Gurhan Ozen [EMAIL PROTECTED] wrote in message 1031261344.5091.266.camel@LOCALHOST">news:1031261344.5091.266.camel@LOCALHOST... You can end the session by using function session_destroy(). See: http://www.php.net/manual/en/function.session-destroy.php For general information on how PHP handles sessions see: http://www.php.net/manual/en/ref.session.php Hope this helps. Gurhan On Thu, 2002-09-05 at 17:17, Raphael Hamzagic wrote: Hi, I'm just wanna know why the session doesn't end when the user closes the browser window and how can i make it. Thanks Raphael -- 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 __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: ftp_put
Ok, I'm having the same problem, see I use a form to upload but I guess that it puts the file in temporary file, so with copy or something it figures automatically where to take th file from how do I get the $ source and ft_put to figure out where to take this file from, or can I get it to take it directly from the users computer through form? - Victor www.argilent.com -Original Message- From: Richard Lynch [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 05, 2002 9:34 PM To: Jason Romero Cc: [EMAIL PROTECTED] Subject: [PHP] Re: ftp_put I am having problems getting the ftp_put command to upload a file to an apache server i get this error Warning: error opening C:\\WINDOWS\\Desktop\\Jason\\jjmckay\\testaudio.mp3 in /home/virtual/site31/fst/var/www/html/clientadmin/mp3upload.php on line 32 here is the code $dest = /var/www/html/public/$user/; $upload = ftp_put($FTP, $dest, $source_file, FTP_BINARY); if ($upload) echo it worked; else echo it didnt work; the $source_file is pulled from a form on the previous page Need more source code to tell you exactly where, but it looks like you're trying to have PHP suck in the original file name rather than the uploaded file. You can't do that. If you could, PHP could be used to steal *ANY* arbitrary file off of *ANY* computer. Major security problem. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var]; ???
$_GLOBAL[var] or $_GLOBAL['var'] or $_GLOBAL[var] - I noticed that in a mysql statement you can only use: $_GLOBAL[var]. I would like to get the advice of more experienced php programmers out there about this. Which one of the above it the most best way to write? - Victor www.argilent.com __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File sharing
I'm trying to access an object as a Singleton. Here is the source code I'm using. The problem is that the member objFile from the $test variable is set to an open file in the class constructor. It works fine, but when I recover it from the memory, the file handler gets lost in starts being considered an int. Has anyone done this before ? ?php echo(htmlbody); include (./ConcreteErrorLog/SingletonTest.inc); $test = new Singleton; $test-testCreateSingleton(); echo(Creating shared memory.br); $attachkey=1; $memorykey = shm_attach($attachkey); $variablekey=1; echo(Getting variable from memory. br); $test2=shm_get_var($memorykey,$variablekey); echo(Got the variable . get_class($test2) . br); if(!isset($test2) || empty($test2)){ echo(Putting in memory. br); shm_put_var($memorykey,$variablekey,$test); $test-testCreateSingleton(); } echo(The variable must be there by now. br); $test = shm_get_var($memorykey,1); echo(Got it. br); echo(member is now = . $test-intMember . br); $test-testCreateSingleton(); if($HTTP_GET_VARS[clear]==yes){ echo(Will remove shared object. br); shm_remove_var($memorykey,$variablekey); echo(Shared object removed. br); } echo(/body/html); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] text string in a gif
Hello friends, For those who are not allergic to newbie questions: I want to make a button for a web page from a background gif and a string. Till here nothing unusual. I used the example from the php manual and it works like a breeze. ?php Header("Content-type: image/gif"); $string=implode($argv," "); $im = imageCreateFromGif("MyBackground.gif"); $color = ImageColorAllocate($im, 196, 51, 28); ImageTTFText ($im, 20, 0, 6, 7, $color, "MyFont.ttf", $string); ImageGif($im); ImageDestroy($im); ? The only problem I have (and for me it is really big) is that when I use a string which contains a blank eg "My text" the text of the button looks like "My%20TEXT" :-( How can I fix it?? TIA, Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] newbie question about variables
Hello, Is there any (easy) way to let a user to set the value of a variable by simply clicking on a hyperlink on a web page? I mean if I have a 3 links on a page if the user clicks on image1 to set a variable $var=1,if clicks on image2 to set it as $var=2,etc. Any suggestions (including RTFMs ;-)) are wellcome. Best regards, Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] some multiple array problems...
I am trying to make a calculator that figures out the total price (calculates tax sums up price for print size times quantity etc.) and the mechanism all works fine - but only when the user checks SEQUENTIALLY from their list of available picture. The user should be able to select from their list of pictures at random, and the script should be able to calculate the total price, but after one image is skipped, if any pictures after the skipped one is selected the script thinks that the user chose size 4x6 and quantity of 1 for those (those are default values) note that I am also using arrays and that may be what is causing problem, - bad array data input. Please help if u can and it doesn't take u too much time. The page that gives me trouble is order_form.php This is what calculated the total value: (don't get overwhelmed by the code, at the bottom there is clearer explanation) # calculate pricing if (isset($_POST['check_price']) isset($_SESSION['f_username']) isset($quantity) isset($size)) { # if no picture checked but update submitted, then lets thell the user how stupid they are if (empty($check)) { echo ('One or more pictures must be checked in order to verify price.'); exit; } # let us do some math, like taxes, discounts, etc. for ($i=0; $isizeof($_POST['check']); $i++) { # if the data in the quantity is not pure numbers then we abort if (!is_numeric($quantity[$i])) { echo ('Quantity must be defined only in numbers.'); exit; } # getting the array data into variables $ins_size = $size[$i]; $ins_quantity = $quantity[$i]; ## # 4x6 pricing matrix # ## # less than or equal to 50 if ($ins_size == '4x6' $ins_quantity = '50') { $price = '0.49'; } # 51 to 100 if ($ins_size == '4x6' $ins_quantity = '51' $ins_quantity = '100') { $price = '0.45'; } # 101 to 150 if ($ins_size == '4x6' $ins_quantity = '101' $ins_quantity = '150') { $price = '0.40'; } # 151 to infinity if ($ins_size == '4x6' $ins_quantity = '151') { $price = '$0.30'; } ## # 2.5x3.5 pricing matrix # ## # less than or equal to 50 if ($ins_size == '2.5x3.5' $ins_quantity = '50') { $price = '0.49'; } # 51 to 100 if ($ins_size == '2.5x3.5' $ins_quantity = '51' $ins_quantity = '100') { $price = '0.45'; } # 101 to 150 if ($ins_size == '2.5x3.5' $ins_quantity = '101' $ins_quantity = '150') { $price = '0.40'; } # 151 to infinity if ($ins_size == '2.5x3.5' $ins_quantity = '151') { $price = '0.30'; } # 3.5x5 pricing matrix # # less than or equal to 50 if ($ins_size == '3.5x5' $ins_quantity = '50') { $price = '0.49'; } # 51 to 100 if ($ins_size == '3.5x5' $ins_quantity = '51' $ins_quantity = '100') { $price = '0.45'; } # 101 to 150 if ($ins_size == '3.5x5' $ins_quantity = '101' $ins_quantity = '150') { $price = '0.40'; } # 151 to infinity if ($ins_size == '3.5x5' $ins_quantity = '151') { $price = '0.30'; } ## # 5x7 pricing matrix # ## # less than or equal to 50 if ($ins_size ==
[PHP] OOP for Web Programming Paradigm
Hello. I have this question. When I program, I try to create a class for each table. Example below. Now what some complain about, and logically so, is that this might impose an overhead (I load all data even if I just need a counter and NOT description). So I say we can make a STATIC version of each Accessor with $cid as argument; But then they say what if i want to load an array of all 2000 counters, for example. I say first get all the $cid's, then in an array, load a class for each one, etc.. That however makes lots of SQL calls instead of one big one. I suppose I can get all data and then load it into classes, but that seems like a bad approach, especially for calculated values. What I am curious about is what paradigms do you guys use to address these issues? Is my paradigm good and it's worth to just provide static methods for frequently necessary fields to reduce overhead, or is there a better way of dealing with this stuff? class Counter { var $db; var $cid; var $counter; var $descr; /** * Default Constructor * @param int $cid - Counter ID */ function Counter($cid=false) { global $db; $this-db = $db; if (isset($cid) $cid) $this-load($cid); } /** * Description * @param int $cid - Counter ID * @return bool */ function load($cid=0) { if (!$cid) return false; $q = SELECT * FROM counter WHERE cid = $cid; $r = $this-db-getRow($q); // Using PEAR here. if (!DB::isError($r)) { $this-cid = $r[cid]; $this-counter = $r[counter]; $this-descr = $r[descr]; return true; } return false; } # # Accessor Methods # function getCid() { return $this-cid; } function getCounter() { return $this-counter; } function getDescr() { return $this-descr; } # # Mutator Methods # function setCid($v) { $this-iaid= $v; } function setCounter($v) { $this-counter = $v; } function setDescr($v) { $this-descr = $v; } // Many other methods, etc Static methods, etc... } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OOP for Web Programming Paradigm
olinux wrote: I'm no OOP programmer but maybe extend your class to include methods for each situation. something like this: function countSingle($cid) function countMulti($cidArray) function countAll() HTH, olinux Hmm, yes, that's an interesting idea. Except perhaps include the first arg as a by-refrence return variable, so that func can return true false. Yeah, I think that's not bad. Still, would have to have static accessors, but oh well... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] total file size
Is there a way to find out total upload file size from a file uploaded though an html form? I figure if I know the total size, then I can just consistently poke at the file being uploaded and math a progress bar for the file being uploaded, of course, this all hangs upon the ability of getting the total file size BEFORE it is uploaded. It IS possible I have seen it done with JSP; anybody can help me with this? Thanks - Vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] total file size
With what then? Why not? Should this be a bug filed in their bugs database? - Vic -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 2:00 PM To: Victor; [EMAIL PROTECTED] Subject: Re: [PHP] total file size yes, it is possible, but not with php. Jim - Original Message - From: Victor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, January 22, 2003 8:10 PM Subject: [PHP] total file size Is there a way to find out total upload file size from a file uploaded though an html form? I figure if I know the total size, then I can just consistently poke at the file being uploaded and math a progress bar for the file being uploaded, of course, this all hangs upon the ability of getting the total file size BEFORE it is uploaded. It IS possible I have seen it done with JSP; anybody can help me with this? Thanks - Vic __ Post your free ad now! http://personals.yahoo.ca -- 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 __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD jpg thumbnail - ugly discollored
I have a script that takes uploaded images (jpeg only) and makes proportionate thumbnails etc, and saves them in jpeg (.jpg) format again (default compression of %75 I think) anyway, the thumbnails are UGLY. Beauty of content aside, they are discolored, and usually one predominant color takes over the entire picture so they come looking like off-black and white thumbnails. WHY? And how can I fix this/get around it? This is some extra info. GD Support enabled GD Version 2.0 or higher FreeType Support enabled FreeType Linkage with freetype JPG Support enabled PNG Support enabled WBMP Support enabled __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD jpg thumbnail - ugly discollored
That is not an option since I do not have control over the hosting company. -Original Message- From: George E. Papadakis [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 3:20 PM To: Victor; [EMAIL PROTECTED] Subject: Re: [PHP] GD jpg thumbnail - ugly discollored Use ImageMagick found @ http://www.imagemagick.org . It is all you need to handle images. Aside the binary external program take a look at this too : http://magick.communityconnect.com/ best of luck, --georgep - Original Message - From: Victor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 25, 2003 10:00 PM Subject: [PHP] GD jpg thumbnail - ugly discollored I have a script that takes uploaded images (jpeg only) and makes proportionate thumbnails etc, and saves them in jpeg (.jpg) format again (default compression of %75 I think) anyway, the thumbnails are UGLY. Beauty of content aside, they are discolored, and usually one predominant color takes over the entire picture so they come looking like off-black and white thumbnails. WHY? And how can I fix this/get around it? This is some extra info. GD Support enabled GD Version 2.0 or higher FreeType Support enabled FreeType Linkage with freetype JPG Support enabled PNG Support enabled WBMP Support enabled __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] + in filenames
I have a file upload field, and some filename checking code, but it breaks the code whenever a + is inside the filename it verifies space and other tags but breaks on + in the name. Anyone know a fix for this please? - Vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD jpg thumbnail - ugly discollored
Thanks it worked. - Vic -Original Message- From: Mark Charette [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 4:42 PM To: Victor; [EMAIL PROTECTED] Subject: RE: [PHP] GD jpg thumbnail - ugly discollored make sure you use: ImageCreateTrueColor() to create the thumbnail image and ImageCopyResampled() when you copy the image. Mark C. -Original Message- From: Victor [mailto:[EMAIL PROTECTED]] I have a script that takes uploaded images (jpeg only) and makes proportionate thumbnails etc, and saves them in jpeg (.jpg) format again (default compression of %75 I think) anyway, the thumbnails are UGLY. __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] + in filenames
Here is some sample code: $file_name = explode(., $_FILES['picture']['name']); $name = str_replace('', '_', $file_name[0]); # check if file uploaded is good if ( !in_array($_FILES['picture']['type'], $file_type) || trim($_FILES['picture']['tmp_name']) == || trim($_FILES['picture']['tmp_name']) == none ) { echo ('You can upload a JPG or JPEG filetype only.'); exit; } # Add slashes to prevent certain errors $picture_name = strip_tags($_FILES['picture']['name']); $picture_name = addslashes($picture_name); $picture_name = str_replace(\r\n, , $picture_name); $picture_name = str_replace( , , $picture_name); -Original Message- From: Richard Whitney [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 5:12 PM To: Victor Cc: [EMAIL PROTECTED] Subject: Re: [PHP] + in filenames Some sample code would help, but maybe try urldecode('$filename'); RW Quoting Victor [EMAIL PROTECTED]: ### I have a file upload field, and some filename checking code, but it ### breaks the code whenever a + is inside the filename it verifies space ### and other tags but breaks on + in the name. Anyone know a fix for this ### please? ### ### - Vic ### ### __ ### Post your free ad now! http://personals.yahoo.ca ### ### -- ### 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 __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] + in filenames
I DO want preserve the filenames, and the pluses come from the user (beta testers that deliberately try to hack the script) . all I want to do is make sure the the script doeasnt breack when a user uploads a file that has the + character in it's name. - Vic -Original Message- From: Richard Whitney [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 25, 2003 5:32 PM To: Victor Cc: [EMAIL PROTECTED] Subject: RE: [PHP] + in filenames Victor! What are you trying to accomplish? Do you want to preserve the original filename? Why not give uploaded files uniformly unique names? In other words, where are the +'s coming from? So, a little more detail, please! RW Quoting Victor [EMAIL PROTECTED]: ### Here is some sample code: ### ### ### ### $file_name = explode(., $_FILES['picture']['name']); ### $name = str_replace('', '_', $file_name[0]); ### ### # check if file uploaded is good ### if ### ( ### !in_array($_FILES['picture']['type'], ### $file_type) ### || trim($_FILES['picture']['tmp_name']) == ### || trim($_FILES['picture']['tmp_name']) == ### none ### ) ### { ### echo ('You can upload a JPG or JPEG filetype ### only.'); ### ### exit; ### } ### ### # Add slashes to prevent certain errors ### $picture_name = strip_tags($_FILES['picture']['name']); ### $picture_name = addslashes($picture_name); ### $picture_name = str_replace(\r\n, , $picture_name); ### $picture_name = str_replace( , , $picture_name); ### ### ### ### -Original Message- ### From: Richard Whitney [mailto:[EMAIL PROTECTED]] ### Sent: Saturday, January 25, 2003 5:12 PM ### To: Victor ### Cc: [EMAIL PROTECTED] ### Subject: Re: [PHP] + in filenames ### ### Some sample code would help, but maybe try urldecode('$filename'); ### ### RW ### ### Quoting Victor [EMAIL PROTECTED]: ### ### ### I have a file upload field, and some filename checking code, but it ### ### breaks the code whenever a + is inside the filename it verifies ### space ### ### and other tags but breaks on + in the name. Anyone know a fix for ### this ### ### please? ### ### ### ### - Vic ### ### ### ### ### __ ### ### Post your free ad now! http://personals.yahoo.ca ### ### ### ### -- ### ### 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 ### ### __ ### Post your free ad now! http://personals.yahoo.ca ### ### -- ### 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 __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php ISA v.s. php CGI
What is the difference between PHP ISAPI filter and PHP CGI (which one would be better to install on IIS 5?) -thanks, - vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] posix_kill process group
Hi. I am trying to use posix_kill(0, $signo); to signal children forked by the parent. All children seem to be in the processgroup of the parent, but sending either 0 or -10 does not seem to signal the children at all. What am I doing wrong? I even tried setting the process group (didn't affect anything). It doesn't seem like sending the kill to 0 reaches the children. Has anybody used pcntl and posix_kill with success and if so, could you provide me a code sniplet? Here is my main: function main() { global $logfile; $logfile = /tmp/runner.log..date(Ymd:Hi); //posix_setsid(); pcntl_signal(SIGINT, array(runner,sig_handler_parent)); pcntl_signal(SIGTERM, array(runner,sig_handler_parent)); pcntl_signal(SIGHUP, array(runner,sig_handler_parent)); pcntl_signal(SIGUSR1, array(runner,sig_handler_parent)); do { if ($this-numChildren = MAXCHILDREN $this-count 0) { $pid = pcntl_fork(); if ($pid 0) { die(could not fork); } elseif ($pid == 0) { $ret = $this-child($args); exit ($ret); } else { $this-log(Child Started: [PID:$pid] - [JOB:test]); $this-numChildren++; // posix_setpgid($pid,posix_getpgid($this-pid)); $this-count--; } } // sleep(5); $out = pcntl_waitpid ( -1, $status, WNOHANG ); if ($out 0) { $this-numChildren--; } } while ($this-count 0 || $this-numChildren 1); echo Done \n; } function sig_handler_parent($signo) { switch($signo) { case SIGINT: case SIGUSR1; case SIGTERM: posix_kill(0, $signo); exit; break; case SIGHUP: // handle restart tasks echo SIGHUP\n; break; default: echo ANOTHER EVENT\n; // handle all other signals } } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Socket error connecting to mySQL
did u turn mysql on? end of mysql installation output: PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! This is done with: /usr/bin/mysqladmin -u root password 'new-password' /usr/bin/mysqladmin -u root -h CPE00022af118a5-CM024330008757.cpe.net.cable.rogers.com password 'new-password' See the manual for more instructions. NOTE: If you are upgrading from a MySQL = 3.22.10 you should run the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be able to use the new GRANT command! You can start the MySQL daemon with: cd / ; /usr/bin/safe_mysqld You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory: cd sql-bench ; run-all-tests Please report any problems with the /usr/bin/mysqlbug script! The latest information about MySQL is available on the web at http://www.mysql.com Support MySQL by buying support/licenses at https://order.mysql.com Bryan Lipscy wrote: $db= @mysql_pconnect ( $DB_HOST , $DB_USER , $DB_PASS ); @mysql_select_db ( $DB_DB ) or die ( DATABASE ERROR!.mysql_error() ); Returns DATABASE ERROR!Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) MySQL server exists on a Win2ksp3 box. Apache with PHP 4.3.0 exists on a Slackware 8.1 box. All parameters are correct. Boxes can see each other. All php scripts work when run on the Win2k box. Any ideas why connecting to php/mysql would throw this error? Bryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unexpected warnings - what do they mean? - phpMyAdmin - also postedon the phpMyAdmin mailing list...
i am getting the following warnings after i try to inser data into some table cells i created. i have PHP Version 4.1.2 and MySQL 3.23.55. Apache 1.3.23. Redhat 7.3. oh, and i have php 4.3.0 installed, but i dont know how to make apche see it or use it. its ina different directory than the default redhat php which is what i am using now. anyway, anybody knwo what these warnings mean? thanks, - Vic ___ Warning: Undefined variable: goto in /var/www/html/phpMyAdmin/tbl_replace.php on line 34 Warning: Undefined variable: goto in /var/www/html/phpMyAdmin/tbl_replace.php on line 58 Warning: Variable passed to reset() is not an array or object in /var/www/html/phpMyAdmin/tbl_replace.php on line 63 Warning: Undefined variable: submit_type in /var/www/html/phpMyAdmin/tbl_replace.php on line 70 Warning: Variable passed to each() is not an array or object in /var/www/html/phpMyAdmin/tbl_replace.php on line 136 Warning: Undefined variable: table in /var/www/html/phpMyAdmin/tbl_replace.php on line 157 Warning: Undefined variable: db in /var/www/html/phpMyAdmin/tbl_replace.php on line 166 Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin/tbl_replace.php:34) in /var/www/html/phpMyAdmin/libraries/ob.lib.php on line 65 Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin/tbl_replace.php:34) in /var/www/html/phpMyAdmin/header.inc.php on line 27 Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin/tbl_replace.php:34) in /var/www/html/phpMyAdmin/header.inc.php on line 28 Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin/tbl_replace.php:34) in /var/www/html/phpMyAdmin/header.inc.php on line 29 Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin/tbl_replace.php:34) in /var/www/html/phpMyAdmin/header.inc.php on line 30 Warning: Cannot add header information - headers already sent by (output started at /var/www/html/phpMyAdmin/tbl_replace.php:34) in /var/www/html/phpMyAdmin/header.inc.php on line 32 Server localhost Error SQL-query : INSERT INTO ( ) VALUES ( ); MySQL said: You have an error in your SQL syntax near '() VALUES ()' at line 1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list...
they the default lines of code form phpMyAdmin the newest one stable. just installed it today, the lines are not modified they what the devs made them... - Vic Steve Keller wrote: At 2/4/2003 06:46 PM, you wrote: i am getting the following warnings after i try to inser data into some table cells i created. i have PHP Version 4.1.2 and MySQL 3.23.55. Apache 1.3.23. Redhat 7.3. oh, and i have php 4.3.0 installed, but i dont know how to make apche see it or use it. its ina different directory than the default redhat php which is what i am using now. anyway, anybody knwo what these warnings mean? It would help if we could see the affected lines of code. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list...
the error reportin value is marked specifically not to be touched, plus there are other things that are wroong like the values that i am inserting though the forms is not picked up... - i will try an older relase see if it works better. - vic John W. Holmes wrote: PHPMyAdmin probably requires a lower error_reporting level than you have. You're just seeing NOTICES, not errors. Either adjust the error_reporting in php.ini, an .htaccess file for this directory, or use the error_reporting() function in the PHPMyAdmin script. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: victor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 7:02 PM To: Steve Keller Cc: [EMAIL PROTECTED] Subject: Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list... they the default lines of code form phpMyAdmin the newest one stable. just installed it today, the lines are not modified they what the devs made them... - Vic Steve Keller wrote: At 2/4/2003 06:46 PM, you wrote: i am getting the following warnings after i try to inser data into some table cells i created. i have PHP Version 4.1.2 and MySQL 3.23.55. Apache 1.3.23. Redhat 7.3. oh, and i have php 4.3.0 installed, but i dont know how to make apche see it or use it. its ina different directory than the default redhat php which is what i am using now. anyway, anybody knwo what these warnings mean? It would help if we could see the affected lines of code. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list...
WHOHOO!!! probme solved! (read: worked around) i downloaded the older phpMyAdmin release and it worked perfectly! could this be a bug in phpMyAdmin? - Vic victor wrote: the error reportin value is marked specifically not to be touched, plus there are other things that are wroong like the values that i am inserting though the forms is not picked up... - i will try an older relase see if it works better. - vic John W. Holmes wrote: PHPMyAdmin probably requires a lower error_reporting level than you have. You're just seeing NOTICES, not errors. Either adjust the error_reporting in php.ini, an .htaccess file for this directory, or use the error_reporting() function in the PHPMyAdmin script. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: victor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 7:02 PM To: Steve Keller Cc: [EMAIL PROTECTED] Subject: Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list... they the default lines of code form phpMyAdmin the newest one stable. just installed it today, the lines are not modified they what the devs made them... - Vic Steve Keller wrote: At 2/4/2003 06:46 PM, you wrote: i am getting the following warnings after i try to inser data into some table cells i created. i have PHP Version 4.1.2 and MySQL 3.23.55. Apache 1.3.23. Redhat 7.3. oh, and i have php 4.3.0 installed, but i dont know how to make apche see it or use it. its ina different directory than the default redhat php which is what i am using now. anyway, anybody knwo what these warnings mean? It would help if we could see the affected lines of code. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list...
And what do you know? it is. damn old redhat php.ini . ok, no onto the next related question. i have installed php 4.30 but apache stilll uses the rpm default redhat php. how do i do this. also i remember that in the olden days i could type apachectl and control apache, but not so in redhat? why not? someone please help me run the new php, thanks - Vic John W. Holmes wrote: Is it a register_globals problem, then? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: victor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 7:48 PM To: [EMAIL PROTECTED] Cc: 'Steve Keller'; [EMAIL PROTECTED] Subject: Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list... the error reportin value is marked specifically not to be touched, plus there are other things that are wroong like the values that i am inserting though the forms is not picked up... - i will try an older relase see if it works better. - vic John W. Holmes wrote: PHPMyAdmin probably requires a lower error_reporting level than you have. You're just seeing NOTICES, not errors. Either adjust the error_reporting in php.ini, an .htaccess file for this directory, or use the error_reporting() function in the PHPMyAdmin script. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: victor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 7:02 PM To: Steve Keller Cc: [EMAIL PROTECTED] Subject: Re: [PHP] unexpected warnings - what do they mean? - phpMyAdmin - also posted on the phpMyAdmin mailing list... they the default lines of code form phpMyAdmin the newest one stable. just installed it today, the lines are not modified they what the devs made them... - Vic Steve Keller wrote: At 2/4/2003 06:46 PM, you wrote: i am getting the following warnings after i try to inser data into some table cells i created. i have PHP Version 4.1.2 and MySQL 3.23.55. Apache 1.3.23. Redhat 7.3. oh, and i have php 4.3.0 installed, but i dont know how to make apche see it or use it. its ina different directory than the default redhat php which is what i am using now. anyway, anybody knwo what these warnings mean? It would help if we could see the affected lines of code. -- S. Keller UI Engineer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Pkwy. Anchorage, AK 99508 907.770.6200 ext.220 907.336.6205 (fax) Email: [EMAIL PROTECTED] Web: www.healthtvchannel.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] any windows php developers out here?
Hello, I am wondering if any of you got a reliable php and MySQL installation (MySQL is easy) I am mostly wondering if there is a point in tying to use windows as a development platform for PHP. I have a nice and working red hat 8.0 installation, but I did an upgrade from 7.3 and now apache doesn't work cuz it wants me to switch form apache 1.X to 2.X and all I want is to erase the old apache and use the new one or erase the new one and use the old one, whichever works. But anyway... I also do design and I have people submit me illustrator and Photoshop files and word docs, so for now I might have to stick to windows for work. BUT what do u suggest? I it futile to try to get php to work in windows? With IIS preferably so that I can play with ASP and Cold Fusion once in a while. Please help if you are using windows with php and send me some instructions if you feel like it, much appreciated. - Vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] any windows php developers out here?
I got IIS working fine, and I did I think, the steps in the php ISAPI instaltion manual. I think. .. but when I call the php page, it tries to download it, as far as I know that is a sign that is doesn't know how to handle that file, whicth means that my instaltion is not that great. So I guess I al looking to finding out what I need to configure IIS to to get the ISAPI module to work, etc. -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 08, 2003 6:27 PM To: 'Victor'; [EMAIL PROTECTED] Subject: RE: [PHP] any windows php developers out here? Hello, I am wondering if any of you got a reliable php and MySQL installation (MySQL is easy) I am mostly wondering if there is a point in tying to use windows as a development platform for PHP. I have a nice and working red hat 8.0 installation, but I did an upgrade from 7.3 and now apache doesn't work cuz it wants me to switch form apache 1.X to 2.X and all I want is to erase the old apache and use the new one or erase the new one and use the old one, whichever works. But anyway... I also do design and I have people submit me illustrator and Photoshop files and word docs, so for now I might have to stick to windows for work. BUT what do u suggest? I it futile to try to get php to work in windows? With IIS preferably so that I can play with ASP and Cold Fusion once in a while. Please help if you are using windows with php and send me some instructions if you feel like it, much appreciated. I've got PHP and IIS running on a production server and several development servers with no issues. It takes all of 5 minutes to get installed. Do you at least have IIS running yet? It's only a couple steps after that, most of which are outlined in the manual. Contact me off list if you want more help and let me know what point you're at right now. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] any windows php developers out here?
How do I disable apache 2.0? -Original Message- From: Jason Sheets [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 08, 2003 6:33 PM To: Victor Cc: [EMAIL PROTECTED] Subject: Re: [PHP] any windows php developers out here? You can install PHP + Apache 1.3 on Windows pretty easily. There are instructions in the manual at http://www.php.net/manual and there are also pre-constructed installers that other people make (try www.hotscripts.com/PHP under applications). If you just need to get apache 1.3 installed on redhat you just need to either disable apache 2 or install apache 1.3 and make it listen on a different port (8080 or something). You can have both installed if you configure them with a --prefix, something like ./configure --prefix=/usr/local/apache13 Jason On Sat, 2003-02-08 at 16:13, Victor wrote: Hello, I am wondering if any of you got a reliable php and MySQL installation (MySQL is easy) I am mostly wondering if there is a point in tying to use windows as a development platform for PHP. I have a nice and working red hat 8.0 installation, but I did an upgrade from 7.3 and now apache doesn't work cuz it wants me to switch form apache 1.X to 2.X and all I want is to erase the old apache and use the new one or erase the new one and use the old one, whichever works. But anyway... I also do design and I have people submit me illustrator and Photoshop files and word docs, so for now I might have to stick to windows for work. BUT what do u suggest? I it futile to try to get php to work in windows? With IIS preferably so that I can play with ASP and Cold Fusion once in a while. Please help if you are using windows with php and send me some instructions if you feel like it, much appreciated. - Vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] How to uncompress PHP
I think it's tar -xvf name -Original Message- From: Ñ bQ [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 08, 2003 8:26 PM To: [EMAIL PROTECTED] Subject: [PHP] How to uncompress PHP Hi, I am Lin. When I execute a command gzip -d php-4_3_0_tar.gz on the linux. The system show the following error. gzip: php-4_3_0_tar.gz: not in gzip format How can I uncompress this file. __ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] any windows php developers out here?
In GNU/Linux, chkconfig --level 35 httpd off Wow man, that just SCREAMS apache off! How intuitive Linux is... - Vic Thanks, I'll try it. But, what will that turn off? I have apache 1.X and apache 2.X on red hat? I want to use either or, whichever works with the php 4.3 on red hat. So ... what do I choose? How do I make the system use only one of them, how do I erase the other one? -Original Message- From: Adolfo Bello [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 08, 2003 7:31 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] any windows php developers out here? On Sat, 2003-02-08 at 20:18, Victor wrote: How do I disable apache 2.0? In Windows, go to service-apache-manual start In GNU/Linux, chkconfig --level 35 httpd off -- __ / \\ @ __ __@ Adolfo Bello [EMAIL PROTECTED] / // // /\ / \\ // \ // Bello Ingenieria S.A, ICQ: 65910258 / \\ // / \\ / // // / //cel: +58 416 609-6213 /___// // / _/ \__\\ //__/ // fax: +58 212 952-6797 www.bisapi.com //pager: www.tun-tun.com (# 609-6213) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Why does this happen?
Maybe you should rename them differently/ or make then into an array? -Original Message- From: CF High [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 08, 2003 10:52 PM To: [EMAIL PROTECTED] Subject: [PHP] Why does this happen? Hey all. Got a problem with I'm sure a simple solution:: In this test form when I submit and insert into my db, only the last select field get entered; i.e. in this case the day value of 25. form name=form1 method=post action= Year select name=date onSelect=return check_submit() option selected value=20022002/option /select Month select name=date option selected value=1212/option /select Day select name=date option selected value=2525/option /select input type=submit name=textfield /form Why does this happen? In Cold Fusion I'm able to refer to the three selects as #date# and it returns 20021225 as expected. Any ideas? Thanks, --Noah -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] any windows php developers out here?
Kk, I got it to work in apache 2.X on redhat 8.0 all I had to do is start apache from the directory it resides in and then it work sfine, but I will try your notes also and get it working on windows too. Thanks, I'll see if I have more problems... -Original Message- From: John W. Holmes [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 08, 2003 8:58 PM To: 'Victor'; [EMAIL PROTECTED] Subject: RE: [PHP] any windows php developers out here? So I guess I al looking to finding out what I need to configure IIS to to get the ISAPI module to work, etc. 1. Unzip the php .zip file to C:\php\ 2. Copy c:\php\sapi\php4isapi.dll to c:\php\php4isapi.dll 3. Ensure the user IIS runs as, generally IUSR_computer_name, has read permissions to C:\php\ and all subdirectories. 4. Follow directions as in the manual 5. Shut down IIS (net stop iisadmin) 6. Open up IIS control panel 7. Add ISAPI filter pointing to c:\php\php4isapi.dll 8. Add application mapping pointing to c:\php\php4isapi.dll 9. Start up IIS (net start w3svc) That's it... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] any windows php developers out here?
So I guess I al looking to finding out what I need to configure IIS to to get the ISAPI module to work, etc. 1. Unzip the php .zip file to C:\php\ 2. Copy c:\php\sapi\php4isapi.dll to c:\php\php4isapi.dll 3. Ensure the user IIS runs as, generally IUSR_computer_name, has read permissions to C:\php\ and all subdirectories. 4. Follow directions as in the manual 5. Shut down IIS (net stop iisadmin) 6. Open up IIS control panel 7. Add ISAPI filter pointing to c:\php\php4isapi.dll 8. Add application mapping pointing to c:\php\php4isapi.dll 9. Start up IIS (net start w3svc) That's it... ---John W. Holmes... You are the best! Thanks, BTW who is in charge of the PHP installation documentation, I would like to slap them in the face with these instructions. I know that IIS setup is not their domain but they are responsible for helping users use PHP and facilitating that is made by clear documentation, this documentation here is not perfect, but it's much more in depth and clearer to the one who doesn't want to go to get a MSCSE degree so that they know how to get PHP running on IIS... - Vic __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp_problem - ... php_network_getaddresses: getaddrinfo failed: ...
Any tips on trouble shooting this problem? Warning: php_network_getaddresses: getaddrinfo failed: Name or service not known in /xxx/xxx/xxx/xxx/new_user.php on line 121 Could not establish FTP connection. This is the code the error refers to: # set up basic connection $conn_id = ftp_connect($ftp_server) or die ('Could not establish FTP connection.'); The config file is somewhere else on the server - outside the public dir for sec. reasons. The info is correct. - I cannot divulge it, but it is correct (or let's assume it is), so where to now??? - Victor | www.argilent.com __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] some data output formatting and grouping question...
I just have a fucking mental block; I cannot at all conceive the necessary syntax to or even the theoretical algorithm that I need, to do the following: Consider the following table: U | X | Y --|---|-- me|001|0a me|002|0a me|003|0a me|002|0b me|003|0b me|004|0b ..|...|.. then the code says: SELECT * FROM Y WHERE U = me So now what? - remember I do not know the value of Y, so it has to be an automatic thing; I can't just say ... WHERE U = me AND Y = a. I want this output: 0a 001 002 003 ___ (hr) 0b 002 003 004 How the hell do I do that? I can't think of the goddamn' syntax! __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] some data output formatting and grouping question...
I just have a mental block; I cannot at all conceive the necessary syntax to or even the theoretical algorithm that I need, to do the following: Consider the following table: U | X | Y --|---|-- me|001|0a me|002|0a me|003|0a me|002|0b me|003|0b me|004|0b ..|...|.. then the code says: SELECT * FROM Y WHERE U = me So now what? - remember I do not know the value of Y, so it has to be an automatic thing; I can't just say ... WHERE U = me AND Y = a. I want this output: 0a 001 002 003 ___ (hr) 0b 002 003 004 How the h3ll do I do that? I can't think of the g0dd4mn' syntax! __ Post your ad for free now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] SNMP PLEASE HELPP!!!!!!!!!!
? $a = snmpwalk(216.18.74.170, public, ); for($i=0; $i551; $i++) { print $a[$i]; print br; } ? This is my code and i recieve a huge list. Some of it i understand but i can't understand the OID part and all the ips there. Can you please help me Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Why create_element function always return false?
?php $doc = domxml_new_doc(1.0); $node = $doc-create_element(para); $newnode = $doc-append_child($node); $newnode-set_attribute(align, left); ? I just run the example that is from php manual. But there is some error -- Warning: domnode::append_child() expects parameter 1 to be object, null given in C:\AppServ\www\tutorial\test.php on line 4 Fatal error: Call to a member function set_attribute() on a non-object in C:\AppServ\www\tutorial\test.php on line 5 -- It is very strangeI found that create_element always return falsenomatter what I dowhat example I tried... Not only create_element return false but also create_coment do so... Why??? I run php 5.2.2 with AppServ . The version of docmxl is 20626 (I just call domxml_version() ). OS is Windows XP. Would someone help me ,please? Thanks a lot. Victor. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP forms
Hi, my name is Victor from Namibia, I do web development with PHP, I hapenned to find your email address on one of the PHP sites on the Net, as one of the contributors on the PHP notes. Can you please, if it is possible, tell me how to write in a form field with PHP script. Like in Javascript, if one has a form named members and a text field called memberid, one can write in the memberid field as follows: script language =javascript member.memberid.value='M100'; /script I will appreciate your help very much. Thanking you in advance. Vict -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] multiple replaces...
If you only want to replace strings, then drop the regular expression functions! (a common mistake) Use for example str_replace, or in this case, strtr which is better because it accepts an array as replacement pattern. For example: $foo = array(foo = apple, bar = banana); $string = I like foos and bars; $string = strtr($string, $foo); echo $string; output: I like apples and bananas // Victor - Original Message - From: 'Nick Wilson' [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, January 12, 2002 1:17 PM Subject: Re: [PHP] multiple replaces... -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 * On 12-01-02 at 13:02 * Lauri Vain said Hi Nick, Yes, I thought about that. But, what should I do when the markers are absolutely NOT in any sequence. I also thought about something like $replace[1][1] = !one!; //marker $replace[1][2] = hehee; //replace with $replace[1][1] = test; //marker $replace[1][2] = foobar; //replace with $replace[1][1] = repl; //marker $replace[1][2] = humpty-dumpty; //replace with $replace[1][1] = blah; //marker $replace[1][2] = boo; //replace with Now, when I would do a loop thingie that goes through all those, then it would be a pretty nice and compact solution... What about speed issues regarding this solution? I don't think speed will be an issue unless you have thousands of markers, in which case you'll need to re-think the whole thing. Can you not put all of your markers in an array like $markers=array(m1, m2, m_whatever); and all your replacements likewise $replace=array(r1, r2, r_whatever); and then loop through like that? If not, explain a little more about the context of the problem and let's see if we can come up with an alternative. - -- Nick Wilson Tel: +45 3325 0688 Fax: +45 3325 0677 Web: www.explodingnet.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8QCk+HpvrrTa6L5oRAozIAJ4opVPFNwawBmQNIAHLZN/gdCt+lgCeLgmC 5hurUMezrXCg3cVtYgieGGE= =xRPE -END PGP SIGNATURE- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image generation?
PEAR? I think it would be better if someone did a real PHP module for ImageMagick, just like PerlMagick is for Perl. There is one at http://php.chregu.tv/imagick/, but it's far from complete. If someone would like to help him with the project then it would be great. ImageMagick is so much easier to install than GD, and it's a lot better too. // Victor. - Original Message - From: Weston Houghton [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, February 03, 2002 8:45 AM Subject: Re: [PHP] RANT: Why doesn't PHP have built-in support for dynamic image generation? Anybody interested in working on a PEAR module to interface PHP with something like ImageMagick directly? I would love to see it. Maybe if I am unemployed long enough soon I can work on it myself. Not that I really want that to happen... I think that might be the best solution for PHP's lack of image functionality though... Wes Hi Erica, I feel your pain - I've been dealing with the same thing this week. I finally got the compile to complete and the system up and running, but it was painful. It seemed like everything was finished, but I've noticed high server loads (.8), trouble accessing web pages (I tested using wget and it had to try 6 times to get the page and kept reporting EOF in headers), and my MySQL server keeps reporting errors communicating with the web server, and dropped connections to the MySQL server. Safe to say, something didn't work and I need to start over and pray for the best. Have you gotten it to work properly? If so, what files did you use and what steps did you take in the install? -Ed At 11:24 PM 2/2/2002 -0800, Erica Douglass wrote: Forgive my grumpiness, but I've spent the last several hours trying to install GD, etc. Let's be honest. PHP needs built-in support for creating dynamic images. JSP already has this. Heck, you could even make it a configure option. As it stands now, you have to do the following: -- Install GD -- Install all of GD's numerous dependencies -- Install zlib -- Install freetype -- Install libttf THEN you have to compile PHP with all of the requisite options to enable GD here and Freetype there, and PHP often won't compile without specifying /path/to/various/options, so you have to dig around your system to find out where everything was installed. This results in a long and unwieldy configure statement which often does not work. PHP needs to have a simple configure option called --enable-dynamic-images or something similar. This should use built-in libraries that are downloaded with the PHP source to create PNG images. Images can then be created with standard PHP functions. This would be much more useful than relying on several third-party solutions which do not easily work with each other. This would also have the benefit of being more portable -- as I plan to release my code to several different people running different types of servers, I would like to minimize compatibility issues. If anyone has a better solution, feel free to email me. As it stands, I am very frustrated with this, and I haven't yet seen the light at the end of the tunnel. Thanks, Erica -- 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] Problems with maximum execution time
Hello I got a problem with php and apache. I have installed latest squirrelmail(1.2.5), that uses php. When i point browser to the webfolder of squirrelmail, i get the login form just fine. This means that php works ok. But when i try to log on, the only thing i get is: Fatal error: Maximum execution time of 30 seconds exceeded in /home/squirrel/functions/imap_general.php on line 117 I have tried to increase timeout value in the php.ini to 300, and to 0 (unlimited, as far as i understand), but it just took longer time to get this error message. System information: RH72, 2.4.9-31 kernel, apache-1.3.22-2, php-4.0.6-12, imap-2000c-15, php-imap-4.0.6-12. System is intalled from RH7.2 CD and updated with help of up2date. What is strange is that i have another RH7.2 computer with the same versions of packages, and there squirrel works just fine. I have compared php.ini and httpd.conf between these two computes, and they are identical. I do not get anything in apache`s error_log, but in access log i get this: Computer wherer squirrel does not work: pc51-119.hiof.no - - [09/Mar/2002:10:27:14 +0100] GET /mail HTTP/1.1 301 322 pc51-119.hiof.no - - [09/Mar/2002:10:27:15 +0100] GET /mail/ HTTP/1.1 302 5 pc51-119.hiof.no - - [09/Mar/2002:10:27:17 +0100] GET /mail/src/login.php HTTP/1.1 200 1470 pc51-119.hiof.no - - [09/Mar/2002:10:27:18 +0100] GET /mail/images/sm_logo.png HTTP/1.1 304 - pc51-119.hiof.no - - [09/Mar/2002:10:27:54 +0100] POST /mail/src/redirect.php HTTP/1.1 200 160 and nothing more Computer where squirrel does work: my_hostname - - [09/Mar/2002:10:30:22 +0100] GET /mail HTTP/1.1 301 316 my_hostname - - [09/Mar/2002:10:30:24 +0100] GET /mail/ HTTP/1.1 302 5 my_hostname - - [09/Mar/2002:10:30:25 +0100] GET /mail/src/login.php HTTP/1.1 302 5 my_hostname - - [09/Mar/2002:10:30:34 +0100] GET /mail/src/login.php HTTP/1.1 200 1502 my_hostname - - [09/Mar/2002:10:30:39 +0100] GET /mail/images/sm_logo.png HTTP/1.1 304 - my_hostname - - [09/Mar/2002:10:30:44 +0100] POST /mail/src/redirect.php HTTP/1.1 302 0 my_hostname - - [09/Mar/2002:10:30:44 +0100] GET /mail/src/webmail.php HTTP/1.1 200 204 my_hostname - - [09/Mar/2002:10:30:46 +0100] GET /mail/src/right_main.php HTTP/1.1 200 15956 Someone got any ideas about what can be wrong ? Thank you in advance -- Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Failed to compiled w/ T1lib
To make a long story short: I'm trying to compile PHP 4.2 with Apache, GD, T1lib and more. This is what I'm using: [configuring apache first] ./configure --with-apache=../apache_1.3.24 --enable-ftp --with-mysql=/usr/l ocal/mysql/ --enable-track-vars --enable-inline-optimization --disable-debug --enable-memory-limit --with-xml --enable-t1lib --with-t1lib=/usr/local/lib --with-gd=../gd-2.0.1 --with-freetype-dir=/usr --enable-gd-native-ttf --en able-gd-imgstrttf --with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib make make install cd ../apache_1.3.24 ./configure --activate-module=src/modules/php4/libphp4.a --enable-module=rew rite make And this is what I get: /usr/libexec/elf/ld: warning: libpng.so.4, needed by /usr/local/lib/libgd.so, may conflict with libpng.so.5 modules/php4/libphp4.a(gd.o): In function `zif_imagecreatetruecolor': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0xd9e): undefined reference to `gdImageCreateTrueColor' modules/php4/libphp4.a(gd.o): In function `zif_imagetruecolortopalette': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0xf2b): undefined reference to `gdImageTrueColorToPalette' modules/php4/libphp4.a(gd.o): In function `zif_imagesetthickness': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1032): undefined reference to `gdImageSetThickness' modules/php4/libphp4.a(gd.o): In function `zif_imagefilledellipse': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x136a): undefined reference to `gdImageFilledEllipse' modules/php4/libphp4.a(gd.o): In function `zif_imagefilledarc': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1836): undefined reference to `gdImageFilledArc' modules/php4/libphp4.a(gd.o): In function `zif_imagealphablending': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x193a): undefined reference to `gdImageAlphaBlending' modules/php4/libphp4.a(gd.o): In function `zif_imagecolorresolvealpha': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1bd1): undefined reference to `gdImageColorResolveAlpha' modules/php4/libphp4.a(gd.o): In function `zif_imagecolorclosestalpha': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x1e61): undefined reference to `gdImageColorClosestAlpha' modules/php4/libphp4.a(gd.o): In function `zif_imagecolorexactalpha': /usr/tmp/www/php-4.2.0/ext/gd/gd.c(.text+0x20f1): undefined reference to `gdImageColorExactAlpha' modules/php4/libphp4.a(gd.o): In function `zif_imagecopyresampled': /usr/tmp/www/php-4.2.0/ext/gd/gd.c:882: undefined reference to `gdImageCopyResampled' *** Error code 1 Stop in /usr/tmp/www/apache_1.3.24/src. *** Error code 1 Stop in /usr/tmp/www/apache_1.3.24. *** Error code 1 Stop in /usr/tmp/www/apache_1.3.24. Any ideas? It worked good before I installed t1lib and messed around with it. Thanks in advance, Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can anyone help me save img from URL?
Hi, I was wondering if someone knows how to save the image from the given url http://domain.com/image.gif into a file on a local machine Any suggestion will be greatly appreciated. Thank you in advance Victor Polyushko
Re: [PHP] Can anyone help me save img from URL?
Hi Guys, Thank you fo your input. I am sorry I am new to the list so + English is not my first language :-( anyhow., I shoudl 've made my question more clear. I am trying to save the image from the given URL (http://domain.com/image.gif) running a PHP script on the page. I have tried fread() and it does not allow me to accomplish that :-(( Have you guys ever come across such a problem? Again thank you very much for your suggestions Best Regards, Victor Polyushko - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Miguel Cruz [EMAIL PROTECTED] Cc: Victor Polyushko [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, May 16, 2002 2:01 PM Subject: Re: [PHP] Can anyone help me save img from URL? Miguel Cruz wrote: On Thu, 16 May 2002, Victor Polyushko wrote: I was wondering if someone knows how to save the image from the given url http://domain.com/image.gif into a file on a local machine lynx -source -dump image.gif If there were actually an image I'd use: wget http://domain.com/image.gif Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Done w/ PHP - VB or C# ?
Does anyone know if there is any global reliable and free :-) statistics on usage of PHP vs ASP. I am having the same dilemma., do I need to stick to going deeply into PHP (which in my opinion rulez!!) or start paying more attention to ASP... Best Regards, Victor Polyushko - Original Message - From: Peter [EMAIL PROTECTED] To: Php [EMAIL PROTECTED] Sent: Thursday, May 16, 2002 4:52 PM Subject: FW: [PHP] Done w/ PHP - VB or C# ? For me personally I find working with ASP .NET to be a pain in the butt, yeah sure you can to use all the fancy GUI's that can take care of some code for you etc.. but then there's the argument about php and having to write the code your self. Personally I find that a better approach as for me it's all about learning and achieving because at the end of the day you can sit back and look at it and go wow I did that from scratch from line 1 of code etc. Basically it all comes down to personal preference. I'm coming from a back ground which doesn't include much programming at all (which can be seen by some of the dumb q's i've posted in here...) and I guess that using something with a prodominately (think that's how it's spelt) gui workings and that takes care of alot of code for me should be more appealing but it's not any way basically YOU have to decide what's best for you and that your happy with the choices that you've made as in the end it's you that's got to live with them. that's my 2 cents Peter -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Thursday, 16 May 2002 7:03 AM To: [EMAIL PROTECTED] Subject: [PHP] Done w/ PHP - VB or C# ? I know I'll get mauled big-time on this mailing list but I'm thinking about putting PHP on hold for a while and learning ASP.NET I love PHP and open-source computing but if one wants to get a job in web development, you'll have a much better time find a job with both PHP and ASP (among others) skills. I'm going to hop on the ASP bandwagon but I'm not sure if I should first learn ASP w/ VB or w/ C# Any thoughts on this? What are the pros and cons of both? Thanks! -- 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] Can anyone help me save img from URL?
BINGO!! thank you guys for your input I used a very simple command to accomplish that and it works!! ? $command=wget http://domain.com/images/somepic.gif;; system( $command, $result); echo $result; ? Victor Polyushko - Original Message - From: Robert Cummings [EMAIL PROTECTED] To: Victor Polyushko [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, May 16, 2002 2:25 PM Subject: Re: [PHP] Can anyone help me save img from URL? Victor Polyushko wrote: Hi Guys, Thank you fo your input. I am sorry I am new to the list so + English is not my first language :-( anyhow., I shoudl 've made my question more clear. I am trying to save the image from the given URL (http://domain.com/image.gif) running a PHP script on the page. I have tried fread() and it does not allow me to accomplish that :-(( Have you guys ever come across such a problem? $imageData = implode( '', file( 'http://domain.com/image.gif' ) ); $length = strlen( $imageData ); if( $length 0 ) { if( (fh = fopen( 'destination', 'w' )) ) { fwrite( fh, $imageData ); } } Cheers, Rob. -- .-. | Robert Cummings | :-`. | Webdeployer - Chief PHP and Java Programmer | :--: | Mail : mailto:[EMAIL PROTECTED] | | Phone : (613) 731-4046 x.109 | :--: | Website : http://www.webmotion.com | | Fax : (613) 260-9545 | `--' -- 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] Done w/ PHP - VB or C# ?
hmm.. good question, I guess number of active job openings will be the best measure :-)) (or websites using PHP vs ASP) - Original Message - From: Miguel Cruz [EMAIL PROTECTED] To: Victor Polyushko [EMAIL PROTECTED] Cc: Php [EMAIL PROTECTED] Sent: Thursday, May 16, 2002 5:11 PM Subject: Re: [PHP] Done w/ PHP - VB or C# ? On Thu, 16 May 2002, Victor Polyushko wrote: Does anyone know if there is any global reliable and free :-) statistics on usage of PHP vs ASP. I am having the same dilemma., do I need to stick to going deeply into PHP (which in my opinion rulez!!) or start paying more attention to ASP... I think it's pretty hard to measure usage... what would a meaningful metric be? Number of servers with ASP available? Number of virtual hosts? Number of page views served by ASP vs PHP? Number of active developers? miguel -- 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] Validating forms and showing errors
Hi everybody, This might be a RTFM or STFW-question, but I haven't found it. I want to validate a form (in page1.php) to check if the user has entered a correct email-adress and more, and if he needs to correct some fields, I'd like to display the form again with all correct values filled in and the incorrect fields hightlighted. To make it a bit more difficult I've decided to POST to another file (post.php) which validates the information and redirects the user (with Header - Location) to page1.php if he has to correct the errors. If the form is correctly filled in then he will be redirected to page2.php. This is to prevent the browser for asking him if he wants to repost data if he hits 'Refresh'. Now I want to know how to pass information from post.php to page1.php since the form page (page1) needs to know what was incorrect and what was correct so that it can hightlight the bad fields. I don't want to stick it in the URL since it would be too ugly, but I do have session variables I can stick them in. Is this the way to go? Or is there a better solution? I guess many of you have fought with this before so I know you can help me ;) Thanks in advance, Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Detect if javascript is enabled
Hi, Does anyone know a simple trick to get PHP detect if the user's browser has javascript enabled? -- Olé -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-DB] .htpasswd?
James Smith wrote: Is there a way that when a user signs up for a user/pass on a site, to automatically update the .htpasswd on the site? Right now I'm running a Win2k Pro, with Apache installed and MySQL/PHP. Thanks, James The quite simpliest method is to put appropriate directives in a .htaccess file in appropriate (e.g. to be protected) directories like this: AuthName "Restricted Area" AuthUserFile /www/users/users AuthGroupFile /www/users/groups AuthType Basic Require registeredusers Then all you have to do is to regenerate the user and the group file according to your needs. Another way to do this directly with MySQL is to use the apache auth_mysql module which allows you to store authentication data in a MySQL DB. See http://mysql.com/downloads/contrib.html and http://httpd.apache.org/docs/misc/FAQ-G.html for more info. HTH Victor -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] FORM input type=image ... with a posting value
"Johnson, Kirk" wrote: Oops. You do need the type=image and src= attributes, instead of what I wrote in the example. Good thing it's Friday :) -Original Message- From: Johnson, Kirk Sent: Friday, April 06, 2001 1:29 PM To: [EMAIL PROTECTED] Subject: RE: [PHP] FORM input type=image ... with a posting value Yes, but you no longer check the value of "value" to determine which button was clicked. Instead, give each button a unique *name* attribute, then check if $name_x is set. The browser returns the x,y coordinates of the point where the user clicks the button, in variables named name_x and name_y. To create unique name for many input type=image ... elements you can use array FORM method=post ... input type=image name=images[1] ... input type=image name=images[2] ... input type=image name=images[3] ... /FORM and so on. When you submit this form the $images array will be set and sizeof($images) == 1. -- CU, Victor Gamov -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] nested objects
Thanks that fixed it. That was so simple no wonder I was banging my head on the wall :-). - Original Message - From: Cesar D. Rodas [EMAIL PROTECTED] To: Victor Matherly [EMAIL PROTECTED] Sent: Friday, December 7, 2007 2:37:23 PM (GMT-0500) America/New_York Subject: Re: [PHP] nested objects Hello I hope this help you! On 07/12/2007, Victor Matherly [EMAIL PROTECTED] wrote: Hello list, I want to create a new object and nest the objects variable in an array of another object. I think I am going about it the correct way but the variable is not being stored or retrieved correctly from the main function. I can't figure out what I am doing wrong. Can anyone help? Here is an example of what I am trying to do: ?php $html = table border='1' \n; $row = new htmlTableRow(); $cell1 = new htmlTableCell(); $cell1-setContent(test1); $cell1-setName(Left test); $row-AddCell($cell1); $cell2 = new htmlTableCell(); $cell2-setContent(test2); $cell2-setName(right test); $row-AddCell($cell2); $html .= $row-buildRow(); $html .= table\n; print HERE html body $html /body /html HERE; class htmlTableRow { var $class; var $cell_arr; var $the_row; function htmlTableRow(){ $this-cell_arr = array(); }//end construct function AddCell($cell) { $this-cell_arr = $cell; $this-cell_arr[] = $cell; } function buildRow(){ $temp = tr\n; foreach($this-cell_arr as $rowdata){ $temp .= \ttd . $rowdata-cell_content . /td\n; }//end foreach $temp .= /tr\n; return $temp; }//end build row funtion }// end htmlTableRow class class htmlTableCell { var $cell_width; var $cell_height; var $cell_colspan; var $cell_rowspan; var $css_class; var $cell_content; var $cell_name; function __construct($content = nbsp;){ $this-cell_content = $content; }// end construct function setContent($content){ $this-cell_content = $content; }//end setContent function function setName($name){ $this-cell_name = $name; }//end setContent function function getContent(){ return $this-cell_content; }//end setContent function } //end TableCell class ? Best regards Victor J. Matherly Technical Services Wave Communications, Inc http://www.wave-communications.com -- PHP General Mailing List ( http://www.php.net/ ) To unsubscribe, visit: http://www.php.net/unsub.php -- Cesar D. Rodas http://www.cesarodas.com http://www.thyphp.com http://www.phpajax.org Phone: +595-961-974165 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] nested objects
Actually it is academic intro to OO programing, the overkill html was just helping me understand the concept. Now I can put it to good use :-). - Original Message - From: Jochem Maas [EMAIL PROTECTED] To: Victor Matherly [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Friday, December 7, 2007 10:20:47 PM (GMT-0500) America/New_York Subject: Re: [PHP] nested objects Victor Matherly wrote: Hello list, I want to create a new object and nest the objects variable in an array of another object. I think I am going about it the correct way I think you are trying to swat a fly with a nuclear missle. in practice abstracting an HTML table into a big collection of objects is total overkill (although it might make an interesting accademic introduction into OO coding) ... class htmlTableCell { var $cell_width; var $cell_height; var $cell_colspan; var $cell_rowspan; var $css_class; var $cell_content; var $cell_name; function __construct($content = nbsp;){ $this-cell_content = $content; }// end construct function setContent($content){ $this-cell_content = $content; }//end setContent function function setName($name){ $this-cell_name = $name; }//end setContent function function getContent(){ return $this-cell_content; }//end setContent function } //end TableCell class ? Victor J. Matherly Technical Services Wave Communications, Inc http://www.wave-communications.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] nested objects
Hello list, I want to create a new object and nest the objects variable in an array of another object. I think I am going about it the correct way but the variable is not being stored or retrieved correctly from the main function. I can't figure out what I am doing wrong. Can anyone help? Here is an example of what I am trying to do: ?php $html = table border='1' \n; $row = new htmlTableRow(); $cell1 = new htmlTableCell(); $cell1-setContent(test1); $cell1-setName(Left test); $row-AddCell($cell1); $cell2 = new htmlTableCell(); $cell2-setContent(test2); $cell2-setName(right test); $row-AddCell($cell2); $html .= $row-buildRow(); $html .= table\n; print HERE html body $html /body /html HERE; class htmlTableRow { var $class; var $cell_arr; var $the_row; function htmlTableRow(){ $this-cell_arr = array(); }//end construct function AddCell($cell) { $this-cell_arr = $cell; } function buildRow(){ $temp = tr\n; foreach($this-cell_arr as $rowdata){ $temp .= \ttd . $rowdata-cell_content . /td\n; }//end foreach $temp .= /tr\n; return $temp; }//end build row funtion }// end htmlTableRow class class htmlTableCell { var $cell_width; var $cell_height; var $cell_colspan; var $cell_rowspan; var $css_class; var $cell_content; var $cell_name; function __construct($content = nbsp;){ $this-cell_content = $content; }// end construct function setContent($content){ $this-cell_content = $content; }//end setContent function function setName($name){ $this-cell_name = $name; }//end setContent function function getContent(){ return $this-cell_content; }//end setContent function } //end TableCell class ? Victor J. Matherly Technical Services Wave Communications, Inc http://www.wave-communications.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Session timeout
You could always just set you own cookie that expires after 10 min. Have your script redirect to a login page if the cookie has expired or reset the cookie if its still valid. - Original Message - From: Dani Castaños [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Thursday, December 13, 2007 7:36:06 AM (GMT-0500) America/New_York Subject: [PHP] Session timeout Hi all! I've read a bit about PHP session timeout. Is it configurable?? I mean, If i want user logged out after 10 minutes of innactivity... where i can to set it up?? Is it possible to expire session configuring php.ini. I know i will have to write code to do whatever when the session expires... Thank you in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Victor J. Matherly Technical Services Wave Communications, Inc http://www.wave-communications.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php5 built-in soap - apache performance wsdl generation
Hello, I'm successfully playing with php 5 and Its built-in soap but I still have a couple of questions. The most important one is regarding the performance. It is something I also found using php 4 and nusoap. Most of the time for a call is being spend on loading the code. Aprox 0.25 sec per code line. This could be a problem if you have a lot of code for your server. Why Apache is loading all the code for each call? Is It possible to configure Apache to load the Soap Server just once? Second one is regarding wsdl generation. I unsuccessfully tried to find a tool to do it. I gave a try to Webservice Helper (jool.nl) and I didn't find the result convenient for my purpose. Is there any simple and useful tool to automatic generate the wsdl? I finally did it manually from scratch. Thank you very much in advance. Kind regards, Victor.
[PHP] how to install phpize and php-config?
Hi, I'm afraid I'm not sure about how to install phpize and php-config. I used to install php using rpms, but this time I downloaded php5 from php.net and configure it with the following options: ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --enable-soap The installation runs fine but phpize and php-config are required to install eaccelerator and now I don't know if I should add the pear module to the above line or It should be done another way. locate phpize returns: /usr/src/php-5.0.4/scripts/phpize.m4 /usr/src/php-5.0.4/scripts/phpize.in /usr/src/php-5.0.4/scripts/phpize locate php-config returns: /usr/src/php-5.0.4/scripts/php-config.in /usr/src/php-5.0.4/scripts/php-config but I don't have the executables in /usr/local/bin, as usual. What should I do? What about php from the command line? What can I do to install the usual /usr/local/bin/php? Thanks in advance, Victor.
[PHP] wsdl cache?
Hello, I am experiencing a lot of difficulties working with Apache 5.0.4 and wsdl. I can publish a wsdl and work with it, but as soon as I want to add a new method to the wsdl, I have to change the directory to be able to use it. In some way, Apache kept the information for the wsdl and I am not able to update it! Could anybody explain me why and how could I avoid this problem? Thanks. Kind Regards, Victor.
Re: [PHP] My first post
Thank you a lot! That is exactly what i was looking for. -- == Victor J. Espina S. Gerente de Desarrollo / Software Development Manager Software de Venezuela, S.A. Caracas, Venezuela Email: [EMAIL PROTECTED] Personal site: http://victorespina.coolfreepages.com MSN: [EMAIL PROTECTED] == (Elimine 'nospam' en las direcciones email) (Remove 'nospam' in email and MSN address) == Tom Rogers [EMAIL PROTECTED] escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Tuesday, December 3, 2002, 7:37:20 AM, you wrote: VE Hi. VE I'm new in PHP. Could you point me where can i download a sample script VE about how can i paginate some results? VE TIA Here is a class that will create a google like pagination of results if that is what you are after :) ? class page_class { var $count = 0; //total pages var $start = 0; //starting record var $pages = 0; //number of pages available var $page = 1; //current page var $maxpages; //shows up to 2 * this number and makes a sliding scale var $show; //number of results per page function page_class($count=0,$show=5,$max=9){ $this-count = $count; $this-show = $show; $this-maxpages = $max; ($this-count % $this-show == 0)? $this-pages = intval($this-count/$this-show) :$this-pages intval($this-count/$this-show) +1; if(!empty($_GET['search_page'])){ $this-page = $_GET['search_page']; $this-start = $this-show * $this-page - $this-show; } } function get_limit(){ $limit = ''; if($this-count $this-show) $limit = 'LIMIT'.$this-start.','.$this-show; return $limit; } function make_head_string($pre){ $r = $pre.' '; $end = $this-start + $this-show; if($end $this-count) $end = $this-count; $r .= ($this-start +1).' - '.$end.' of '.$this-count; return $r; } function make_page_string($words,$pre='Result Page:'){ $r = $pre.' '; if($this-page 1){ $y = $this-page - 1; $r .= 'a href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Previous/anbsp; '; } $end = $this-page + $this-maxpages-1; if($end $this-pages) $end = $this-pages; $x = $this-page - $this-maxpages; $anchor = $this-pages - (2*$this-maxpages) +1; if($anchor 1) $anchor = 1; if($x 1) $x = 1; if($x $anchor) $x = $anchor; while($x = $end){ if($x == $this-page){ $r .= 'span class=s'.$x.'/spannbsp;'; } else{ $r.= 'a href='.$_SERVER['PHP_SELF'].'?search_page='.$x.$words.''.$x.'/anbsp;'; } $x++; } if($this-page $this-pages){ $y = $this-page + 1; $r .= 'a href='.$_SERVER['PHP_SELF'].'?search_page='.$y.$words.'Next/anbsp;'; } return $r; } } //Usage mysql_connect(**.**.**.**, **, ) or die (mysql_error()); $Query = SELECT COUNT(*) AS cnt FROM tabletosearch WHERE fieldtosearch LIKE '% .$searchword. %'; $query = mysql_query($Query) or die(mysql_error()); $row = mysql_fetch_array($result); $count = $row['cnt']; if($count 0){ //start class total number of results,number of results to show,max number of pages on a sliding scale (ends up as 2x this number..ie 20) $page = new page_class($count,5,10); $limit = $page-get_limit(); $Query2= SELECT * FROM tabletosearch WHERE fieldtosearch LIKE '% .$searchword. %' ORDER BY whatever ASC .$limit; $result = mysql_query($Query2) or die(mysql_error()); $hstring = $page-make_head_string('Results'); $pstring = $page-make_page_string(amp;searchword=.$searchword.amp;whatever=.$wha tever);//add the other variables to pass to next page in a similar fashion echo tabletrtd.$hstring./td/tr; while($row = mysql_fetch_array($result)){ echo trtd.$show_data_here./td/tr; } echo trtd.$pstring./td/tr/table; } ? Note: the search variables on subsequent pages will be passed by GET method -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] My first post
Thank you. I'm a VFP programmer (since 1989!) and have some time looking for a way to move to the Web world. I heard about PHP about 1 year ago, but was just a few months ago when i finally download it and started to look what is all about. And what i found was an incredible powerfull language, with a great OOP implementation, an elegant sintax, a lot of native functions and the mos important: REALLY FAST!! So, you can bet you will see me here a lot, bothering you with stupid questions! :-) -- == Victor J. Espina S. Gerente de Desarrollo / Software Development Manager Software de Venezuela, S.A. Caracas, Venezuela Email: [EMAIL PROTECTED] Personal site: http://victorespina.coolfreepages.com MSN: [EMAIL PROTECTED] == (Elimine 'nospam' en las direcciones email) (Remove 'nospam' in email and MSN address) == Dl Neil [EMAIL PROTECTED] escribió en el mensaje 0f6601c29aeb$2d3deba0$c900a8c0@jrbrown">news:0f6601c29aeb$2d3deba0$c900a8c0@jrbrown... Hi Victor, Welcome to the wonderful world of PHP! I'm new in PHP. Could you point me where can i download a sample script about how can i paginate some results? PHP essentially exists to output HTML. You cannot paginate in HTML (although there is some fancy CSS that could be employed). Sorry, =dn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with functions
Hi, I have de following code for example ?php $username = victor; function test() { echo $username; } ? If I call the funcion test(), echo print nothing what's is going on ? []´s [EMAIL PROTECTED] __ Victor Halla ICQ#: 114575440 Current ICQ status: + More ways to contact me __ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with functions
Thanks !!! Victor Tom Rogers [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Thursday, December 5, 2002, 9:15:53 AM, you wrote: VH Hi, VH I have de following code for example VH ?php VH $username = victor; VH function test() { VH echo $username; VH } ? VH If I call the funcion test(), echo print nothing what's is going on ? VH []´s VH [EMAIL PROTECTED] VH ______ Victor VH Halla ICQ#: 114575440 Current ICQ status: + More ways to contact me VH __ You need to tell the function to use the global variable like so: function test() { global $username; echo $username; } -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php