Re: [PHP] PHPS on apache2
on the way how can I make phps on IIS WHERE CAN I read ABOUT THIS ON MANUAL? - Original Message - From: FileCop [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, August 09, 2002 11:25 PM Subject: [PHP] PHPS on apache2 Hi! I have installed apache 2.0.39 and php 4.2.2 on a windows maschine (yes I know that sucks). I have added the AddType application/x-httpd-php-source .phps line to my httpd.conf file, but .phps does not work. I just attempts to download the file. phps was working when I used apache 1.3.24 and php 4.2.0/1, so I guess its a problem with apache2. Has anyone encountered the same problem or does anyone have a solution? Regards FileCop -- 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 Digest 11 Aug 2002 08:51:29 -0000 Issue 1518
php-general Digest 11 Aug 2002 08:51:29 - Issue 1518 Topics (messages 111971 through 112000): Re: Win PHP Editor... 111971 by: Glenn Sieb 111993 by: Liam MacKenzie Random mirrors and download quota 111972 by: Andrew Conner PHPS on apache2 111973 by: FileCop 111974 by: FileCop 111980 by: Analysis Solutions 112000 by: Alawi Cookie array 111975 by: Jan - CWIZO 111976 by: Lee Doolan 111988 by: Bob Lockie Re: Save ability... Duplicate DB entries 111977 by: Analysis Solutions 111986 by: JJ Harrison Re: PHP form port 111978 by: Analysis Solutions Re: Newbie question about UNIX command-line directives 111979 by: Analysis Solutions Re: records in db 111981 by: Analysis Solutions 111983 by: DL Neil 111995 by: Justin French Re: PHP Errors - someone please take a look 111982 by: Joni Järvinen 111998 by: Christopher J. Crane limit the number of users: query syntax? 111984 by: Øystein Håland Re: show_source() 111985 by: Øystein Håland Re: cgi error 111987 by: Bob Lockie Converting datestamp to text? 111989 by: Kristoffer Strom 111990 by: David Freeman Tried that.. 111991 by: Kristoffer Strom 111992 by: Rasmus Lerdorf 111994 by: David Freeman Re: is this possible ... 111996 by: Justin French Access Violations with PHP Please Help Please 111997 by: Christopher J. Crane Re: Can't find my font file - Please help 111999 by: Rasmus Lerdorf Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- My favorite win-editor is UltraEdit (http://www.idmcomp.com) Also does nice color-tagging, and is very user-customizable that way! Glenn At 03:02 PM 8/10/2002 -0400, Randy Johnson posted the following... I noticed they have not come out with a new version in quite a long time and do not answer their emails? anybody else heard about any future releases of editplus? --- The original portions of this message are the copyright of the author (c)1998-2002 Glenn E. Sieb.ICQ UIN: 300395IRC Nick: Rainbear All acts of Love and Pleasure are Her rituals-Charge of the Goddess ---End Message--- ---BeginMessage--- No, sorry. I will try to contact them soon about that. But there's no bugs that I've come across in Editplus. Full of features too, but there's always room for imporvement. Cheers, Liam -Original Message- From: Randy Johnson [mailto:[EMAIL PROTECTED]] Sent: Sunday, 11 August 2002 5:03 AM To: Liam MacKenzie; Dave at Sinewaves.net; PHPlist Subject: Re: [PHP] Win PHP Editor... I noticed they have not come out with a new version in quite a long time and do not answer their emails? anybody else heard about any future releases of editplus? Randy - Original Message - From: Liam MacKenzie [EMAIL PROTECTED] To: Dave at Sinewaves.net [EMAIL PROTECTED]; PHPlist [EMAIL PROTECTED] Sent: Friday, August 09, 2002 9:38 PM Subject: Re: [PHP] Win PHP Editor... Well, I still believe the best editor for windows is Editplus (www.editplus.com) Small, fast, stable, tonnes of features and it supports a lot of file type. If it doesn't give you colour coding for a particular language, say Cold Fusion, go to the homepage and download the plugin. It's only 800K to download, give it a shot. It's uninstall program actually gets rid of it aswell, completely. so if you don't like it, no sweat :-P Just my 2 cents... Liam - Original Message - From: Dave at Sinewaves.net [EMAIL PROTECTED] To: PHPlist [EMAIL PROTECTED] Sent: Saturday, August 10, 2002 3:42 AM Subject: [PHP] Win PHP Editor... Just have to add one little fine piece of free software that nobody's mentioned yet, Crimson Editor (http://www.crimsoneditor.com ) No code completion, but it's got every other feature of the big commercial beasts... definitely check it out - I just switched over, and it's great. From the site: -- Edit multiple documents - switch between documents using file selection tab - pressing Ctrl+Tab brings the last accessed document to top Syntax highlighting - configurable via custom syntax files - preconfigured for more than 50 computer languages Multi-level undo / redo - all editing actions are recorded from the opening of a file - unlimited undo and redo buffers Find Replace - replace specified text one by one, or as a whole - support regular expression Natural word wrapping - word wrapping does not affect syntax highlighting - configurable wrapping indentation (easer to understand the syntax) Spell checker
[PHP] need help
I am newbie in php scripting, I am used to using asp scripting I get the result of my page but with no error message But Operator like * , + , or / the result is not valid result Variable $rat on my page its not work . My database sample ___ Id gid kabupaten etc.. - 10x x 21x x 30etc 41 52 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN ?php require('pagedresults.php'); $user=root; $host=localhost; $password=; $db=test; $cnx = mysql_connect($host,$user,$password); if(!$cnx) echo ndak nyambung; $jadi=mysql_select_db($db,$cnx); $sqlcombo = select distinct material from distribusi; $hasil = mysql_query($sqlcombo); $x=1; $rs = new MySQLPagedResultSet(Select * from distribusi where material like '%$cari%' or kabupaten like '%$cari%' or jumlahpend like '%$cari%' or produksi like '%$cari%' or kebutuhan like '%$cari%' order by kabupaten,8,$cnx); ? html head title /title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#2A508F center ?php while ($row = $rs-fetchArray()): if($row['gid']=0) { $rat = 110;// from this operator displayed with not valid result } elseif($row['gid']=1) { $rat = 9.5; // from this operator displayed with not valid result } else { $rat = 6.6; // from this operator displayed with not valid result } ? tr bgcolor=white td align=center bgcolor=whitea href=confdelete.php?id=?=$row['id']?img src=images/del_topic.gif border=0 alt=Delete This Field/a/td td align=center bgcolor=whitea href=edit-distribusi.php?id=?=$row['id']?img src=images/edit.gif border=0 alt=Edit This Field/a/td td align=center bgcolor=whitefont color=black face=verdana size=1px?=$x++?/font/td td align=center bgcolor=whitefont color=black face=verdana size=1px?= $row['material']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$row['kabupaten']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$row['jumlahpend']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$row['produksi']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$kebutuhannye =((($row['jumlahpend'])* $rat ) / 1000 );?/font/td - here I print , I get an error value td bgcolor=whitefont color=black face=verdana size=1px?=$rationye = ($row['produksi']/$kebutuhannye)?/font/td /tr ?php endwhile; ? tr bgcolor=white td colspan=9 align=right bgcolor=whitea href=add-data.phpimg src=images/add.gif border=0 alt=Add Data/a/td /tr /table p font color=white face=verdana size=1?=$rs-getPageNav(id=$id)?/font/p div align=left /div /center /body /html
[PHP] Advice
Hello all, I need some advice on which version of PHP server to go with, as I am completely new to PHP. The website I am doing research for would need to be able to access a database in order to make the site interactive. Similar to the Microsoft Knowledge base at MSDN but for something totally different. Also the site would need to be able to process orders possibly with in built secure facilities that can process credit card numbers. I may outsource that side of the project but if I do it needs to seamlessly integrate with the website I am developing. Later I may need Java servelets as well so the server is going to have to be able to allow me to install support for them or have that already built in. Is PHP 4 established enough to develop this kind of project or should I look at PHP 3 instead? Any advice on a good server that would enable the points I suggested? Thanks. Steve Jackson Phone +358503435159 Email [EMAIL PROTECTED] Web http://www.webpage.co.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Advice
PHP releases a stable version (currently 4.2.2) which is suitable and stable for a production environment. My advice would ALLWAYS be to install the latest stable version. If you install an earlier version, or PHP3, you will always be missing out on something (eg PHP3 doesn't have sessions). Personally I'd install on *nix with the latest stable version of Apache and MySQL (not = 4), and compile PHP with the mcrypt options for encrypting cc's, the enable_trans_sid option to make sessions a little easier, and a few other goodies. Of course you can recompile whenever you like. Note: I've never done anything with Java servelets, so I can't answer you on that stuff. Justin French on 11/08/02 7:23 PM, Steve Jackson ([EMAIL PROTECTED]) wrote: Hello all, I need some advice on which version of PHP server to go with, as I am completely new to PHP. The website I am doing research for would need to be able to access a database in order to make the site interactive. Similar to the Microsoft Knowledge base at MSDN but for something totally different. Also the site would need to be able to process orders possibly with in built secure facilities that can process credit card numbers. I may outsource that side of the project but if I do it needs to seamlessly integrate with the website I am developing. Later I may need Java servelets as well so the server is going to have to be able to allow me to install support for them or have that already built in. Is PHP 4 established enough to develop this kind of project or should I look at PHP 3 instead? Any advice on a good server that would enable the points I suggested? Thanks. Steve Jackson Phone +358503435159 Email [EMAIL PROTECTED] Web http://www.webpage.co.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IP and Language
Hello, I'd like to know if it's possible to redirect a visitor of my website to the page index.php if he comes from Belgium, France, Luxembourg, Switzerland and all the others redirect to index_uk.php Possible ? Thanks, Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing an array in a link
Hi, all -- I collect field keys in an array that looks like $keylist = array('comment','job','spaced out key name','foo',...) ; and would like to pass the array to myself in a call like print a href=\/myscript.php?keylist=$keylist\link/a ; but when it's actually run it of course says ...keylist=Array... which is quite bad. I'd use a simple scalar $keylist = comment job spaced out key name foo ... ; but, of course, those darned fields which have spaces embedded in the names will really mess that up. How can I pass myself an array -- and recognize it on the receiving end? TIA HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg74956/pgp0.pgp Description: PGP signature
Re: [PHP] passing an array in a link
print a href=\/myscript.php?keylist=.str_replace( ,+,implode(+,$keylist)).\link/a ; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing an array in a link
Bas, et al -- ...and then Bas Jobsen said... % % print a href=\/myscript.php?keylist=.str_replace( % ,+,implode(+,$keylist)).\link/a ; I tried this and my link the looks like Click a href=testme.php?a+b b b+chere/a to go round againbr (that is, not only have I not taken care of the spaces but I now also lose the fact that these are part of $keylist). The entire little script is attached. You can see various means of printing the array. I *have* found that I can construct a link like testme.php?keylist[]=akeylist[]=b ... so that takes care of walking the array but now I need to protect myself from the spaces. I've looked at htmlentities() but it doesn't seem to convert spaces... Thanks again HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! html head title Test page /title /head body ?php if ( ! $keylist ) { print No \$keylist; starting from scratchbr\n ; #$keylist = array('a','b','c') ;# works (of course) #$keylist = array('a','b%20b%20b','c') ;# works; is 'b b b' on 2nd pass $keylist = array('a','b b b','c') ; # doesn't work; spaces are bad print \$keylist is $keylistbr\n ; foreach ($keylist as $k) { print \$k is .$k.br\n ; } #print Click a href=\/testme.php?keylist=$keylist\here/a to go round againbr\n ; print Click a href=\testme.php? ; #foreach ( $keylist as $k ) { print keylist[]=$k ; } print str_replace(,+,implode(+,$keylist)) ; print \here/a to go round againbr\n ; } else { print I have a \$keylist. It is .$keylist.br\n ; foreach ( $keylist as $k ) { print \$k is .$k.br\n ; } } print br\nbr\n ; ? /body /html msg74958/pgp0.pgp Description: PGP signature
[PHP] problem solving
HI all, I have the following tables: artist id,name songs id,artist_id,title,writers cds id, title songs_to_cds cd_id, song_id, track_no The idea being that since a song can appear on more than one CD by a given artist, the table songs_to_cds relates them. Anyhoo, on the form where the user enters in a new CD, I'm presenting 20 select boxes with all songs related to the current artist. In the case of 1 artist, they have 120+ songs. Needless to say, 120 songs x an average of maybe 30 characters in the title x 20 drop-down selects with all the HTML code around them == one really overweight HTML page -- 100k currently!!! In the case of a user having to enter in all the tracks for 60 CDs, we're talking about a lot of waiting around for pages to come down the modem and render. I guess what i'm after is some suggestions on how I can allow a user to relate up to 20 songs IN TRACK# ORDER to a CD via a HTML page... Any suggestions welcome :) Justin French -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] script parsing in img src tag
Why doesn't parse my computer php scripts in img src tags? echo img border=\0\ src=\include/thumb.inc.php?pic=.$file.zoom=25ext=jpg\ Always when I call the page where the image resides there is no image, but the full URL to the script with parsed vars like this: img border=0 src=include/thumb.inc.php?pic=images/tennis/ls080501stg.jpgzoom=25ext=jpg Please help me. Sascha PS.:I try to get an image to thumb library working. I Did put the script in the Attachment.
[PHP] subtracting 2 time strings
Help! I can't find reference to it in the manuals but I need to subtract to time strings. ex: time_in = 11:00 time_out = 13:45 job_time = 2:45 I have stored these times into mysql as a TIME type column (yeh... I know really dumb - but to much data at this point to loose). Does anyone have any thoughts on how I could do this? Thanks, -Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Posting news via php
Sorry for reposting, but I am still having this problem and the post is back to far that someone looks at it. Thank you for any help on this. I appreciate it. Andy Hi there, I am trying to write a script which is posting news to a newsserver. Unfortunatelly I do get a 535 error back which is not reported in: http://www.faqs.org/rfcs/rfc977.html Section 3.10.2 Maybe someone of you guys has a clue of an idea what is going wrong. connecting works, so I did not include the connect code. The code for posting is underneath. Thanx for any help on that. Andy $cfgServer= news.php.net; $cfgNewsGroup= php.general; $subject='Test'; $header=' Newsgroups: '.$cfgNewsGroup.' Path: '.$cfgServer.' Relay-Version: version B 2.10 2/13/83; site cbosgd.UUCP Posting-Version: version B 2.10 2/13/83; site eagle.UUCP From: [EMAIL PROTECTED] (Jerry Schwarz) Subject: '.$subject.' Message-ID: [EMAIL PROTECTED] Date: Friday, 10-Aug-2002 16:14:55 EST Followup-To: '.$cfgNewsGroup.' Expires: Saturday, 1-Jan-2003 00:00:00 EST Date-Received: Friday, 10-Aug-2002 16:59:30 EST Organization: Bell Labs, Murray Hill '; $body='\n This is a test. '; $message=$header.$body; $put = fputs($usenet_handle, POST $message\n); echo $put; -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: IP and Language
It's going to be difficult to detech 'where' the user is coming from but you can find out what their default language is. I think it's one of the sever variables. If you are using Apache though, there is an autoselection feature which allows you to have several copies of your pages in different languages e.g. you can have index.php.en, index.php.de, index.php.be etc and Apache automatically chooses the right one based on the user's language settings. In httpd.conf you can specify the priority order for each language which is used if a user can read more than one language and if there isn't an appropriate language available, Apache can ask the user to choose which one they require. You can change your default language in IE by going to tools internet options and click on languages. For a good example go to www.google.com. Then change to another language and go to www.google.com again and hopefully the google page will be in another language. Unfortunately I don't know the language codes for Klingon or Elmer Fudd (http://services.google.com/tcbin/tc.py?cmd=status) Christian Ista [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I'd like to know if it's possible to redirect a visitor of my website to the page index.php if he comes from Belgium, France, Luxembourg, Switzerland and all the others redirect to index_uk.php Possible ? Thanks, Christian, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing an array in a form element
Hi again -- ...and then David T-G said... % ... % How can I pass myself an array -- and recognize it on the receiving end? I had been spending all of my time digging into htmlentities() and the like when, in fact, all I had to do was a simple preg_replace on each component :-) Now how can I pass an array as a form element? The trick, it seems, will be recognizing all of the keys unless I can have a form element that has them all stretched out... TIA HAND :-D -- David T-G * It's easier to fight for one's principles (play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie (work) [EMAIL PROTECTED] http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg74965/pgp0.pgp Description: PGP signature
Re: [PHP] subtracting 2 time strings
From: Christopher Molnar [EMAIL PROTECTED] Sent: Saturday, August 10, 2002 11:37 AM Subject: [PHP] subtracting 2 time strings Help! I can't find reference to it in the manuals but I need to subtract to time strings. ex: time_in = 11:00 time_out = 13:45 job_time = 2:45 Something like: ?php $time_in = 11:00; $time_out = 13:45 ; $start = strtotime($time_in); $finish = strtotime($time_out); $elapsed = $finish - $start; echo 'Elapsed time was ' . gmdate('H:i:s',$elapsed) . br\n; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] records in db
// untested $data = mysql_fetch_array(mysql_query(SELECT count(answer_col) as total FROM answers_table WHERE answer_col='{$answer}')); echo $data[total]; Put this in a while/foreach statement Regards Chris Kay -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Sunday, 11 August 2002 12:09 PM To: Tyler Durdin; [EMAIL PROTECTED] Subject: Re: [PHP] records in db on 11/08/02 3:52 AM, Tyler Durdin ([EMAIL PROTECTED]) wrote: If I have a field in my DB that can have 4 different answers, lets say a,b,c and d. How can I count the number of each in that field. So if there are 4 a's 1 b 0 c's and 12 d's how can I get php to count this? I'm pretty certain there's a way to do this with just one MySQL query, but here's a PHP version that does 4 queries: ? // UNTESTED CODE $answers = array('a','b','c','d'); foreach($answers as $key = $answer) { $sql = SELECT * FROM answers_table WHERE answer_col='{$answer}'; $result = mysql_query($sql); if($result) { $count = mysql_num_rows($result); } else { $count = 0; } echo {$count} people selected answer {$answer}br /; } ? Should print out something like: 4 people selected answer a 1 people selected answer b 0 people selected answer c 12 people selected answer d hack it to suit your needs, Justin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: need help
to do a comparison between two values / variables, you have to use == instead of = = is an assignment while == is a comparison operator if($row['gid'] == 0) { $rat = 110; } elseif($row['gid'] == 1) { $rat = 9.5; } else { $rat = 6.6; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: need help
From: B.C. Lance [EMAIL PROTECTED] Sent: Sunday, August 11, 2002 9:53 AM Subject: [PHP] Re: need help to do a comparison between two values / variables, you have to use == instead of = = is an assignment while == is a comparison operator if($row['gid'] == 0) I write these this way so that the php parser nags me about it if I forget the other equal sign: if(0 == $row['gid']) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: passing an array in a link
you could try this: transmitting end: ?php foreach ($keylist as $key = $value) { $searchArg .= keylist[]=.htmlentities($value).; } ? a href=myphp.php??php echo $searchArg?array from search argument/a receiving end: foreach($_GET[keylist] as $key = $value) { echo {$value}br; } David T-G wrote: Hi, all -- I collect field keys in an array that looks like $keylist = array('comment','job','spaced out key name','foo',...) ; and would like to pass the array to myself in a call like print a href=\/myscript.php?keylist=$keylist\link/a ; but when it's actually run it of course says ...keylist=Array... which is quite bad. I'd use a simple scalar $keylist = comment job spaced out key name foo ... ; but, of course, those darned fields which have spaces embedded in the names will really mess that up. How can I pass myself an array -- and recognize it on the receiving end? TIA HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passing an array in a link
from my experience, you don't really have to worry much on the space issue. is the delimiter to determine that the string terminates and a new argument begins next. and very often, the browser will do an auto conversion from space to %20 when you click on the link. David T-G wrote: snip so that takes care of walking the array but now I need to protect myself from the spaces. I've looked at htmlentities() but it doesn't seem to convert spaces... /snip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: need help
From: B.C. Lance [EMAIL PROTECTED] Sent: Sunday, August 11, 2002 10:17 AM Subject: Re: [PHP] Re: need help snip Matt wrote: if(0 == $row['gid']) /snip ahhh. let the parser do the check. works great if you are not comparing with 2 variables :) in fact, another way to avoid this kinda pitfall, switch is another alternative. but of course, switch has its pitfall too. break ;) Yeah, it doesn't always work, but it adds to the reliablity of the code. In my code, it's more often used then not. It's hard to think that way though, as it's backwards logic, at least to me. I always think it first the other way ($val == constant), and type it backwards :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Good Damn
$Query = SELECT * FROM basket_db WHERE session_id = '$PHPSESSID'; $Result = mysql_query($Query, $connect); if ($Result) { while ($arrResult = mysql_fetch_array($Result, MYSQL_ASSOC)) { echo 'tr bgcolor=#fffdd7 class=text01'; echo 'td'.$arrResult['image_id'].'/td'; echo 'td'.$arrResult['name'].'/td'; echo 'tda class=text01 href='.$PHP_SELF.'?action=deleteid='.$arrResult['id'].'delete/a/td'; echo 'td Hier Preis'.$arrResult[''].'/td'; echo 'td hier gesamt'.$arrResult[''].'/td'; echo '/tr'; } } else { echo 'tr bgcolor=#fffdd7 class=text01'; echo 'td colspan=5There are no Artikles in Cart./td'; echo '/tr'; } This script is not doing what I want it too! Ich want to see : There are no Artikles in Cart when there are no Artikels in Cart But it good damn doesn't work! Please tell me why
[PHP] Problem with $PHP_SELF on PWS
Hello All, I have PHP installed on PWS running on a Windows 98SE m/c. When I invoke form action=action.php method=POST everything is fine and the form data is extracted correctly. When I try to embed the same script in the body of the form using form action=?php $PHP_SELF; ? method=POST I get HTTP Error 405 Method not allowed. The method specified in the request line is not allowed for the resource identified by the request. Please ensure that you have the proper MIME type set up for the resource you are requesting. I'm sorry if this is a newbie problem, but I can't for the life of me see what the difference is between having the method embedded or separate. Thanks in advance, John Brooks.
Re: [PHP] Good Damn
if ($Result) { if(mysql_num_rows($Result)0) Op zondag 11 augustus 2002 16:32, schreef Sascha Braun: $Query = SELECT * FROM basket_db WHERE session_id = '$PHPSESSID'; $Result = mysql_query($Query, $connect); if ($Result) { while ($arrResult = mysql_fetch_array($Result, MYSQL_ASSOC)) { echo 'tr bgcolor=#fffdd7 class=text01'; echo 'td'.$arrResult['image_id'].'/td'; echo 'td'.$arrResult['name'].'/td'; echo 'tda class=text01 href='.$PHP_SELF.'?action=deleteid='.$arrResult['id'].'delete/a/td' ; echo 'td Hier Preis'.$arrResult[''].'/td'; echo 'td hier gesamt'.$arrResult[''].'/td'; echo '/tr'; } } else { echo 'tr bgcolor=#fffdd7 class=text01'; echo 'td colspan=5There are no Artikles in Cart./td'; echo '/tr'; } This script is not doing what I want it too! Ich want to see : There are no Artikles in Cart when there are no Artikels in Cart But it good damn doesn't work! Please tell me why -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Good Damn
From: Sascha Braun [EMAIL PROTECTED] Sent: Sunday, August 11, 2002 10:32 AM Subject: [PHP] Good Damn $Query = SELECT * FROM basket_db WHERE session_id = '$PHPSESSID'; try: $Query = SELECT * FROM basket_db WHERE session_id = '$PHPSESSID' or die(mysql_error()); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with $PHP_SELF on PWS
form action=?php $PHP_SELF; ? form action=?=$PHP_SELF? or form action=?php echo $PHP_SELF; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with $PHP_SELF on PWS
From: John Brooks [EMAIL PROTECTED] Sent: Sunday, August 11, 2002 10:21 AM Subject: [PHP] Problem with $PHP_SELF on PWS I have PHP installed on PWS running on a Windows 98SE m/c. When I invoke form action=action.php method=POST everything is fine and the form data is extracted correctly. When I try to embed the same script in the body of the form using form action=?php $PHP_SELF; ? method=POST I get HTTP Error 405 Method not allowed. If you view source from the browser you'll see the action is empty. Use: form action=?php echo $_SERVER['PHP_SELF']; ? method=POST -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with echo
Op zondag 11 augustus 2002 16:42, schreef Kristoffer Strom: Got a problem when echo:ing a variable containing alot of text. When echoing it backslashes (\) every apostrophe (') and quote (). This I don't like. And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot of html tags that I want to keep intact. /Kris echo stripslaches($var); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with echo
From: Kristoffer Strom [EMAIL PROTECTED] Sent: Sunday, August 11, 2002 10:42 AM Subject: [PHP] Problem with echo Got a problem when echo:ing a variable containing alot of text. When echoing it backslashes (\) every apostrophe (') and quote (). This I don't like. And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot of html tags that I want to keep intact. Turn off magic_quotes_gpc in php.ini or .htaccess or use stripslashes() on the fields. The quotes are there for easy database updates/inserts but cause trouble if you have to re-echo the data out. If you insert these fields into a db, and have turned of magic_quotes_gpc, you'll need to use addslashes on each field. Otherwise you get new problems. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with echo
Works like a charm, thx /Kris Bas Jobsen [EMAIL PROTECTED] wrote in message 02081115573503.02483@bjobsen">news:02081115573503.02483@bjobsen... Op zondag 11 augustus 2002 16:42, schreef Kristoffer Strom: Got a problem when echo:ing a variable containing alot of text. When echoing it backslashes (\) every apostrophe (') and quote (). This I don't like. And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot of html tags that I want to keep intact. /Kris echo stripslaches($var); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] subtracting 2 time strings
Thanks! Worked perfectly! -Chris On Sunday, August 11, 2002, at 09:27 AM, Matt wrote: From: Christopher Molnar [EMAIL PROTECTED] Sent: Saturday, August 10, 2002 11:37 AM Subject: [PHP] subtracting 2 time strings Help! I can't find reference to it in the manuals but I need to subtract to time strings. ex: time_in = 11:00 time_out = 13:45 job_time = 2:45 Something like: ?php $time_in = 11:00; $time_out = 13:45 ; $start = strtotime($time_in); $finish = strtotime($time_out); $elapsed = $finish - $start; echo 'Elapsed time was ' . gmdate('H:i:s',$elapsed) . br\n; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pictures and sound in MySQL and access via PHP
On Sat, 10 Aug 2002, lallous wrote: I'm making a on-line dictionary. I use PHP and a MySQL Database. Now I want to add audio-streaming (MP3) and pictures (JPG) to the database and retrieve it true PHP. Can sombody help me out with a little If the files are not secret or for members only, you should better store them somewhere under your http document tree, and store *only* their filenames in the database, then you could provide a link to the file. I think this would be the faster. Or if you want to protect the files, you could place them outside your document tree, and then use fileread or something similar to read them. But I'd suggest you to keep only the filenames on the database, and store the files in the filesystem, it'd better for the performance and integrity of the files. Good luck. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] why true?
echo ('test'==0); gives 1 why? Thanks, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why true?
Because you are comparing a string to a number. PHP has to choose to either compare the two as strings or as numbers. The numerical value of the string 'test' is 0 which means it works out to 0 == 0 which is true. If you want to force a string comparison, you can use strcmp() or, if you want to force a comparison on both value and type, use === instead of == -Rasmus On Sun, 11 Aug 2002, Bas Jobsen wrote: echo ('test'==0); gives 1 why? Thanks, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Good Damn
you might wanna use this instead: $result = mysql; if (mysql_num_rows($result) { while } else { echo 'no articles'; } $result will always hold an int value if the query does not contain any error. so doing a num_rows on it will be more accurate in telling you if records are been retrieved. Sascha Braun wrote: $Query = SELECT * FROM basket_db WHERE session_id = '$PHPSESSID'; $Result = mysql_query($Query, $connect); if ($Result) { while ($arrResult = mysql_fetch_array($Result, MYSQL_ASSOC)) { echo 'tr bgcolor=#fffdd7 class=text01'; echo 'td'.$arrResult['image_id'].'/td'; echo 'td'.$arrResult['name'].'/td'; echo 'tda class=text01 href='.$PHP_SELF.'?action=deleteid='.$arrResult['id'].'delete/a/td'; echo 'td Hier Preis'.$arrResult[''].'/td'; echo 'td hier gesamt'.$arrResult[''].'/td'; echo '/tr'; } } else { echo 'tr bgcolor=#fffdd7 class=text01'; echo 'td colspan=5There are no Artikles in Cart./td'; echo '/tr'; } This script is not doing what I want it too! Ich want to see : There are no Artikles in Cart when there are no Artikels in Cart But it good damn doesn't work! Please tell me why -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cookie array
to store: setcookie (TestCookie[0], zero, time() + 3600); setcookie (TestCookie[1], one, time() + 3600); setcookie (TestCookie[2], two, time() + 3600); or setcookie (TestCookie[one], 1, time() + 3600); setcookie (TestCookie[two], 2, time() + 3600); setcookie (TestCookie[three], 3, time() + 3600); to retrieve: foreach($_COOKIE[TestCookie] as $key = $value) { echo {$value}br; } or echo $_COOKIE[TestCookie][one]; echo $_COOKIE[TestCookie][1]; Jan - Cwizo wrote: Hi ! How can I stoor array in to a cookie ? Do I just define an array and stoore it in a cookie ? How do I access the data in the array then ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question about UNIX command-line directives
Appreciate the feedback, but. The .htaccess approach appears to fit my situation best; but, I've not been able to get it to work. I have a folder with a php script and that folder has several sub-folders each with a small configuration script. I'd like the entry point to be a subfolder and main script [in the parent folder] to be symbolically executed. I'm familiar with the DirectorIndex and use it often, but only for defining the default file for the particular folder. Could I be doing something wrong? Or is there another htaccess directive that may work? Thanks. Analysis Solutions wrote: On Sat, Aug 10, 2002 at 01:12:38PM -0400, Al wrote: I'm on a virtual host without a shell account and need execute a UNIX command. ln -s ../afile.php index.php In a PHP script, you can do this -- if permissions are favorable: exec('ln -s ../afile.php index.php'); Is there some way to do this [e.g., with a htaccess file]? In an .htaccess file, you can put this DirectoryIndex afile.php What happens when you execute UNIX commands like the one above? Does it make a file, change the config? It makes a link in the file system. -s makes the link symbolic. http://www.tac.eu.org/cgi-bin/man-cgi?ln++NetBSD-current --Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Best way to read file
Hi all. I am using readfile() to read and print the entire content of a .txt file into a site, but need to use /p tags to break down the lines. I intend to be able, as an Administrator, to edit these text files later. What is the best way to accomplish this? Should I keep using readfile() or should I use any ther better way of doing this? Thanks in advance, Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie question about UNIX command-line directives
Does your AllowOverride include Indexes? If it doesn't, you can't put DirectoryIndex in a .htaccess. httpd -L is your friend. -Rasmus On Sun, 11 Aug 2002, Al wrote: Appreciate the feedback, but. The .htaccess approach appears to fit my situation best; but, I've not been able to get it to work. I have a folder with a php script and that folder has several sub-folders each with a small configuration script. I'd like the entry point to be a subfolder and main script [in the parent folder] to be symbolically executed. I'm familiar with the DirectorIndex and use it often, but only for defining the default file for the particular folder. Could I be doing something wrong? Or is there another htaccess directive that may work? Thanks. Analysis Solutions wrote: On Sat, Aug 10, 2002 at 01:12:38PM -0400, Al wrote: I'm on a virtual host without a shell account and need execute a UNIX command. ln -s ../afile.php index.php In a PHP script, you can do this -- if permissions are favorable: exec('ln -s ../afile.php index.php'); Is there some way to do this [e.g., with a htaccess file]? In an .htaccess file, you can put this DirectoryIndex afile.php What happens when you execute UNIX commands like the one above? Does it make a file, change the config? It makes a link in the file system. -s makes the link symbolic. http://www.tac.eu.org/cgi-bin/man-cgi?ln++NetBSD-current --Dan -- 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] Newbie question about UNIX command-line directives
On Sun, Aug 11, 2002 at 12:33:55PM -0400, Al wrote: The .htaccess approach appears to fit my situation best; but, I've not been able to get it to work. I wondered about the DirectoryIndex directive's ability to utilize files in other directories, so did a little test, which is what you indicated you tried in your initial email: DirectoryIndex ../index.htm Worked fine. Apache 1.3.26. Windows NT. So, your problem could be a web server configuration thing, as Rasmus hinted at. Beyond the things already discussed, I'm at a loss. Good luck, --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Win PHP Editor...
Try this one 1st http://www.phpedit.com And you will know by yourself. Maxim Maletsky [EMAIL PROTECTED] escreveu na mensagem 01c2401a$fce3cc70$1113fe17@dominanta">news:01c2401a$fce3cc70$1113fe17@dominanta... But why not use notepad. Because it reduces your production speed and time is money. So, what costs you more? Maxim Maletsky [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cookie array
Thanx ! Dne nedelja 11. avgust 2002 18:10 je B.C. Lance napisal(a): to store: setcookie (TestCookie[0], zero, time() + 3600); setcookie (TestCookie[1], one, time() + 3600); setcookie (TestCookie[2], two, time() + 3600); or setcookie (TestCookie[one], 1, time() + 3600); setcookie (TestCookie[two], 2, time() + 3600); setcookie (TestCookie[three], 3, time() + 3600); to retrieve: foreach($_COOKIE[TestCookie] as $key = $value) { echo {$value}br; } or echo $_COOKIE[TestCookie][one]; echo $_COOKIE[TestCookie][1]; Jan - Cwizo wrote: Hi ! How can I stoor array in to a cookie ? Do I just define an array and stoore it in a cookie ? How do I access the data in the array then ? -- LP CWIZO www.3delavnica.com www.ks-con.si www.WetSoftware.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: [PHP-INST] RedHat 7.3 apache is running but where is PHP support
Did that. Removed all stuff from apache, php mysql. Now what ? I will download the source code for apache and mysql now. LP Dne nedelja 11. avgust 2002 20:56 je [EMAIL PROTECTED] napisal(a): remove dependent modules, to find out dependencies: rpm -q --whatrequires php the list should have some php/mysql stuff, dump it all, R Hi If i type rpm -e apache I get an error that that would destory some dependinces ... In replay to Erik : I have downloaded the source code for PHP 4.2.2 I can download the source code for apache and mysql to if you wish ! So basicly I need to have support for mysql and for tracking varibles sended over forms (get, post). Nothing exsotic no extra libraries. O I need support for sessions if that is an extra feautre... So how do I remove all apache all php all mysql from my computer, so I can start from the beginning ? And please be clear with what you write :) LP CWIZO www.3delavnica.com www.ks-con.si www.WetSoftware.com Dne nedelja 11. avgust 2002 16:56 ste napisali: hey, when I started with 7.3 and Linux, I found that the best way was to get rid of all the installed crap and then start again. rpm -e apache for example will dump apache from your disk, I did that also with php and mysql client and server, then I grabbed the newest versions from rpmfind.net and installed apache then mysql then php 4.X with mysql support word of caution though, you can get the same rpms from the Valhalla Cd's but I found that for expample RPMs o mysql didn;t work (php did) , while the one from their site worked like a charm R oh yeah, invoke php -v (I believe) for the version and to see if it even runs, also chance has it that your apache configuration will not process .html with embedded php but .php only, R Hi ! I just installeted RedHat 7.3 I started apache with : /etc/httpd start I opend the browser and typed localhost. The welcome page displayed. Then I have created a PHP script file with this in it : ? phpinof(); ? opend it and I diden't get the result but the source (the fule is in the root folder of apache ( /var/www/html/ ) ) How do I enable PHP ?? And I know that in RedHat 7.3 there is PHP 4.1.2 how do I setu up the PHP 4.2.2 ?? And please I am a total beginner in linux so be clear with what you write :) PS : Excuse my spelling, English is not my native language -- LP CWIZO www.3delavnica.com www.ks-con.si www.WetSoftware.com -- PHP Install Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --__-__-__ eat pasta type fasta -- PHP Install Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --__-__-__ eat pasta type fasta -- LP CWIZO www.3delavnica.com www.ks-con.si www.WetSoftware.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] creating files in OS X
Hi: I'm new to PHP. I'm running Apache/PHP/MySQL on Mac OS X 10.1.5 (PHP 4.1.2) and everything is working well except that I cannot create a file through PHP. If I create a file I can subsequently read/write from PHP, but only after I change its file permissions to read/write for everyone. When I run the code: if (!file_exists($filename)) { if (touch ($filename)) { print $filename created; } else { die( Sorry Could Not create $filename); } } I get the following: Warning: unable to create file test.text because Permission denied in /Library/WebServer/Documents/dev/testcreate.php on line 10 It's obviously a permissions problem but do not know what exactly to change nor where/how to change it. Thanks for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] imlib2 problems
ok, had a look through the archives but couldn't find anything, so I'm sorry if I'm asking questions answered long ago. basically i'm trying to install imlib2 as a module for php rather than compiled into it as that was giving errors. when I run phpize, I get this: root@snipe:/home/gaz/imlib# phpize aclocal: macro `AC_ADD_LIBPATH' defined in acinclude.m4 but never used aclocal: macro `AC_ADD_LIBRARY_WITH_PATH' defined in acinclude.m4 but never used aclocal: macro `AC_ADD_LIBRARY' defined in acinclude.m4 but never used aclocal: macro `AC_ADD_INCLUDE' defined in acinclude.m4 but never used autoheader: config.h.in is unchanged You should update your `aclocal.m4' by running aclocal. so then I run aclocal which gives me basically the same: root@snipe:/home/gaz/imlib# aclocal aclocal: macro `AC_ADD_LIBPATH' defined in acinclude.m4 but never used aclocal: macro `AC_ADD_LIBRARY_WITH_PATH' defined in acinclude.m4 but never used aclocal: macro `AC_ADD_LIBRARY' defined in acinclude.m4 but never used aclocal: macro `AC_ADD_INCLUDE' defined in acinclude.m4 but never used Now it will actually let me ./configure --with-imlib=shared;make;make install; but whenever I try to use the module I get the following: warning: invalid library (maybe not a PHP library) 'imlib.so' in /home/gaz/public_html/upload.php on line 6 which suggests to me that although make worked, it didn't work right because of this aclocal stuff. anybody any ideas on how to fix this? btw, this is on a i386 slackware 8.0 box, automake 1.4, autoconf 2.5 (as i'm thinking it could be down to one of these atm) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 11 Aug 2002 21:04:41 -0000 Issue 1519
php-general Digest 11 Aug 2002 21:04:41 - Issue 1519 Topics (messages 112001 through 112049): need help 112001 by: Reymond 112017 by: B.C. Lance 112018 by: Matt 112021 by: B.C. Lance 112022 by: Matt Advice 112002 by: Steve Jackson 112003 by: Justin French IP and Language 112004 by: Christian Ista 112013 by: Peter passing an array in a link 112005 by: David T-G 112006 by: Bas Jobsen 112007 by: David T-G 112019 by: B.C. Lance 112020 by: B.C. Lance problem solving 112008 by: Justin French Re: cgi error 112009 by: JJ Harrison script parsing in img src tag 112010 by: Sascha Braun subtracting 2 time strings 112011 by: Christopher Molnar 112015 by: Matt 112033 by: Christopher Molnar Posting news via php 112012 by: Andy Re: passing an array in a form element 112014 by: David T-G Re: records in db 112016 by: Chris Kay Good Damn 112023 by: Sascha Braun 112025 by: Bas Jobsen 112026 by: Matt 112037 by: B.C. Lance Problem with $PHP_SELF on PWS 112024 by: John Brooks 112027 by: Bas Jobsen 112029 by: Matt Problem with echo 112028 by: Kristoffer Strom 112030 by: Bas Jobsen 112031 by: Matt 112032 by: Kristoffer Strom Re: Pictures and sound in MySQL and access via PHP 112034 by: Rodolfo Gonzalez why true? 112035 by: Bas Jobsen 112036 by: Rasmus Lerdorf Re: Cookie array 112038 by: B.C. Lance 112045 by: Jan - CWIZO Re: Newbie question about UNIX command-line directives 112039 by: Al 112040 by: Al 112042 by: Rasmus Lerdorf 112043 by: Analysis Solutions Best way to read file 112041 by: César Aracena Re: Win PHP Editor... 112044 by: Saci Re: [PHP-INST] RedHat 7.3 apache is running but where is PHP support 112046 by: php . banana 112047 by: Jan - CWIZO creating files in OS X 112048 by: David Rice imlib2 problems 112049 by: Gareth Ardron Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- I am newbie in php scripting, I am used to using asp scripting I get the result of my page but with no error message But Operator like * , + , or / the result is not valid result Variable $rat on my page its not work . My database sample ___ Id gid kabupaten etc.. - 10x x 21x x 30etc 41 52 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN ?php require('pagedresults.php'); $user=root; $host=localhost; $password=; $db=test; $cnx = @mysql_connect($host,$user,$password); if(!$cnx) echo ndak nyambung; $jadi=mysql_select_db($db,$cnx); $sqlcombo = select distinct material from distribusi; $hasil = mysql_query($sqlcombo); $x=1; $rs = new MySQLPagedResultSet(Select * from distribusi where material like '%$cari%' or kabupaten like '%$cari%' or jumlahpend like '%$cari%' or produksi like '%$cari%' or kebutuhan like '%$cari%' order by kabupaten,8,$cnx); ? html head title /title meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 /head body bgcolor=#2A508F center ?php while ($row = $rs-fetchArray()): if($row['gid']=0) { $rat = 110;// from this operator displayed with not valid result } elseif($row['gid']=1) { $rat = 9.5; // from this operator displayed with not valid result } else { $rat = 6.6; // from this operator displayed with not valid result } ? tr bgcolor=white td align=center bgcolor=whitea href=confdelete.php?id=?=$row['id']?img src=images/del_topic.gif border=0 alt=Delete This Field/a/td td align=center bgcolor=whitea href=edit-distribusi.php?id=?=$row['id']?img src=images/edit.gif border=0 alt=Edit This Field/a/td td align=center bgcolor=whitefont color=black face=verdana size=1px?=$x++?/font/td td align=center bgcolor=whitefont color=black face=verdana size=1px?= $row['material']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$row['kabupaten']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$row['jumlahpend']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$row['produksi']?/font/td td bgcolor=whitefont color=black face=verdana size=1px?=$kebutuhannye =((($row['jumlahpend'])* $rat ) / 1000 );?/font/td - here I print , I get an error value td bgcolor=whitefont color=black face=verdana size=1px?=$rationye = ($row['produksi']/$kebutuhannye)?/font/td /tr ?php
Re: [PHP] Re: Pictures and sound in MySQL and access via PHP
thank you for your answer How do you make a link in MySQL? I tried following code were the field geluid contains a link to a mp3 format of field geluid = varchar(250). The problem is that i just get plain text instead of a link to the MP3. Even better would be to have a button to clicjk if you want to hear the sound. echo table width=\90%\ border=1trtd; echo Nederlands/tdtdOostends/tdtdUitleg/td/tr; while ($row=mysql_fetch_array($result)) { echo trtd; echo $row[woord_nl]. /tdtd . $row[woord_ost]. /tdtd . $row[betekenis_nl]. /tdtd . $row[geluid]; echo /td/tr; } Danny Rodolfo Gonzalez [EMAIL PROTECTED] schreef in berichtnieuws [EMAIL PROTECTED] On Sat, 10 Aug 2002, lallous wrote: I'm making a on-line dictionary. I use PHP and a MySQL Database. Now I want to add audio-streaming (MP3) and pictures (JPG) to the database and retrieve it true PHP. Can sombody help me out with a little If the files are not secret or for members only, you should better store them somewhere under your http document tree, and store *only* their filenames in the database, then you could provide a link to the file. I think this would be the faster. Or if you want to protect the files, you could place them outside your document tree, and then use fileread or something similar to read them. But I'd suggest you to keep only the filenames on the database, and store the files in the filesystem, it'd better for the performance and integrity of the files. Good luck. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Cookie array
It is way smarter storing serialized array in one cookie. And, if you get length problems then only store SESSID in cookie and the rest in session or database. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: B.C. Lance [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 6:11 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: Cookie array to store: setcookie (TestCookie[0], zero, time() + 3600); setcookie (TestCookie[1], one, time() + 3600); setcookie (TestCookie[2], two, time() + 3600); or setcookie (TestCookie[one], 1, time() + 3600); setcookie (TestCookie[two], 2, time() + 3600); setcookie (TestCookie[three], 3, time() + 3600); to retrieve: foreach($_COOKIE[TestCookie] as $key = $value) { echo {$value}br; } or echo $_COOKIE[TestCookie][one]; echo $_COOKIE[TestCookie][1]; Jan - Cwizo wrote: Hi ! How can I stoor array in to a cookie ? Do I just define an array and stoore it in a cookie ? How do I access the data in the array then ? -- 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] Best way to read file
readfile() is good enough Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 6:36 PM To: PHP General List Subject: [PHP] Best way to read file Hi all. I am using readfile() to read and print the entire content of a .txt file into a site, but need to use /p tags to break down the lines. I intend to be able, as an Administrator, to edit these text files later. What is the best way to accomplish this? Should I keep using readfile() or should I use any ther better way of doing this? Thanks in advance, Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- 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] why true?
Try echo ('test'=='0'); and you'll see what Rasmus meant. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 4:56 PM To: PHP General Subject: [PHP] why true? echo ('test'==0); gives 1 why? Thanks, Bas -- 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] Best way to read file
Whatever saves you lines of code, difference is not any big. Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: Pushkar Pradhan [mailto:[EMAIL PROTECTED]] Sent: Monday, August 12, 2002 12:06 AM To: Maxim Maletsky Cc: 'César Aracena'; 'PHP General List' Subject: RE: [PHP] Best way to read file How about file() since it returns each line in the file as an array? It seems like he wants to do some processing on each line of the file. readfile() is good enough Sincerely, Maxim Maletsky PHP Beginner www.phpbeginner.com -Original Message- From: César Aracena [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 6:36 PM To: PHP General List Subject: [PHP] Best way to read file Hi all. I am using readfile() to read and print the entire content of a .txt file into a site, but need to use /p tags to break down the lines. I intend to be able, as an Administrator, to edit these text files later. What is the best way to accomplish this? Should I keep using readfile() or should I use any ther better way of doing this? Thanks in advance, Cesar Aracena CE / MCSE+I Neuquen, Argentina +54.299.6356688 +54.299.4466621 -- 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 -Pushkar S. Pradhan -- 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] Re: Pictures and sound in MySQL and access via PHP
How do you make a link in MySQL? I tried following code were the field geluid contains a link to a mp3 while ($row=mysql_fetch_array($result)) { echo trtd; echo $row[woord_nl]. /tdtd . $row[woord_ost]. /tdtd . $row[betekenis_nl]. /tdtd . $row[geluid]; echo /td/tr; } I'd do something like this: . a href=\ . $row[geluid] . \ . $row[geluid] . /a To get you link - basically, just put your link into the appropriate html tags. If you prefer a button or something else then apply the html you'd use and go with it. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Hacker?
My server is getting odd request form an outside computer. Upon looking into the requests I have found his PHP Config file is point to my server as the HTTP_VIA and other vars. I am wondering how I can deny him access since he is forwarding all request through my server with these settings. My server is only running ports 22, 25 and 110 so will his requests still run php since it is installed? Thanks, Josh Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Pictures and sound in MySQL and access via PHP
The way I always store links in the database is in the format of varchar, but if a file is stored in a mp3 folder to follow your example I would list it in the database as /mp3/sound.mp3. Then list your code like this: echo table width=\90%\ border=1trtd; echo Nederlands/tdtdOostends/tdtdUitleg/td/tr; while ($row=mysql_fetch_array($result)) { echo trtd; echo $row[woord_nl]. /tdtd . $row[woord_ost]. /tdtd . $row[betekenis_nl]. /tdtd . a href =\ .$row[geluid] ./link name/a; echo /td/tr; } Hope this hleps and works in your situation, Josh Thomas Administrator RPS Internet Services -Original Message- From: danny [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 3:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: Pictures and sound in MySQL and access via PHP thank you for your answer How do you make a link in MySQL? I tried following code were the field geluid contains a link to a mp3 format of field geluid = varchar(250). The problem is that i just get plain text instead of a link to the MP3. Even better would be to have a button to clicjk if you want to hear the sound. echo table width=\90%\ border=1trtd; echo Nederlands/tdtdOostends/tdtdUitleg/td/tr; while ($row=mysql_fetch_array($result)) { echo trtd; echo $row[woord_nl]. /tdtd . $row[woord_ost]. /tdtd . $row[betekenis_nl]. /tdtd . $row[geluid]; echo /td/tr; } Danny Rodolfo Gonzalez [EMAIL PROTECTED] schreef in berichtnieuws [EMAIL PROTECTED] On Sat, 10 Aug 2002, lallous wrote: I'm making a on-line dictionary. I use PHP and a MySQL Database. Now I want to add audio-streaming (MP3) and pictures (JPG) to the database and retrieve it true PHP. Can sombody help me out with a little If the files are not secret or for members only, you should better store them somewhere under your http document tree, and store *only* their filenames in the database, then you could provide a link to the file. I think this would be the faster. Or if you want to protect the files, you could place them outside your document tree, and then use fileread or something similar to read them. But I'd suggest you to keep only the filenames on the database, and store the files in the filesystem, it'd better for the performance and integrity of the files. Good luck. -- 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] Hacker?
block his ip at the router. tyler On Sun, 11 Aug 2002 16:21:07 -0600 RPS Internet [EMAIL PROTECTED] wrote: My server is getting odd request form an outside computer. Upon looking into the requests I have found his PHP Config file is point to my server as the HTTP_VIA and other vars. I am wondering how I can deny him access since he is forwarding all request through my server with these settings. My server is only running ports 22, 25 and 110 so will his requests still run php since it is installed? Thanks, Josh Thomas -- 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] Hacker?
What about all the users of his web site that are requesting his php scrpts that are compiling through my server? -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 4:15 PM To: RPS Internet Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Hacker? block his ip at the router. tyler On Sun, 11 Aug 2002 16:21:07 -0600 RPS Internet [EMAIL PROTECTED] wrote: My server is getting odd request form an outside computer. Upon looking into the requests I have found his PHP Config file is point to my server as the HTTP_VIA and other vars. I am wondering how I can deny him access since he is forwarding all request through my server with these settings. My server is only running ports 22, 25 and 110 so will his requests still run php since it is installed? Thanks, Josh Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pictures and sound in MySQL and access via PHP
thanks it works fine! :-))) Danny [EMAIL PROTECTED] schreef in berichtnieuws [EMAIL PROTECTED] hi, I already posted this message but the time on my computer was wrong (26/07 so i post it again). I am new on MySQL and PHP. I'm making a on-line dictionary. I use PHP and a MySQL Database. Now I want to add audio-streaming (MP3) and pictures (JPG) to the database and retrieve it true PHP. Can sombody help me out with a little example-code? The database is working well (only text). Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mkdate error?
The following bit of code completely baffles me as to why it doesn't work. I am doing a very simple validation where I check to see if the end date field of an inputted record is an older date than the start date. I checked this by putting in the same date for both end and start dates. Yet mkdate gives me a different value for each even though since they are both the same date, I should get the same value returned. Right? //notice the start and end date is the same. Therefore, you should get the same value for each, right? START LITTLE CODE SNIPPET $parsed_start_date=split(/, 08/02/2002); $parsed_end_date=split(/, 08/02/2002); $start_dts = mktime(, , , $parsed_start_date[0], $parsed_start_date[1], $parsed_start_date[2]); $end_dts = mktime(, , , $parsed_end_date[0], $parsed_end_date[1], $parsed_date[2]); if ($start_dts $end_dts) { echo This function thinks the end date is older than the start date.; } else { echo Whoah, it actually worked.; } END LITTLE CODE SNIPPET What am I not seeing? Thanks in advance, J. Chyun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mkdate error?
Your working with strings right? Would your if command be: if ($start_dts gt $end_dts) { echo This function thinks the end date is older than the start date.; } else { echo Whoah, it actually worked.; } In string you should use the gt comparitive instead of the . See if this works for you, Josh Thomas RPS Internet Services -Original Message- From: jc [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 4:01 PM To: [EMAIL PROTECTED] Subject: [PHP] mkdate error? The following bit of code completely baffles me as to why it doesn't work. I am doing a very simple validation where I check to see if the end date field of an inputted record is an older date than the start date. I checked this by putting in the same date for both end and start dates. Yet mkdate gives me a different value for each even though since they are both the same date, I should get the same value returned. Right? //notice the start and end date is the same. Therefore, you should get the same value for each, right? START LITTLE CODE SNIPPET $parsed_start_date=split(/, 08/02/2002); $parsed_end_date=split(/, 08/02/2002); $start_dts = mktime(, , , $parsed_start_date[0], $parsed_start_date[1], $parsed_start_date[2]); $end_dts = mktime(, , , $parsed_end_date[0], $parsed_end_date[1], $parsed_date[2]); if ($start_dts $end_dts) { echo This function thinks the end date is older than the start date.; } else { echo Whoah, it actually worked.; } END LITTLE CODE SNIPPET What am I not seeing? Thanks in advance, J. Chyun -- 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] Hacker?
So what? You don't want him using your stuff anyway do you? tyler On Sun, 11 Aug 2002 16:33:17 -0600 RPS Internet [EMAIL PROTECTED] wrote: What about all the users of his web site that are requesting his php scrpts that are compiling through my server? -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 4:15 PM To: RPS Internet Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Hacker? block his ip at the router. tyler On Sun, 11 Aug 2002 16:21:07 -0600 RPS Internet [EMAIL PROTECTED] wrote: My server is getting odd request form an outside computer. Upon looking into the requests I have found his PHP Config file is point to my server as the HTTP_VIA and other vars. I am wondering how I can deny him access since he is forwarding all request through my server with these settings. My server is only running ports 22, 25 and 110 so will his requests still run php since it is installed? Thanks, Josh Thomas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] mkdate error?
At 05:08 PM 8/11/2002 -0600, RPS Internet wrote: Your working with strings right? Would your if command be: if ($start_dts gt $end_dts) { echo This function thinks the end date is older than the start date.; } else { echo Whoah, it actually worked.; } In string you should use the gt comparitive instead of the . See if this works for you, Josh Thomas RPS Internet Services -Original Message- From: jc [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 4:01 PM To: [EMAIL PROTECTED] Subject: [PHP] mkdate error? The following bit of code completely baffles me as to why it doesn't work. I am doing a very simple validation where I check to see if the end date field of an inputted record is an older date than the start date. I checked this by putting in the same date for both end and start dates. Yet mkdate gives me a different value for each even though since they are both the same date, I should get the same value returned. Right? //notice the start and end date is the same. Therefore, you should get the same value for each, right? START LITTLE CODE SNIPPET $parsed_start_date=split(/, 08/02/2002); $parsed_end_date=split(/, 08/02/2002); $start_dts = mktime(, , , $parsed_start_date[0], $parsed_start_date[1], $parsed_start_date[2]); $end_dts = mktime(, , , $parsed_end_date[0], $parsed_end_date[1], $parsed_date[2]); if ($start_dts $end_dts) { echo This function thinks the end date is older than the start date.; } else { echo Whoah, it actually worked.; } END LITTLE CODE SNIPPET What am I not seeing? Thanks in advance, J. Chyun -- 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] mkdate error?
YOU use $parsed_date[2] in stead of $parsed_end_date[2] Op maandag 12 augustus 2002 00:01, schreef jc: The following bit of code completely baffles me as to why it doesn't work. I am doing a very simple validation where I check to see if the end date field of an inputted record is an older date than the start date. I checked this by putting in the same date for both end and start dates. Yet mkdate gives me a different value for each even though since they are both the same date, I should get the same value returned. Right? //notice the start and end date is the same. Therefore, you should get the same value for each, right? START LITTLE CODE SNIPPET $parsed_start_date=split(/, 08/02/2002); $parsed_end_date=split(/, 08/02/2002); $start_dts = mktime(, , , $parsed_start_date[0], $parsed_start_date[1], $parsed_start_date[2]); $end_dts = mktime(, , , $parsed_end_date[0], $parsed_end_date[1], $parsed_date[2]); if ($start_dts $end_dts) { echo This function thinks the end date is older than the start date.; } else { echo Whoah, it actually worked.; } END LITTLE CODE SNIPPET What am I not seeing? Thanks in advance, J. Chyun -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Free 'search engine' code
Hello, where can I find the best source for a search engine and a counter in PHP ? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] creating files in OS X
Hi Paul: Thanks, that worked. Cheers, David On Sunday, August 11, 2002, at 07:11 PM, Paul Colcutt wrote: Hi, you need to set the permissions for the directory youre creating the file in. Try typing (or copy and paste): chmod 777 /Library/WebServer/Documents/dev into Terminal... should do the trick. Two neat apps you can use for setting permissions and ownership via a GUI: 'Super GetInfo' by BareBones Software http://www.barebones.com/ and 'BatChmod' Freeware by Renaud Boisjoly http://www.macchampion.com/arbysoft Hi: I'm new to PHP. I'm running Apache/PHP/MySQL on Mac OS X 10.1.5 (PHP 4.1.2) and everything is working well except that I cannot create a file through PHP. If I create a file I can subsequently read/write from PHP, but only after I change its file permissions to read/write for everyone. When I run the code: if (!file_exists($filename)) { if (touch ($filename)) { print $filename created; } else { die( Sorry Could Not create $filename); } } I get the following: Warning: unable to create file test.text because Permission denied in /Library/WebServer/Documents/dev/testcreate.php on line 10 It's obviously a permissions problem but do not know what exactly to change nor where/how to change it. Thanks for any help. David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- === Paul Colcutt http://www.paulcolcutt.co.uk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mkdate error?
Oh my God. I had redone and ripped this apart for hours. Errors like this make me realize how stupid I truly am. Thank you for your help. :) I can go on with life now. J. Chyun At 12:30 AM 8/12/2002 +0200, Bas Jobsen wrote: YOU use $parsed_date[2] in stead of $parsed_end_date[2] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Free 'search engine' code
That would depend on what you want. What sort of counter? Hidden? Text file or database based? Images or text on screen? Per page? Per site? What sort of search engine? Are you searching and indexing text files or text in a databases? Are there categories and search methods, or just something simple? Really, if you ask an open question, you get an open answer. There are hundreds of sources for free PHP scripts... there's no way we can recommend something until we know what you want. Perhaps you should search them to try and find something that suits your needs, or to build up a wish-list. Justin on 12/08/02 9:43 AM, Edgard Berendsen ([EMAIL PROTECTED]) wrote: Hello, where can I find the best source for a search engine and a counter in PHP ? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Free 'search engine' code
I just got a decent search engine from phpclasses.org ( I downloaded the one by BasicA). I modified it a little to add different page types to be returned and other directories. That would depend on what you want. What sort of counter? Hidden? Text file or database based? Images or text on screen? Per page? Per site? What sort of search engine? Are you searching and indexing text files or text in a databases? Are there categories and search methods, or just something simple? Really, if you ask an open question, you get an open answer. There are hundreds of sources for free PHP scripts... there's no way we can recommend something until we know what you want. Perhaps you should search them to try and find something that suits your needs, or to build up a wish-list. Justin on 12/08/02 9:43 AM, Edgard Berendsen ([EMAIL PROTECTED]) wrote: Hello, where can I find the best source for a search engine and a counter in PHP ? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -Pushkar S. Pradhan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Free 'search engine' code
What sort of counter? Hidden? Text file or database based? Images or text on screen? Per page? Per site? Hidden or not hidden, database or no database based, with or wtithout images, per page or per site. What sort of search engine? Are you searching and indexing text files or text in a databases? Are there categories and search methods, or just something simple? For searching HTML files, with cateogries. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Random mirrors and download quota
Seems good to me, only this part: and it will be checked if the mirror is randomly selected and if it is above 1200, will randomly select another server It's better to select those under 1200 right from the start. If you have 10 servers, you might make 9 checks before selecting the last one. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br Andrew Conner [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I have a script (at bottom) that, upon loading, will randomly select a mirror or primary server (on average, the primary servers will be selected twice as much). It all works good, but now, I have to add a quota manager that will, for both mirrors, limit the times the file can be downloaded to 1200 times (there is only one file being downloaded). I have thought about storing a text file for each of the two mirrors that shows the current count of downloads, and it will be checked if the mirror is randomly selected and if it is above 1200, will randomly select another server, and if it isn't, will just add one to it and update the file. How would I go about this, or is there a better way to do this? Thanks in advance. Andrew Conner The script (I know it doesn't use the best design, but it works, any better ways of doing this?): ? // This array holds the servers, and has a double entry for the primary servers $adArr = array(http://www.someprimaryserver.com/file.exe;, http://www.someprimaryserver.com/file.exe;, http://www.someprimaryserver2.com/file.exe;, http://www.someprimaryserver2.com/file.exe;, http://www.someprimaryserver3.com/file.exe;, http://www.someprimaryserver3.com/file.exe;, http://www.someprimaryserver4.com/file.exe;, http://www.someprimaryserver4.com/file.exe;, http://www.somemirror.com/file.exe;, http://www.somemirror2.com/file.exe;); // This randomly gets a server... srand((double)microtime()*100); $wOne = rand(0, 9); $choice = $adArr[$wOne]; // This fwds the user to the server picked. // Somewhere in here needs to be the mirror stuff... header(Location: $choice); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Free 'search engine' code
Edgard, Check www.hotscripts.com for your needs - there is usually something there you can use or modify. Best regards, Andrew On Sunday, August 11, 2002, at 08:24 PM, Edgard Berendsen wrote: What sort of counter? Hidden? Text file or database based? Images or text on screen? Per page? Per site? Hidden or not hidden, database or no database based, with or wtithout images, per page or per site. What sort of search engine? Are you searching and indexing text files or text in a databases? Are there categories and search methods, or just something simple? For searching HTML files, with cateogries. 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
[PHP] Case Sensitivity
I've had a web site under development on my Win2k box at home. I built and tested everything with PHP 4.2.2 and Apache 1.3.24. Now, I have transitioned everything up to my host who is using a Linux box, PHP 4.2.2 and Apache 1.3.26. One of the pages I designed has code that retrieves a list of thumbnails from a directory name passed into the page then embeds a hyperlink to a full size version of the thumbnail. Incidentally, the full size version is in the same directory as the thumbnail and has a very similar filename: tn_01.jpg and 01.jpg (guess which one's the thumbnail). Here's the problem: When I run the page on the web host's server, the link to the full size image dies. I've tracked the problem to the case of the linked filename. Basically, unless the filename in the href matches the case of the target file, the link dies and I get that nice, little red X indicating the link to the image is broken. For example, the target image DSC01.JPG _MUST_ be referenced in the href as: href='../path/to/resource/DSC01.JPG' If I reference it as href='../path/to/resource/dsc01.jpg' the target image won't show up. I have temporarily resolved the issue by designating the filename used in the href as upper case using the strtoupper() function, but I can't believe that's the way it's SUPPOSED to be done. What I'd like to know is does the Linux server introduce case-sensitivity issues? It doesn't seem to matter with the elements of the path, just the target filename. Help is appreciated. Rich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Case Sensitivity
Linux file systems are case sensitive... So the file Hello.php is different to hello.php... Both can exist at the same time and contain different content, but they are different...On the windows file system files aren't case sensitive so Hello.php would be the same as hello.php... So I suggest in your PHP coding that you get all the cases (of files) the same throughout your app, or if you want to be lazy do what you are doing at the moment (ie changing the case with strtoupper()) Andrew - Original Message - From: Rich Hutchins [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 12, 2002 2:20 AM Subject: [PHP] Case Sensitivity I've had a web site under development on my Win2k box at home. I built and tested everything with PHP 4.2.2 and Apache 1.3.24. Now, I have transitioned everything up to my host who is using a Linux box, PHP 4.2.2 and Apache 1.3.26. One of the pages I designed has code that retrieves a list of thumbnails from a directory name passed into the page then embeds a hyperlink to a full size version of the thumbnail. Incidentally, the full size version is in the same directory as the thumbnail and has a very similar filename: tn_01.jpg and 01.jpg (guess which one's the thumbnail). Here's the problem: When I run the page on the web host's server, the link to the full size image dies. I've tracked the problem to the case of the linked filename. Basically, unless the filename in the href matches the case of the target file, the link dies and I get that nice, little red X indicating the link to the image is broken. For example, the target image DSC01.JPG _MUST_ be referenced in the href as: href='../path/to/resource/DSC01.JPG' If I reference it as href='../path/to/resource/dsc01.jpg' the target image won't show up. I have temporarily resolved the issue by designating the filename used in the href as upper case using the strtoupper() function, but I can't believe that's the way it's SUPPOSED to be done. What I'd like to know is does the Linux server introduce case-sensitivity issues? It doesn't seem to matter with the elements of the path, just the target filename. Help is appreciated. Rich -- 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] Newbie question about UNIX command-line directives
The problem may be due to the fact that my environment is Apache Unix. I spent about two hours today pouring over the php on-line manual include spec and trying dozens of combinations. http://www.php.net/manual/en/function.include.php There must be at least 20 user contributed notes at the bottom. It is incredible that such a basic php function should be so obtuse and ill defined. I'm going to give your other suggestion a try tomorrow. Thanks again Analysis Solutions wrote: On Sun, Aug 11, 2002 at 12:33:55PM -0400, Al wrote: The .htaccess approach appears to fit my situation best; but, I've not been able to get it to work. I wondered about the DirectoryIndex directive's ability to utilize files in other directories, so did a little test, which is what you indicated you tried in your initial email: DirectoryIndex ../index.htm Worked fine. Apache 1.3.26. Windows NT. So, your problem could be a web server configuration thing, as Rasmus hinted at. Beyond the things already discussed, I'm at a loss. Good luck, --Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stoopid Question - PHP.ini path?
Hi.. Sorry to ask such a stoopid question here... but I really could not find anything on this... How do I change the path of the php.ini file on Windows XP pro? I'm using IIS... I just installed PHP on my web server and the path of the php.ini is c:\winnt but my is on c:\WINDOWS . So, how do I do this? I tried searching over the web most of them talk about configuration.. I can't seemed to find anything on changing the path of the PHP.ini file. THank you so much in advance. Yours, Wee Keat
[PHP] Re: Random mirrors and download quota
how about using the counter to store an id of the mirrors instead of randomly picking one? this will provide you a sequential traverse through all mirror sites. if there are 10 sites, the counter will always be from 0 - 9. this way each mirror site will have equal share on hits. so if the counter == 2, your script will know that the next hit will be to mirror site 2. $_nextSite = (isset($_nextSite))?++$_nextSite % 10:0; the above code will always ensure the counter counts from: 0 - 9 - 0 - ... this way, you can store all counters (into database?) on the main site for all mirrors. Andrew Conner [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I have a script (at bottom) that, upon loading, will randomly select a mirror or primary server (on average, the primary servers will be selected twice as much). It all works good, but now, I have to add a quota manager that will, for both mirrors, limit the times the file can be downloaded to 1200 times (there is only one file being downloaded). I have thought about storing a text file for each of the two mirrors that shows the current count of downloads, and it will be checked if the mirror is randomly selected and if it is above 1200, will randomly select another server, and if it isn't, will just add one to it and update the file. How would I go about this, or is there a better way to do this? Thanks in advance. Andrew Conner The script (I know it doesn't use the best design, but it works, any better ways of doing this?): ? // This array holds the servers, and has a double entry for the primary servers $adArr = array(http://www.someprimaryserver.com/file.exe;, http://www.someprimaryserver.com/file.exe;, http://www.someprimaryserver2.com/file.exe;, http://www.someprimaryserver2.com/file.exe;, http://www.someprimaryserver3.com/file.exe;, http://www.someprimaryserver3.com/file.exe;, http://www.someprimaryserver4.com/file.exe;, http://www.someprimaryserver4.com/file.exe;, http://www.somemirror.com/file.exe;, http://www.somemirror2.com/file.exe;); // This randomly gets a server... srand((double)microtime()*100); $wOne = rand(0, 9); $choice = $adArr[$wOne]; // This fwds the user to the server picked. // Somewhere in here needs to be the mirror stuff... header(Location: $choice); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Case Sensitivity
Filesystems are meant to be case-sensitive, and yes, URL's are as well. It's an abomination that Windows and old-style Mac filesystems are not. You need to keep track of that in your code. 'a' and 'A' are just as different as 'a' and 'b'. -Rasmus On Sun, 11 Aug 2002, Rich Hutchins wrote: I've had a web site under development on my Win2k box at home. I built and tested everything with PHP 4.2.2 and Apache 1.3.24. Now, I have transitioned everything up to my host who is using a Linux box, PHP 4.2.2 and Apache 1.3.26. One of the pages I designed has code that retrieves a list of thumbnails from a directory name passed into the page then embeds a hyperlink to a full size version of the thumbnail. Incidentally, the full size version is in the same directory as the thumbnail and has a very similar filename: tn_01.jpg and 01.jpg (guess which one's the thumbnail). Here's the problem: When I run the page on the web host's server, the link to the full size image dies. I've tracked the problem to the case of the linked filename. Basically, unless the filename in the href matches the case of the target file, the link dies and I get that nice, little red X indicating the link to the image is broken. For example, the target image DSC01.JPG _MUST_ be referenced in the href as: href='../path/to/resource/DSC01.JPG' If I reference it as href='../path/to/resource/dsc01.jpg' the target image won't show up. I have temporarily resolved the issue by designating the filename used in the href as upper case using the strtoupper() function, but I can't believe that's the way it's SUPPOSED to be done. What I'd like to know is does the Linux server introduce case-sensitivity issues? It doesn't seem to matter with the elements of the path, just the target filename. Help is appreciated. Rich -- 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] Newbie question about UNIX command-line directives
What does include have to do with DirectoryIndex? And what exactly is your problem with include? The only trick is setting the include_path which doesn't seem all that obtuse to me. -Rasmus On Sun, 11 Aug 2002, Al wrote: The problem may be due to the fact that my environment is Apache Unix. I spent about two hours today pouring over the php on-line manual include spec and trying dozens of combinations. http://www.php.net/manual/en/function.include.php There must be at least 20 user contributed notes at the bottom. It is incredible that such a basic php function should be so obtuse and ill defined. I'm going to give your other suggestion a try tomorrow. Thanks again Analysis Solutions wrote: On Sun, Aug 11, 2002 at 12:33:55PM -0400, Al wrote: The .htaccess approach appears to fit my situation best; but, I've not been able to get it to work. I wondered about the DirectoryIndex directive's ability to utilize files in other directories, so did a little test, which is what you indicated you tried in your initial email: DirectoryIndex ../index.htm Worked fine. Apache 1.3.26. Windows NT. So, your problem could be a web server configuration thing, as Rasmus hinted at. Beyond the things already discussed, I'm at a loss. Good luck, --Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: passing an array in a link
Ok, I don't know if you already solved this, but you might want to do something like $SerKeylist=rawurlencode(serialize($keylist)); print a href=\/myscript.php?SerKeylist=$SerKeylist\link/a; on the source end and $keylist=unserialize($_GET[SerKeylist]); at the destination. This of course will build quite an URL for large arrays, so you might consider using a bit of JavaScript and a form at the source end in order to use POST instead of GET if needed. HTH Bogdan David T-G wrote: Hi, all -- I collect field keys in an array that looks like $keylist = array('comment','job','spaced out key name','foo',...) ; and would like to pass the array to myself in a call like print a href=\/myscript.php?keylist=$keylist\link/a ; but when it's actually run it of course says ...keylist=Array... which is quite bad. I'd use a simple scalar $keylist = comment job spaced out key name foo ... ; but, of course, those darned fields which have spaces embedded in the names will really mess that up. How can I pass myself an array -- and recognize it on the receiving end? TIA HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_fetch_array problem
hi everyone! i'm new here (and new to php) and have a question. i'm trying to run a simple blogger type script but am running into a problem i can't seem to troubleshoot. first, the three items i put into the database aren't showing up on my page and then when i try to go to the archive for the month, i get the following: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/blar/public_html/inc/main_inc.php on line 11 here's a part of my code of main_inc (first line is line 11): function showPosts($result,$page) { if ($myrow = mysql_fetch_array($result)) { do { $rawdate = $myrow[postDate]; $formdate = date(l, F j, Y, (strtotime(ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)','\2/\3/\1', $rawdate; if ($date != $formdate) { $date = $formdate; ? !-- Formatting for date -- b?=$formdate;?/bbr nbsp;br ? } if ($page == 1) { showArchivePost($myrow); } else { showMainPost($myrow); } } while ($myrow = mysql_fetch_array($result)); } } /code thank in advance for any help. :) jonni b. http://blar.org http://uglypropaganda.com
[PHP] Re: Case Sensitivity
Subscribing 100% to the reply you got from Rasmus above, I'll just add that typically that's not a problem anyway because the files are generally created programatically (by the code) and once you set it right, you don't have to bother - although yes, it does seem odd when you first bump into this when migrating from Windows. Just my 2c Bogdan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] POST fields through CURL
Hi all, I'm setting up a curl operation with post fields, and I'm hoping someone can tell me how the post fields are formatted. I'm looking to pass a string to curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the specifications don't tell one HOW to format the string. Is it just like a GET string or what? Anyone know? Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql_fetch_array problem
Hi Jonni! You should consider wrapping mysql_fetch_*() functions into a personalized function which also takes care of errors - at least for debugging. Your problem is typical - your query has some problems and mysql_run_query() returns a null result, which is indeed not a valid MySQL result resource. What you should do is to run something like $result=mysql_run_query(your SQL here); if (!$result) { echo(BMySQL query error in query /BI. your SQL here./IBR /\n); echo(mysql_error()); } and debug the SQL. Now that's tedious to write for every, and that's why I was suggesting wrapping the thing into a function - but that's obviously not mandatory as long as you can debug it, right? :-) Another idea while I'm on the topic, if you do create a wrapper, you may also consider sending yourself an e-mail if an error occurs after everything works right - that way you'll be able to track errors quickly - and impress your customers! HTH Bogdan Jonni wrote: hi everyone! i'm new here (and new to php) and have a question. i'm trying to run a simple blogger type script but am running into a problem i can't seem to troubleshoot. first, the three items i put into the database aren't showing up on my page and then when i try to go to the archive for the month, i get the following: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/blar/public_html/inc/main_inc.php on line 11 here's a part of my code of main_inc (first line is line 11): function showPosts($result,$page) { if ($myrow = mysql_fetch_array($result)) { do { $rawdate = $myrow[postDate]; $formdate = date(l, F j, Y, (strtotime(ereg_replace('([0-9]*)-([0-9]*)-([0-9]*)','\2/\3/\1', $rawdate; if ($date != $formdate) { $date = $formdate; ? !-- Formatting for date -- b?=$formdate;?/bbr nbsp;br ? } if ($page == 1) { showArchivePost($myrow); } else { showMainPost($myrow); } } while ($myrow = mysql_fetch_array($result)); } } /code thank in advance for any help. :) jonni b. http://blar.org http://uglypropaganda.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: POST fields through CURL
Yes, the strings are formatted exactly like GET strings, but you'll have to build the whole HTTP header in front of them in order to get a valid HTTP request. So then, your code should look something like $myvar1=rawurlencode($myvar1); $myvar2=rawurlencode($myvar2); $parsed=myvar1=$myvar1myvar2=$myvar2; $len=strlen($parsed) $request=POST $request_path HTTP/1.0\r\n. Content-Type: application/x-www-form-urlencoded\r\n. User-Agent: My PHP application v1.0\r\n. Host: $host\r\n. Content-Length: $len\r\n. Connection: Keep-Alive\r\n. \r\n. // This separates the header from the content $parsed; After that, you send $request. Bogdan Mike Mannakee wrote: Hi all, I'm setting up a curl operation with post fields, and I'm hoping someone can tell me how the post fields are formatted. I'm looking to pass a string to curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the specifications don't tell one HOW to format the string. Is it just like a GET string or what? Anyone know? Thanks, Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hacker?
What about all the users of his web site that are requesting his php scrpts that are compiling through my server? Contact him and ask to stop. If he doesn't, block. It will be him that will lose customers, not you. -- Julio Nobrega Pode acessar: http://www.inerciasensorial.com.br Rps Internet [EMAIL PROTECTED] escreveu na mensagem [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... What about all the users of his web site that are requesting his php scrpts that are compiling through my server? -Original Message- From: Tyler Longren [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 4:15 PM To: RPS Internet Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Hacker? block his ip at the router. tyler On Sun, 11 Aug 2002 16:21:07 -0600 RPS Internet [EMAIL PROTECTED] wrote: My server is getting odd request form an outside computer. Upon looking into the requests I have found his PHP Config file is point to my server as the HTTP_VIA and other vars. I am wondering how I can deny him access since he is forwarding all request through my server with these settings. My server is only running ports 22, 25 and 110 so will his requests still run php since it is installed? Thanks, Josh Thomas -- 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] Please someone help me!
Hello! First of all, i am trying to solve this problem for more then a week now, i looked through php.net for hours and have posted on numerous boards but nobody could come up and tell me what is going wrong. Basically, i have two multidimensional arrays, and i want to compare those two using array_diff(). The problem is, that the output given is ecxactly the opposite of what i want. To make it easier for those willing to help, i placed the sample code in a textfile so you can view it there. http://www.thebounceroom.com/problem.txt PLEASE, if you have some spare time have a look and tell me why this is not working as it should, as by now i am really frustrated, ive lost a whole week by now and everybody else has to wait just because of me. Thanks a lot in advance for your time reading this! With best regards from Vienna, Jürgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: POST fields through CURL
Are you sure that the HTTP header should be on there? I don't believe that is correct. It is the use of CURLOPT_POSTFIELDS with the curl_setopt function that indicates that a POST is being made. I just checked the code I used for credit card clearing it does NOT include the HTTP headers. Just the POST data. -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 22:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: POST fields through CURL Yes, the strings are formatted exactly like GET strings, but you'll have to build the whole HTTP header in front of them in order to get a valid HTTP request. So then, your code should look something like $myvar1=rawurlencode($myvar1); $myvar2=rawurlencode($myvar2); $parsed=myvar1=$myvar1myvar2=$myvar2; $len=strlen($parsed) $request=POST $request_path HTTP/1.0\r\n. Content-Type: application/x-www-form-urlencoded\r\n. User-Agent: My PHP application v1.0\r\n. Host: $host\r\n. Content-Length: $len\r\n. Connection: Keep-Alive\r\n. \r\n. // This separates the header from the content $parsed; After that, you send $request. Bogdan Mike Mannakee wrote: Hi all, I'm setting up a curl operation with post fields, and I'm hoping someone can tell me how the post fields are formatted. I'm looking to pass a string to curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the specifications don't tell one HOW to format the string. Is it just like a GET string or what? Anyone know? Thanks, Mike -- 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] including a php file in an html doc
I have a .php file whose purpose, ultimately, is to set one variable; $hotspot. Now I want to include that var in a bunch of places in my html page (it must remain html). So this was my thought. In the head include the following: script language=php src=hotspot.php/script and then anywhere in the html doc I want to print the value of $hotspot I type: ?=$hotspot? but it doesn't work. I have a feeling I cant include a php script that way because in trying to debug the problem I made the first line of hotspot.php = echo test; and the word test never shows. What am I missing? Thnks Alex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: POST fields through CURL
Duh, yes, of course, I'm stupid - I forgot you were talking about Curl - I never used it so it may be the way you say it is. The piece of code I sent you was a part of what I used to build a full HTTP request (connecting to the server and sending it - everything done by hand), and Curl may be building the header instead. Curl *should* typically get the string preparsed though, so I may not be completely off with the code - but then again, I can't be certain. Sorry for the mishap! Bogdan Jonathan Rosenberg wrote: Are you sure that the HTTP header should be on there? I don't believe that is correct. It is the use of CURLOPT_POSTFIELDS with the curl_setopt function that indicates that a POST is being made. I just checked the code I used for credit card clearing it does NOT include the HTTP headers. Just the POST data. -Original Message- From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]] Sent: Sunday, August 11, 2002 22:36 PM To: [EMAIL PROTECTED] Subject: [PHP] Re: POST fields through CURL Yes, the strings are formatted exactly like GET strings, but you'll have to build the whole HTTP header in front of them in order to get a valid HTTP request. So then, your code should look something like $myvar1=rawurlencode($myvar1); $myvar2=rawurlencode($myvar2); $parsed=myvar1=$myvar1myvar2=$myvar2; $len=strlen($parsed) $request=POST $request_path HTTP/1.0\r\n. Content-Type: application/x-www-form-urlencoded\r\n. User-Agent: My PHP application v1.0\r\n. Host: $host\r\n. Content-Length: $len\r\n. Connection: Keep-Alive\r\n. \r\n. // This separates the header from the content $parsed; After that, you send $request. Bogdan Mike Mannakee wrote: Hi all, I'm setting up a curl operation with post fields, and I'm hoping someone can tell me how the post fields are formatted. I'm looking to pass a string to curl_setopt( $ch, CURLOPT_POSTFIELDS, $string), but the specifications don't tell one HOW to format the string. Is it just like a GET string or what? Anyone know? Thanks, Mike -- 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] Please someone help me!
First of all, which OS and PHP version? On Mon, 12 Aug 2002, Gandalf wrote: Hello! First of all, i am trying to solve this problem for more then a week now, i looked through php.net for hours and have posted on numerous boards but nobody could come up and tell me what is going wrong. Basically, i have two multidimensional arrays, and i want to compare those two using array_diff(). The problem is, that the output given is ecxactly the opposite of what i want. To make it easier for those willing to help, i placed the sample code in a textfile so you can view it there. http://www.thebounceroom.com/problem.txt PLEASE, if you have some spare time have a look and tell me why this is not working as it should, as by now i am really frustrated, ive lost a whole week by now and everybody else has to wait just because of me. Thanks a lot in advance for your time reading this! With best regards from Vienna, Jürgen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: use data-ba_se
In article [EMAIL PROTECTED], list+php- [EMAIL PROTECTED] says... Hi, I just noticed a little problem(?) while using databases. Some time ago I wrote myself a little class that made it easier to handly my mysql-tasks. The class connected to a database and used a query like use $database to switch to the given database. This worked without a problem just as in the command-line tool mysql, today however I had a database called like data-ba_se. useing it gave me a note cannot use database data-ba_se as result. However it worked in the command-line mysql and it works using mysql_select_db(). Login, Database and password were checked for typo's of course. PHP is 4.1.2, default woody-package. Any idea what can be the reason for this? Balu The underscore is a mysql wildcard for a single character; it may be that mysql is attempting to treat it as a wildcard rather than a literal in the circumstances in which you are using it. Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Please someone help me!
You really should also do a bit of work to make it easy for people to help you. I just spent 5 minutes decyphering your text file so I could reproduce your problem using this script: ? $array1 = array( array(aus_name=Videografik, aus_id=1), array(aus_name=Webdesign,aus_id=2), array(aus_name=gfg fd, aus_id=3), array(aus_name=df fds dfsdf, aus_id=4), array(aus_name=fdf'' dfd fds,aus_id=5)); $array2 = array( array(aus_name=Webdesign,aus_id=2), array(aus_name=Videografik, aus_id=1)); $n=0; foreach ($array2 as $diff) { $diff[$n]=array_diff($array1[$n], $array2[$n]); $all[] = array (aus_name = $diff[$n][aus_name], aus_id = $diff[$n][aus_id]); $n++; } var_dump ($all); ? This is 5 minutes I normally wouldn't have spent and would just have skipped over your question because there was too much work for me. So, looking at this code, let's manually look at what happens in that foreach() loop of yours. You end up comparing the first element in array1 with the first element of array2 and on the second iteration you compare the second element of array1 with the second element of array2. Like this: array(aus_name=Videografik, aus_id=1) vs. array(aus_name=Webdesign,aus_id=2) and array(aus_name=Webdesign,aus_id=2) vs. array(aus_name=Videografik, aus_id=1) Now, the documentation for array_diff() states: array_diff() returns an array containing all the values of array1 that are not present in any of the other arguments. Note that keys are preserved. So, by looking at what you are comparing, and keeping what the array_diff() function is documented to do in mind, we would expect an output of: array(aus_name=Videografik, aus_id=1) the first time through the loop as neither Videografik nor 1 appears in the second array which consists of array(aus_name=Webdesign,aus_id=2) and the same goes for the second iteration. So, the output you are getting is exactly what you coded. Your main mistake: You forgot that PHP arrays are ordered. That is, the order by which elements are inserted is the order in which they appear when you loop through them with foreach. This resulted in you not comparing equivalent aus_id elements with each other. You also don't seem to handle the difference in the number of elements anywhere. If both sets starts with aus_id at 1 and go up from there, it is clear that if array1 has 5 elements and array2 only has 2, then aus_id 3, 4 and 5 from array1 are the different without even checking. You probably did realize this, and that is why you are doing the foreach() over array2, but nowhere do you put these last 3 elements into your difference array. I think the easiest way to handle this is to rethink your problem. Assuming you won't always have incrementing aus_id's the way you do and you don't know whether array1 or array2 will have more elements, I would suggest making a temp array keyed on the aus_id sorted correctly. Not very hard to do, just do this: foreach($array1 as $elem) $ar1[$elem['aus_id']] = $elem['aus_name']; foreach($array2 as $elem) $ar2[$elem['aus_id']] = $elem['aus_name']; ksort($ar1); ksort($ar2); Now, the real benefit of this approach is that you just need to call array_diff() once to get the diff you want. So here is the rewritten test script: $array1 = array( array(aus_name=Videografik, aus_id=1), array(aus_name=Webdesign,aus_id=2), array(aus_name=gfg fd, aus_id=3), array(aus_name=df fds dfsdf, aus_id=4), array(aus_name=fdf'' dfd fds,aus_id=5)); $array2 = array( array(aus_name=Webdesign,aus_id=2), array(aus_name=Videografik, aus_id=1)); foreach($array1 as $elem) $ar1[$elem['aus_id']] = $elem['aus_name']; foreach($array2 as $elem) $ar2[$elem['aus_id']] = $elem['aus_name']; ksort($ar1); ksort($ar2); $diff = array_diff($ar1,$ar2); var_dump($diff); It's shorter, faster and it works. -Rasmus On Mon, 12 Aug 2002, Gandalf wrote: Win2k Pro and the latest PHP Version At 21:17 11.08.2002 -0700, you wrote: First of all, which OS and PHP version? On Mon, 12 Aug 2002, Gandalf wrote: Hello! First of all, i am trying to solve this problem for more then a week now, i looked through php.net for hours and have posted on numerous boards but nobody could come up and tell me what is going wrong. Basically, i have two multidimensional arrays, and i want to compare those two using array_diff(). The problem is, that the output given is ecxactly the opposite of what i want. To make it easier for those willing to help, i placed the sample code in a textfile so you can view it there. http://www.thebounceroom.com/problem.txt PLEASE, if you have some spare time have a look and tell me why this is not working as it should,
Re: [PHP] Win PHP Editor...
www.phpide.de An excellent PHP IDE for windows. Color coding, Syntax hints(tool tips type), auto indent etc... Lord Loh. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php