[PHP] How do i add sound + pictures in a MySQL Database and how do i consult it via PHP
hi, I am new on MySQL en 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. Can sombody help me out? 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] Pictures and sound in MySQL and access via PHP
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] Re: Pictures and sound in MySQL and access via PHP
thank you, If i understand the best way would be to place the MP3's in a seperate directory and giving each MP3's a unique id? In the database every record has already a unique idea. If i name my mp3 something like this: record ID=10, name MP3 = MP3_10.mp3. I already have about 200 little MP3's with the prononciation of the words in a dictionary. Is there a way to automate this task? So changing the original name of the MP3 ex.. "komen.mp3" in "MP3_10.mp3"? Lallous <[EMAIL PROTECTED]> schreef in berichtnieuws [EMAIL PROTECTED] > Personally I wouldn't store BIG files (like .mp3) into the database. > > If you insist checkout the mysql LOAD_FILE() > > Elias > > "Danny" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[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
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 ""; echo "NederlandsOostendsUitleg"; while ($row=mysql_fetch_array($result)) { echo ""; echo $row[woord_nl]. "" . $row[woord_ost]. "" . $row[betekenis_nl]. "" . $row[geluid]; echo ""; } 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] 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] navigatie doesn't work in this script
I made a MySQL database with a dictionary in it. Above there is a form in wich you can specify some parameters. The problem is that the navigation doesn't work well. I always get the first 5 results. Can somebody help me out? There are about 56 records in the database. The (not quite) working thing is on: http://www.oostendseverhalen.be/test_met_navigatie3.php Untitled Document Ostensche encyclopedie Oostends-Drooghenbroodt Oostends-desnerck Nederlands Frans Engels Verklaring Hulp bij het zoeken '; if ($taalkeuze === NULL) { $taalkeuze = "woord_ost"; } $van = 0; $tot = 5; mysql_connect("**.**.**.**", "**", "") or die (mysql_error()); $Query_beperkte_records = "SELECT woordenboek.* FROM woordenboek WHERE " .$taalkeuze. " LIKE '%" .$zoekwoord. "%' ORDER BY woordenboek.woord_ost ASC LIMIT ".$van.",".$tot; $Query_alle_records = "SELECT woordenboek.* FROM woordenboek WHERE " .$taalkeuze. " LIKE '%" .$zoekwoord. "%'"; $result = mysql("oostends",$Query_beperkte_records) or die(mysql_error()); $query = mysql("oostends",$Query_alle_records) or die(mysql_error()); $num3 = mysql_num_rows($query); $num2 = $num3 / $tot;. $num = ceil($num2);. if ($num > 1) { for ($i = 1; $i <= $num; $i++) $van2 = ($i * $tot) - $tot; if ($i == $page) $pages[$i] = "$i";. else $pages[$i] = "$i"; } $pages = implode(" | ", $pages); $vorige = ($page-1) ? "< Vorige" : ""; $volgende = ($page-$num) ? "Volgende >" : ""; if ($vorige && $volgende) $navigation = "$vorige | $pages | $volgende"; else $navigation = "$vorige | $pages | $volgende"; } print $navigation; while ($gegevens=mysql_fetch_object($result)) { echo " ". $gegevens->woord_ost. ""; if ($gegevens->geluid != NULL) { echo "geluid. "\">";} else { echo ""; } echo " geluid. "\"> geluid. "\"> Volgnr " .$gegevens->woord_des. " (ost_desn) , " .$gegevens->woord_nl. " (nl) , " .$gegevens->woord_fr. " (fr) , " .$gegev ens->woord_eng. " (eng) , " .$gegevens->verklaring." "; if ($gegevens->multimedia != NULL) { echo "multimedia. "\" width=\"170\" height=\"124\" border=\"1\">"; } else { echo ""; } echo " "; echo ""; } print $navigation; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] navigatie doesn't work in this script
In production this database will be verry big (about 1 records) and for almost every record a MP3 or picture. So i want to show only 5 records at a time. Therefore i tried to create a navigation system. And it isn't working properly now. (It doesn't go up), i always get the same five records. the variables $van and $tot have to be the limits ("van" = from and "tot" means to) John W. Holmes <[EMAIL PROTECTED]> schreef in berichtnieuws 001401c267ee$e6a510d0$[EMAIL PROTECTED] > You have LIMIT 0,5 in your query...what do you expect to happen? You're > only going to get five rows with that in there. > > ---John Holmes... > > > -Original Message- > > From: danny [mailto:[EMAIL PROTECTED]] > > Sent: Sunday, September 29, 2002 3:21 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] navigatie doesn't work in this script > > > > I made a MySQL database with a dictionary in it. Above there is a form > in > > wich you can specify some parameters. The problem is that the > navigation > > doesn't work well. I always get the first 5 results. Can somebody help > me > > out? There are about 56 records in the database. > > > > The (not quite) working thing is on: > > http://www.oostendseverhalen.be/test_met_navigatie3.php > > > > > > > > Untitled Document > > > > > > > > > > > > > > > /* hieronder volgt het formulier */ > > echo ' > > > > > > > > > cellpadding="2" summary="interactief woordenboek Oostends nederlands, > > Engels > > en Frans."> > > > > Ostensche > > encyclopedie > > > >> bgcolor="#CC"> > > > valign="middle"> > > > >> checked> > > Oostends-Drooghenbroodt > > > > > > > > Oostends-desnerck > > > > size="2" > > face="Tahoma"> > > > > > > Nederlands > > > > > > > > Frans > > > > > > > > > > Engels > > > > > > > > Verklaring > > > > > face="Tahoma">Hulp > > bij het zoeken > > > >> bgcolor="#FF"> > > > bgcolor="#CC"> > > > value="" > > size="50" maxlength="40"> > > > > > > > > > > > > > > > > > > > > '; > > > > > > if ($taalkeuze === NULL) > > { > > $taalkeuze = "woord_ost"; > > } > > > > > > $van = 0; > > $tot = 5; > > > > > > mysql_connect("**.**.**.**", "**", "") or die > (mysql_error()); > > > > $Query_beperkte_records = "SELECT woordenboek.* FROM woordenboek WHERE > " > > .$taalkeuze. " LIKE '%" .$zoekwoord. "%' ORDER BY > woordenboek.woord_ost > > ASC > > LIMIT ".$van.",".$tot; > > $Query_alle_records = "SELECT woordenboek.* FROM woordenboek WHERE " > > .$taalkeuze. " LIKE '%" .$zoekwoord. "%'"; > > $result = mysql("oostends",$Query_beperkte_records) or > die(mysql_error()); > > $query = mysql("oostends",$Query_alle_records) or die(mysql_error()); > > $num3 = mysql_num_rows($query); > > $num2 = $num3 / $tot;. > > $num = ceil($num2);. > > > > > > if ($num > 1) > > { > > for ($i = 1; $i <= $num; $i++) > > > > > > $van2 = ($i * $tot) - $tot; > > if ($i == $page) > >$pages[$i] = " > color=\"#C0C0C0\">$i";. > > else > >$pages[$i] = " > href=\"$php_self?page=$i&van=$van2&tot=$tot\">$i"; > > } > > $pages = implode(" | ", $pages); > > $vorige = ($page-1) ? " > href=\"$php_self?page=" . ($page -
Re: [PHP] navigatie doesn't work in this script
John, Ik took this script from a script-library. The problem (i think) is that the counter $tot isn't going up. It remains 5 ex: http://www.oostendseverhalen.be/test_met_navigatie3.php?page=8&van=35&tot=5 John W. Holmes <[EMAIL PROTECTED]> schreef in berichtnieuws 001a01c267f3$90b8a8d0$[EMAIL PROTECTED] > Search the archives for "previous next links" and you'll see a ton of > ways to do this. You are setting the variables to 0 and 5 and then > issuing the query. You have to put some logic in there to only set it to > those values if it's the first time this page is called. If a $tot or > $van value is passed in the URL, then you should use that. > > ---John Holmes... > > > -Original Message- > > From: danny [mailto:[EMAIL PROTECTED]] > > Sent: Sunday, September 29, 2002 3:56 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP] navigatie doesn't work in this script > > > > In production this database will be verry big (about 1 records) > and > > for > > almost every record a MP3 or picture. So i want to show only 5 records > at > > a > > time. Therefore i tried to create a navigation system. And it isn't > > working > > properly now. (It doesn't go up), i always get the same five records. > the > > variables $van and $tot have to be the limits ("van" = from and "tot" > > means > > to) > > > > John W. Holmes <[EMAIL PROTECTED]> schreef in berichtnieuws > > 001401c267ee$e6a510d0$[EMAIL PROTECTED] > > > You have LIMIT 0,5 in your query...what do you expect to happen? > You're > > > only going to get five rows with that in there. > > > > > > ---John Holmes... > > > > > > > -Original Message- > > > > From: danny [mailto:[EMAIL PROTECTED]] > > > > Sent: Sunday, September 29, 2002 3:21 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: [PHP] navigatie doesn't work in this script > > > > > > > > I made a MySQL database with a dictionary in it. Above there is a > form > > > in > > > > wich you can specify some parameters. The problem is that the > > > navigation > > > > doesn't work well. I always get the first 5 results. Can somebody > help > > > me > > > > out? There are about 56 records in the database. > > > > > > > > The (not quite) working thing is on: > > > > http://www.oostendseverhalen.be/test_met_navigatie3.php > > > > > > > > > > > > > > > > Untitled Document > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > /* hieronder volgt het formulier */ > > > > echo ' > > > > > > > > > > > > > > > > > > > cellpadding="2" summary="interactief woordenboek Oostends > nederlands, > > > > Engels > > > > en Frans."> > > > > > > > > Ostensche > > > > encyclopedie > > > > > > > >> > > bgcolor="#CC"> > > > > > > > valign="middle"> > > > > > > > >value="woord_ost" > > > > checked> > > > > Oostends-Drooghenbroodt > > > > > > > > > > > >value="woord_des"> > > > > Oostends-desnerck > > > > > > > > > > size="2" > > > > face="Tahoma"> > > > > > > > > value="woord_nl"> > > > > Nederlands > > > > > > > > > > > > value="woord_fr"> > > > > Frans > > > > > > > > face="Tahoma"> > > > > > > > >value="woord_eng"> > > > > Engels > > > > > > > > > > > >value="verklaring"> > > > > Verklaring > > > > > > > > >
[PHP] embedding pdf files in website
Hi, I have a website with lots of stories (each story is about 20 pages long). The list of stories is in a MySQL database. I've read somewhere that pdf files can be embeded on a webpage. I want my visitor to use the navigation system of my website. (and don't want them to leave my website while reading the pdf documents). I Don't like my visitors to scroll down i rather like to use buttons and How do you do such a thing in php, or wher can i find some info? (i have no solution in html) Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions and sessionfiles
Hi there, well...I'm tired of searching so I'll drop a note here. I've been busy working with php (4.0.6) sessions lately for an online shopping cart, which works really great. Only problem is, the temporary session-files are not removed after a certain timeout occurs. The "session.gc_maxlifetime"-variable is set to 1440 seconds, which means the temporary session-files should be deleted after 24 minutes of inactivity from the client side. Unfortunately, nothing of a kind happens. A way around this problem is adding a cronjob which deletes session-files older than say 3 or 4 hours or so. I'd rather see a better solution...anyone? And is there any information available on wether or not the error of not deleting session-files has any consequences for newly created sessions? Anyone out there, if you have a serious and professional solution, please mail to [EMAIL PROTECTED] Thanks! Happy php-ing! Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Quick session question
Hi guys, I always start new projects with the following session code-snippet: (In other words this is how I initialize my sessions in the index.php file.) ### START CODE SNIPPET http://localhost/~user/new_project"; ; $_SESSION['sql_dflts'] = $_SESSION['server']."/sql/sql_dflts.inc" ; $_SESSION['remoteaddr'] = $_SERVER['REMOTE_ADDR'] ; $_SESSION['remotehost'] = gethostbyaddr ( $_SERVER['REMOTE_ADDR'] ) ; /// Include Files include ( $_SESSION['sql_dflts'] ) ; include ( $_SESSION['server']."/fnc/fnc_include_dir.inc" ) ; $var_include_dir = include_dir ( "fnc" ) ; ?> ### END CODE SNIPPET # All of the projects I have done so far were for business intranet purposes and it worked fine. But last week I uploaded another project to the internet and my sessions did not work. I have been using it this way since v4.0 (I think, anyway since a LONG time ago), but now I think it is a bit outdated and needs some kind of revision. Is this still sufficient or can you guys give some tips on a more "updated" way of starting my sessions? My php.ini file is stock-standard. I am running version 5.2.6-1 with apache 2.2.9 on a Debian 5.04 machine. Thank You Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick session question
Thanks Ashley and Jim, > When you say 'sessions did not work' what do you mean? Sessions aren't being > created? You can't access session variables? You need to be a bit more > specific > about the issue. Sorry, here is an explanation: The project I uploaded for a customer is a "stock ordering" web-app that they used on their local intranet for a year or so, but now they want this same web-app to be available globally. I thought that it would work "out-the-box" on the internet but it doesn't. On their local-lan I am able to do some (advanced) login checks with sessions with no problem, like I said, it has been workng for a year or so now. Also, the same login sequence I use here I also use in my other intranet web-apps. However, when I uploaded this project and I log on, I just get a blank screen after the login checks are done and it is supposed to take me to the logged-in start page. That is why I say that somehow my sessions are not "carried over" or "caught" by php. Thanks for the comments on my session initialization, if there is not really anything that should be changed, then I will leave it like it is. Just one more thing, should I always expand the URL's to an absolute path instead of using a session variable like I do? Thnks again guys Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick session question
Hi Gaurav, Creating a "local" folder solved the problem. I can now catch the session varaibles. I think that I am too familiar with setting up everything on a local server and forgot that there are "other" things to consider when you work on the internet. Thank You Danny >On Jun 25 10, Gaurav Kumar : > 2. Check on the server that are the sessions really getting saved on the > server? > 3. Now in case you do not have access to a sessions folder on the server then > set the session folder name/path to the folder (a new one) you can have access > to (may be root of your ftp) using session_save_path('/httpdocs/ > 'your-domain-folder/new-session-folder) (provide read/write permission) before > session_start() in index.php or common header include file. This > session_save_path() should be declared on every file on the top. > > Try the above and let me know if it works. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick session question
Hi Jim, I followed Gaurav's tips on creating a "folder" to store the session info in and it got solved. I can now catch the session variables but I got A LOT of "include()" file errors which was solved by following your suggestion on expanding my URL's. Thank You Danny >On Jun 24 10, Jim Lucas : > > Nothing looks to be wrong with the session initiation code. The problem is > more > the likely the calls to include a remote file. Basically, to expand your > variables out, you would be doing this: > > include ( 'http://localhost/~user/new_project/sql/sql_dflts.inc' ) ; > include ( 'http://localhost/~user/new_project/fnc/fnc_include_dir.inc' ) ; > > If your php.ini settings are stock, then the problem is with the > allow_url_include directive. It is set to "0" by default. > > See here: http://us3.php.net/manual/en/filesystem.configuration.php > > Change that setting to '1' and restart your web server, then you should be > good > to go. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick session question [SOLVED]
Hi Guys, Thanks to all of you who helped me with my problem. I can now continue with my life :) . I'm happy and the customer is happy ... Thank you once again. Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Quick session question
Hi Mari, I used "localhost" as a substitute for the real url. My mistake I should've told you guys. Thanks anyway for your input. Danny >On Jun 24 10, Mari Masuda : > > Maybe you need to change > > $_SESSION['server'] = "http://localhost/~user/new_project"; ; > > to be not localhost. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] $_POST variable
Hi guys, I have a form that has a long list of radio-bottons inside of it. The radio-buttons are dynamically created via php and MySQL. Here is an example of one of the radio buttons: " value="0"> " value="1"> Now, when I submit this form to another page for processing, how would I "catch" the above radio-button's $_POST name since I do not know the name, only that it starts with "radio_" ? Thank You Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Detailed Report
Hi All, I´ve got a connection, to a MySQL db, and get the following ResultSet(Category | Name | Code | City) Customers | John | A36 | New York Customers | Jason | B45 | Los Angeles Customers | Max | A36 | Paris Providers | John | A36 | London Providers | Mark | B67 | Madrid And I need the report in the following format: Customers John - A36 - New York Jason - B45 - Los Angeles Max - A36 - Paris Providers John - A36 - London Mark - B67 - Madrid Any one can help? I´m a bit stalled thx regards. --
Re: [PHP] Detailed Report
Thanks for your help Adrian, but the problem is that I need to show row[0] once (Customers text are repeated), and below the details of the records Your solution shows: Customers | John | A36 | New York Customers | Jason | B45 | Los Angeles (...) And I need Customers John | A36 | New York Jason | B45 | Los Angeles (...) (...) On 10/27/05, Adrian Bruce <[EMAIL PROTECTED]> wrote: > > > load each row of the resultset into an array $row using > mysql_fetch_array(), each field in the result set row will be held in > the corresponding array element. > > while ($row = mysql_fetch_array($resultset, MYSQL_NUM)){ > echo"$row[0] | $row[1] | $row[2]"; > } > > Hope this helps, > Ade > > Danny wrote: > > >Hi All, > > I´ve got a connection, to a MySQL db, and get the following > >ResultSet(Category | Name | Code | City) > > Customers | John | A36 | New York > >Customers | Jason | B45 | Los Angeles > >Customers | Max | A36 | Paris > >Providers | John | A36 | London > >Providers | Mark | B67 | Madrid > >And I need the report in the following format: > > Customers > >John - A36 - New York > >Jason - B45 - Los Angeles > >Max - A36 - Paris > > Providers > >John - A36 - London > >Mark - B67 - Madrid > > Any one can help? I´m a bit stalled > > thx > >regards. > >-- > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- dpc
Re: [PHP] Detailed Report
Thank you very much I think it will work, because my problem seems to be with "if" operators and order... Thanks again On 10/27/05, Adrian Bruce <[EMAIL PROTECTED]> wrote: > > ok, so i assume that customers is a grouping of some sort and that in > some cases you may come accross a row like "Staff | John | A36 |LA ". > It may not be a perfect way of doinig it but this is what i would > generally try: > > while ($row = mysql_fetch_array($resultset, MYSQL_NUM)){ > if($row[0] == $group){ > echo" $row[1] | $row[2]"; > } > else{ > echo"$row[0]$row[1] | $row[2] | $row[3]"; > } > $group = $row[0]; > } > > Ade > > Danny wrote: > > > Thanks for your help Adrian, but the problem is that I need to show > > row[0] once (Customers text are repeated), and below the details of > > the records > > > > Your solution shows: > > > > Customers | John | A36 | New York > > Customers | Jason | B45 | Los Angeles > > (...) > > And I need > > Customers > > John | A36 | New York > > Jason | B45 | Los Angeles > > > > (...) > > > > > > > > (...) > > > > > > > > > > > > > > On 10/27/05, *Adrian Bruce* <[EMAIL PROTECTED] > > <mailto:[EMAIL PROTECTED]>> wrote: > > > > > > load each row of the resultset into an array $row using > > mysql_fetch_array(), each field in the result set row will be > > held in > > the corresponding array element. > > > > while ($row = mysql_fetch_array($resultset, MYSQL_NUM)){ > > echo"$row[0] | $row[1] | $row[2]"; > > } > > > > Hope this helps, > > Ade > > > > Danny wrote: > > > > >Hi All, > > > I´ve got a connection, to a MySQL db, and get the following > > >ResultSet(Category | Name | Code | City) > > > Customers | John | A36 | New York > > >Customers | Jason | B45 | Los Angeles > > >Customers | Max | A36 | Paris > > >Providers | John | A36 | London > > >Providers | Mark | B67 | Madrid > > >And I need the report in the following format: > > > Customers > > >John - A36 - New York > > >Jason - B45 - Los Angeles > > >Max - A36 - Paris > > > Providers > > >John - A36 - London > > >Mark - B67 - Madrid > > > Any one can help? I´m a bit stalled > > > thx > > >regards. > > >-- > > > > > > > > > > > > > -- > > PHP General Mailing List ( http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > > dpc > > -- dpc
[PHP] Substr by words
Hi, I need to extract 50 words more or less from a description field. How can i do that?. Substr, cuts the words. Is there any other way to that, without using and array? I mean and implemented function in PHP 4.x I´ve been googling around, but wordwrap, and substr is driving me mad... Thanks in advance Best Regards -- dpc
[PHP] [DONE] Substr by words
Finally i found it (Google is god, you only have to ask the right question) function trim_text($text, $count){ $text = str_replace(" ", " ", $text); $string = explode(" ", $text); for ( $wordCounter = 0; $wordCounter <= $count;wordCounter++ ){ $trimed .= $string[$wordCounter]; if ( $wordCounter < $count ){ $trimed .= " "; } else { $trimed .= "..."; } } $trimed = trim($trimed); return $trimed; } Usage $string = "one two three four"; echo trim_text($string, 3); -- Forwarded message -- From: Danny <[EMAIL PROTECTED]> Date: Oct 29, 2005 1:36 PM Subject: Substr by words To: php-general@lists.php.net Hi, I need to extract 50 words more or less from a description field. How can i do that?. Substr, cuts the words. Is there any other way to that, without using and array? I mean and implemented function in PHP 4.x I´ve been googling around, but wordwrap, and substr is driving me mad... Thanks in advance Best Regards -- dpc -- dpc
[PHP] Retrieve Data Formated from Text field
Hi Gurus, I´ve got a problem with the result displaying a "TEXT" type field The data is inserted into db in this way: "Hello, This is a sample of first line. This is another paragraph, blah blah blah Bye" But the result is in one paragraph: "Hello, This is a sample of first line. This is another paragraph, blah blah blah Bye" If I use HTML label, I´ve got the result correct, but cannot use styles Any Suggestion? thx . -- dpc
[PHP] php5 / php4 - MySQL/SQLite
Hi, Let me open a discussion about php5 / php4 Why upgrade? It worth? Benefits? Code programming changes? Is there and end-of-life for php4, in the near/medium future? What about MySQL and SQLite. What is the future of both? I would like to open a discussion about the future of both related to php no matter the version of it... Let´s start -- dpc
Re: [PHP] is there a number translation function?
http://www.phpguru.org/TextualNumberExample.php?number=3450 Regards. Salu2 On 10/29/05, Linda H <[EMAIL PROTECTED]> wrote: > > Hi, > > Does anyone know of a function for translating a decimal number into an > English number. In other words, if you pass it 1 it will return 'one', if > you pass it 127 it will return 'one hundred twenty seven', and etc. > > Thanks, > Linda > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- dpc
[PHP] Newbie to PHP5
Hi there, I´m familiar with PHP syntax, but I´ve been reading some sample scripts, in PHP5 and i´ve seen some "strange" things, like diferent ways to read a collection of rows, magic functions, wrapers, and operators like "::" and "->". I know that all is the manual, but before that anyone nows, a website or a simple tutorial or explained samples, in order that the transition from PHP4 and PHP5 were easiest as possible. Thanks -- dpc
Re: [PHP] Newbie to PHP5
Thanks. Any other source (some resume pdf or something like "What´s new") On 11/15/05, Raz <[EMAIL PROTECTED]> wrote: > > > "->". I know that all is the manual, but before that anyone nows, a > website > > or a simple tutorial or explained samples, in order that the transition > from > > PHP4 and PHP5 were easiest as possible. > > http://www.php.net/ > -- dpc
[PHP] Code generators
Hi there, There´s a lot of manufacturers, about PHP code generators. What do you think about that? I mean, it seems like PHP Nuke fashion or other portal systems. Everybody has its portal, but all web pages seems to be the same, because all are under the same design. I would like to gather opinions about it. Example: http://www.yessoftware.com/index2.php Thank you P.S. Please sorry my poor english, I´m trying to improve my skills -- dpc
[PHP] PHP, MySQL and XML for IPodCasting
Hi, I´ve got a web project that daily offers 4 o 5 mp3 files recorded by me. >From an web based interface I populate a database with titles, descripcion, images and the path for the mp3 file in the server The cuestion is I would like to offer the content for Ipod, using ipodcasting. Then I have to produce a daily XML file in order the Ipods feed from that file How to proceed Should I create a script to make the well-formed XML file? (echoing to a file based into a template that I´ve got) or is there parser of something like that? which can help me to produce that file The scenario would be PHP 5, MySQL 5.x and Apache 2.0 Thank you in advance Rgards
Re: [PHP] PHP, MySQL and XML for IPodCasting
Simply Fantastic!. Thanks a lot! So for me the best solution I think, would be to read the MySQL Table, and produce the XML with a given template from a PHP Script. I will use Scheduled Task instead of CRON... (Sorry, working on windows ;-) ) [Off topic] Could it be tested without an IPod device? I´ve been googling around, but I don´t know much about those devices, and IPodCasters simulators for PC Thanks again, Best Regards. On 12/9/05, Michael Hulse <[EMAIL PROTECTED]> wrote: > > On Dec 9, 2005, at 3:45 AM, Danny wrote: > > How to proceed > > I recently set-up my first Podcast... Every week I have a script that > grabs three MP3 files from a remote server and puts them on my own > server... Then I have another script that generates the Podcast XML. > > I am using CRON jobs to do all the work for me... all I have to do is > open iTunes and everything starts downloading automatically is > nice. > > The way I generate my XML is via output buffering and a simple > text-file template. Here is my template (template.txt): > > > > >Put your title here [{_dateCheck_}] >Link to your site/the page that explains what this podcast is > > all about. >This is the description... it will show-up in > iTunes... > yadda yadda... >en-us >Copyright Info >{_dateLong_} >Your name here >1 > >Name of MP3 podcast - Hour 01, {_dateCheck_}, > {_dateSlashes_} >Hour 01 ({_dateSlashes_}) of this particular > podcast. >{_dateLong_} > url="http://www.yoursite.com/location_of_podcast_mp3/mp3_name- > {_dateShort_}.mp3" length="10800040" type="audio/mpeg"/> >{_randNumOne_} > > >Name of MP3 podcast - Hour 02, {_dateCheck_}, > {_dateSlashes_} >Hour 02 ({_dateSlashes_}) of this particular > podcast. >{_dateLong_} > url=" http://www.yoursite.com/location_of_podcast_mp3/mp3_name- > {_dateShort_}.mp3" length="10800040" type="audio/mpeg"/> >{_randNumTwo_} > > >Name of MP3 podcast - Hour 03, {_dateCheck_}, > {_dateSlashes_} >Hour 03 ({_dateSlashes_}) of this particular > podcast. >{_dateLong_} > url=" http://www.yoursite.com/location_of_podcast_mp3/mp3_name- > {_dateShort_}.mp3" length="10800040" type="audio/mpeg"/> >{_randNumThree_} > > > > > Here is my PHP (pod.php): > > > # Error checking: > if((isset($_REQUEST['pass'])) && ($_REQUEST['pass'] === 'let_me_in') && > (!empty($_REQUEST['pass']))) { > > # Begin date: > $date_long = date('r'); // Example output: Mon, 21 Nov 2005 05:20:18 > -0500 > $date_short = date('mdy'); // Example output: 051121 > $date_slashes = date('m/d/y'); // Example output: 11/21/05 > $date_check = date('l'); > #End date. > > function randNumb() { ># Begin random # generation: >srand ((double) microtime( )*100); >$random_number = rand( ); >return $random_number; ># End random # generation. > } > > $rand_num_one = randNumb(); > $rand_num_two = randNumb(); > $rand_num_three = randNumb(); > > > // HTML to be written: > ob_start(); > > readfile($_SERVER['DOCUMENT_ROOT'].'/template.txt'); > > $contents = ob_get_clean(); > @ob_end_clean(); > > $contents = str_replace('{_dateLong_}',$date_long, $contents); > $contents = str_replace('{_dateSlashes_}',$date_slashes, $contents); > $contents = str_replace('{_dateShort_}',$date_short, $contents); > $contents = str_replace('{_randNumOne_}',$rand_num_one, $contents); > $contents = str_replace('{_randNumTwo_}',$rand_num_two, $contents); > $contents = str_replace('{_randNumThree_}',$rand_num_three, $contents); > $contents = str_replace('{_dateCheck_}',$date_check, $contents); > > # Now open the file and write contents of template: > $fp = > fopen($_SERVER['DOCUMENT_ROOT'].'/ > path_to_place_where_you_store_the_xml_file/ > xml_file_name'.$date_check.'.xml','wb'); // Open for writing only; If > the file does not exist, attempt to create it. > fwrite($fp, $contents); > fclose($fp); > > } else { echo "Please Leave Now!"; } > > ?> > > I then use a cron to run the above script ev
[PHP] Infinite subcategories
Hi All, Time ago, somebody sent a sample to the list about how to do an "infinite" subcategories, based on parent field. I´ve been googling, and searching my mail history, but cannot find it. The objective is to create a tree with categories and subcategories of documents, but with no limit into the subcategory depth. Anybody remember that thread, or can point me to a solution? Thank you Regards -- dpc
Re: [PHP] money
http://www.php.net/manual/en/function.number-format.php - Original Message - From: "Wilbert Enserink" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 09, 2003 10:44 AM Subject: [PHP] money Hi all, I'm busy making a swebstore. I have troubles with the format of money. I wanrt to display amounts like "2 products a ? 6,25 = ? 12,50" Whatever I try I can't get the comma there (it's showing a point "." and it doesn't display the second number behind the comma i.e. "12.5" Anybody knows how to make me my money? :-) regards Wilbert - Pas de Deux Van Mierisstraat 25 2526 NM Den Haag tel 070 4450855 fax 070 4450852 http://www.pdd.nl [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Is this possible with php?
Hi, Where did he say he wanted to use Word to edit PHP files? AFAICT the idea was to automatically upload Word files, presumably to make them available on an Intranet for download etc. As for uploading a file automatically - PHP isn't going to do it. An app which can map a virtual drive in Windows would probably be the best bet - I think Windows has built in support for mapping WebDAV and FTP servers as shares so this may be a good starting point. HTH Danny. - Original Message - From: "Maxim Maletsky" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, January 10, 2003 11:38 AM Subject: Re: [PHP] Is this possible with php? > > [EMAIL PROTECTED] wrote... : > > > I would like to know if the follwing function can be implemneted > > in php with help of other tools: > > in PHP distribution? PHP is the programming language, not a > client/server tool. This is definitely something to be an integrated > part of something else. > > > using MS Word in windows, > > MS Word for editing PHP files? That is very, very bad ... You will never > find a job if ever mention it to an employer. Search the archives of > this list for "PHP Editors". I recommend Edit Plus for plain-text > programming. If you want a whole IDE then Zend Studio is probably the > best for you. > > > when a file is saved, can it be AUTOMATICALLY > > uploaded (via http POST or other mechanism) to a server? > > > > Currently I need to first save it on my desktop, then upload that copy > > to a php-supported server. > > Oh well, there are four ways to accomplish this. > > > 1. Professional way: > > Using CVS. CVS (cvshome.org) is a system that allows you to version your > files. This, in two words, works this way: in CVS, you `checkout' > (update) a file, edit it, and save it (if somebody else edited that file > while you edited yours both changes will merge). CVS is the most > professional solution for this thing. > > > 2. Simplest way: > > Use a mapped networking like Samba. This will mean that you will see > your server just as it was a hard disk on your windows. You drag&drop > files there and the same will occur remotely. Not a very secure way, > though. > > > 3. FTP integrated tool: > > Get a good editor that has some FTP integration. It will means that when > you `save' a file in your editor, it will automatically FTP that file on > the server. A very tool-dependent way but can work. Very cruel when > something goes wrong, though. Again, Zend IDE and Edit Plus can do that. > > > 4. The Geeky way: > > Edit all your files in a simple VIM or other fancy directly on the > server by logging there with telnet or SSH. > > > Have fun. > > > -- > Maxim Maletsky > [EMAIL PROTECTED] > > > -- > 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] php5 cvs
It includes the latest CVS build of ZendEngine 2.0 - AFAIK it hasn't even reached beta status yet, so don't even think about using it for production work. That said, I didn't have any problems building it and it seems pretty stable. A list of changes and features can be found at http://www.php.net/ZEND_CHANGES.txt. HTH Danny. - Original Message - From: "electroteque" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 11, 2003 6:50 PM Subject: [PHP] php5 cvs > hi guys just noticed php5 cvs in the snaps page , does this have the zend > 2.0 engine ? more specific question has it got the proper OO built in yet ? > > > > -- > 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] HTTP_ACCEPT - Reliabilty?
Hi, No, I wouldn't rely on it at all, I couldn't find a browser that *does* have that mime-type in it's header! - Here's what IE6 sends : Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, */* Accept-Language: en-gb Accept-Encoding: gzip, deflate Flash, along with a multitude of other plugins, is installed and working fine. FWIW, Mozilla 1.3a sends: Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q= 0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate,compress;q=0.9 Opera 7 sends: Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 Accept-Language: en Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0 - Original Message - From: "SED" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, January 14, 2003 10:22 AM Subject: [PHP] HTTP_ACCEPT - Reliabilty? > I'm using Flash very often within websites. Like you know, sometimes the > user doesn't have the Flash-plug-in so I was wandering if I could depend > on this $_SERVER['HTTP_ACCEPT'] variable to look for "shockwave-flash". > If found, the visitor has Flash-plugging, if not, he doesn't. > > So my question really is, can I base my Flash-detection on this global > variable or is too uncertain? (e.g. when the user is using Netscape, > Opera etc., Linux, Mac etc.) > > Regards, > Sumarlidi E. Dadason > > SED - Graphic Design > _ > E-mail: [EMAIL PROTECTED] > website: www.sed.is > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about $_GET
Try $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid = {$_GET['id']}"; HTH Danny. - Original Message - From: "Frank Keessen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 10:50 AM Subject: [PHP] Question about $_GET Hi All, Can you please help me with the following problem? I've had code wich was running fine with php till i've upgraded to PHP version 4.2.3. The original code line was: $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid = '$id'"; but it's not working when you have register_globals=Off So i've read everywhere to use the $_Get: So the code looks like this: $query = "SELECT Newsheadline, News, Contact FROM news WHERE Newsid = $_GET['id']"; But all i'm getting in my browser is: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' Can someone please help? Thanks and regards, Frank -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Random Row...
Don't make life difficult for yourself :) SELECT * FROM myTable ORDER BY RAND() LIMIT 0,1 HTH Danny. - Original Message - From: "Brian McGarvie" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, January 16, 2003 9:37 AM Subject: [PHP] Random Row... > $sql = " > select count(*) as theCount > from myTable > "; > ... > $row_id = rand(1, $myrow["theCount"]); > ... > $sql_randow_row " > select * > from myTable > where id = $row_id > "; > > I assume I'm right with the method above to select a random row? or any > other way? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting a dynamic IP address
$_SERVER['SERVER_ADDR'] gives the address of the server running the php script $_SERVER['REMOTE_ADDR'] gives the client address or the proxy address. (be careful here, storing a proxy's IP is next to useless) $_SERVER[' HTTP_X_FORWARDED_FOR'] gives the client address if they're behind a proxy (if this isn't set then they probably aren't behind a proxy so you can use the remote_addr instead) HTH Danny. - Original Message - From: "Kyle Lampkin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, January 15, 2003 11:41 PM Subject: [PHP] Getting a dynamic IP address >Hello all, > Newbie here I need to know if there is a way I can get my dynamic IP > address for use in a php script? > -- > Your favorite stores, helpful shopping tools and great gift ideas. > Experience the convenience of buying online with Shop@Netscape! > http://shopnow.netscape.com/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [SOAP] Re: soap post and http 1.1 100 continue
- Original Message - From: "Dominik Wittenbeck" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 25, 2003 3:28 PM Subject: [SOAP] Re: soap post and http 1.1 100 continue > Yep, know that one, > > Why it does happen: > although the HTTP 1.1 spec states that a HTTP 100 SHOULD NOT (or was it MUST > NOT ;-) to the client, unless it requires it by a specific header, IIS does > it with webservices and thereby about any that are published and maintained > with .NET ;-) Not quite right : An origin server SHOULD NOT send a 100 (Continue) response if the request message does not include an Expect request-header field with the "100-continue" expectation, and MUST NOT send a 100 (Continue) response if such a request comes from an HTTP/1.0 (or earlier) client. There is an exception to this rule: for compatibility with RFC 2068, a server MAY send a 100 (Continue) status in response to an HTTP/1.1 PUT or POST request that does not include an Expect request-header field with the "100-continue" expectation. This exception, the purpose of which is to minimize any client processing delays associated with an undeclared wait for 100 (Continue) status, applies only to HTTP/1.1 requests, and not to requests with any other HTTP-version value. > Solution: > A HTTP 100 basically states: "ok I am ready for your content now". You have > probably submitted your content already... resend it, but the content only, > without the \r\n\r\n mark that separates headers from payload with HTTP. > To serve a clean solution you should however go ahead and implement a > listener that tries to hear a HTTP 100. With PHP this is kind of tiresome. > In my implementation I also just resend the payload ;-) A HTTP 100 basically states "ok based on your headers I won't reject your body data, so send it now" - handy for services which need to check specific headers. Imagine if the client sent 5MBs of data only to have it knocked back because an authorization header wasn't present. :-) I suppose a better solution would be to use the 100-Continue properly (i.e. send headers + with an expect header and no body) or send HTTP/1.0 requests. HTH Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Script under Windows OK, under Linux, not...
Why are you opening the file in append mode? As the manual says: " a+' - Open for reading and writing; place the file pointer at the end of the file." Try using 'r+' instead or rewind the file pointer before reading. Danny. - Original Message - From: "Daniel Page" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, January 25, 2003 11:39 AM Subject: [PHP] Script under Windows OK, under Linux, not... > Hi, > > I have the following code : > > $_fp = fopen("/home/dh2240/mgt/index.php", "a+") or die(); > $_contents = fread($_fp,filesize("/home/dh2240/mgt/index.php")); > fclose ($_fp); > //Menu elements > $_sme = strpos("$_contents","sub_menu_elements"); > echo "sme = $_sme"; > ... > > It should display somthing like "sme = 850", after finding the string in the > specified file. > > Under windows, this script works fine (except replacing the > "/home/dh2240/mgt/index.php" by "c:/apache/htdocs/mgt/index.php")... it > seems that the file index.php cannot be opened under linux... > The file is chmod 777, along with the directory /mgt, and the files > identical, but still no luck... The fopen does not die(), but it does not > seem to read any data from the file... I'm confused, and not sure how to > check what is happening... Anyone got any ideas ? > > Cheers, > Daniel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Framework
Well, Yahoo! have moved/are moving to Smarty and they get a few million views a day. The killer part with smarty is that it converts the Smarty tags, in your template, to real PHP code - that's what makes it so fast. It's also very easy to extend. Danny. - Original Message - From: "John Wards" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 2:41 PM Subject: Re: [PHP] PHP Framework On Monday 03 Feb 2003 2:01 pm, karthikeyan.balasubramanian wrote: > Hi All, > > I finally decided to upgrade my PHP. Just want to know your thoughts on > which Framework is the best with a clear seperation of content from > presentation. > > Please let me know which do you think is the best and why? I use SMARTY (smarty.php.net) and think its the dogs bolxs. Its fast, its easy to use. The template pasing language is simple. My site gets somewhere in the region on 100,000 p.v.s a day and it copes easily. But, there is a pertender lurking in the shadows. phorum.org, yes its a message board. But phorum 5 which is not pre alpha yet has its own built in templating system which I thnk with a bit of tweaking could be used as a full blown templating system. John -- 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] Attaining NTLM information from IE browsers.
There is actually an NTLM Auth module available for Apache. (http://modntlm.sourceforge.net/). If you really need to do it though PHP I'd suggest running a packet sniffer to see what headers IIS sends and what to expect back from IE. HTH Danny Shepherd. - Original Message - From: "Marriner, Bruce W." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, February 08, 2003 6:39 PM Subject: [PHP] Attaining NTLM information from IE browsers. I know this is in the archives, but I couldnt seem to find the answer I needed. I am running redhat8, apache 2.0.44, and php 4.2.2. I am trying to write a script that will emulate the IIS server and request NTLM auth. from the browser. And then decode the base64? information and compate the user information against a ldap function that connects to a active directory server. I know that you must modify the header with the header() command. I have done that, and the most I get in one line of information back from the browser. There is suppose to be three lines of encoded information sent back. If anyone has any code or knows the complete hand shake or anything really, I would really like the help. This is a really big project at my company, and they are considering moving to a linux platform and even PHP. But if I can't make the same stuff work that their w2k cold fusion platform does. It's not going to work so well. -- 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] What's the scoop on PHP 5?
The latest cvs snapshots for PHP4.3.x and PHP5.0.x can be found at http://snaps.php.net Danny. - Original Message - From: "Leif K-Brooks" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, February 13, 2003 8:50 PM Subject: [PHP] What's the scoop on PHP 5? > Anyone know what the status of PHP 5 is? I can't find reference of it > on php.net, and the only place I can find an alpha of it is at the PHP > Museum. > > -- > The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Finally!!! A workaround to mail() in PHP...
I'd say an even simpler workaround would be to add '[EMAIL PROTECTED]' as the fifth parameter to the mail function - just as in example 3 of the docs. Danny. - Original Message - From: "Scott Fletcher" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, February 19, 2003 3:43 PM Subject: [PHP] Finally!!! A workaround to mail() in PHP... > Finally a workaround to the problem in mail() in PHP I did the posting > somewhere, so I'll cut to the chase by posting it here My recent > posting does not work too well > > --clip-- > This is for any Unix or Linux machine using the Sendmail. However, no > guarentee that it would work in Windows. > > Some SMTP won't accept e-mail with the "From: host@domain" without the > suffix "com", like "domain.com", so using the "From: [EMAIL PROTECTED]" option > in the $header in the mail() does not solve the problem for me. > > Someone suggest using the php.ini with the configuration by adding the "-f > [EMAIL PROTECTED]" to the sendmail path. Example look like this > > --clip-- > sendmail_path = /usr/sbin/sendmail -t -i -f [EMAIL PROTECTED] > --clip-- > > This is not an option for me because it is limit to one user, not more than > one and it override the "From: [EMAIL PROTECTED]" option in the $header in > mail().. So, Finally there is a workaround to the problem and it is very > simple Just add this entrie to the /etc/hosts file in Unix or Linux. > Just substitute the word in bracket for a value > --clip-- > > --clip-- > > Example ... > --clip-- > 123.456.789.012 xyz.abc.com > --clip-- > > Make sure your machine do the search order with the host first before the > DNS or Nameserver. In my case in AIX, is "/etc/netsvc.conf". > > Hope > > Make sure your machine is set to read the host file first before the DNS or > the nameserver, if not then make some changes to it. In my case for AIX, it > is "/etc/netsvc.conf"... > > Hope this help > --clip-- > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Capitalising Personal Names
Hi, Well it's hardly rocket science - a flick through the manual and I came up with : $name=ucwords(strtolower($name)); HTH Danny. - Original Message - From: "Geoff Caplan" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 28, 2003 10:31 AM Subject: [PHP] Capitalising Personal Names > Hi folks, > > I need to clean up the capitalisation of user-entered personal names. > > Once you start thinking about it, you realise it is a non-trivial > issue, but previous discussions on the list presented only very > partial solutions. > > In Perl, there are Cpan modules such as namecase and nameparse which > handle this quite well. Does anyone have anything similar in PHP? > > Thanks > -- > > Geoff Caplan > Advantae Ltd > > > -- > 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] Constants and "Here Document" Interpolation
Hello, It doesn't look like it - a note in the constants manual entry reads: "PHP has no way of recognizing the constant from any other string of characters within the heredoc block" Danny. -Original Message- From: Daniel R. Hansen [mailto:[EMAIL PROTECTED] Sent: 01 March 2003 15:57 To: [EMAIL PROTECTED] Can anyone tell me if it is possible (and how) to use defined constants within "here document" content? I've not been successful finding anything on this in the online docs. Thanks! Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem connecting to POP3 accounts
Try: $strMailServer = "{domain.co.uk:110/pop3}INBOX"; As per the manual. HTH Danny. -Original Message- From: Alec Wallis [mailto:[EMAIL PROTECTED] Sent: 03 April 2003 18:35 To: [EMAIL PROTECTED] Hi I am currently experiencing some problems connecting to POP3 accounts using imap_open. I am using the following code: $ArrayImap = imap_open ($strMailServer, $strUsername, $strPassword); with the mail server being set to: $strMailServer = "{domain.co.uk/pop3:110}INBOX"; It seems to connect ok, as if an incorrect username or password is entered incorrectly something different happens. The error message I seem to get is: Notice: (null)(): Mailbox is empty (errflg=1) in Unknown on line 0 PHP Notice: (null)(): Mailbox is empty (errflg=1) in Unknown on line 0 When I view the mailbox in Outlook it has messages in it and so isn't empty. Can anyone help me please? Alec -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble
Try building apache2 and modphp4 using the FreeBSD ports system - that's how I compiled and it works fine here. HTH Danny. Apache2.0.39/PHP4.2.2/FreeBSD4.6 - Original Message - From: "Chad Day" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 5:38 PM Subject: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble > Simple build, no real complicated configure options > (--with-mysql, --with-apxs2..) .. > > During make: > > php_functions.c:93: syntax error > *** Error code 1 > > Stop in /usr/local/php-4.2.2/sapi/apache2filter. > > etc > etc > > > Any idea what the problem would be? I googled around for a little and heard > there might be problems getting the latest php to work with apache 2.0.39, > but that was a couple weeks ago.. I thought the new 4.2.2 build might > address it, but I guess if it's only a security fix like the site says, > maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something > else amiss? > > Thanks, > Chad > > > -- > 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] Array variable in Javascript & PHP
Try using: Education Profession That's what I used when doing something pretty similar to you. HTH Danny. - Original Message - From: "Sheni R. Meledath" <[EMAIL PROTECTED]> To: "PHP Masters" <[EMAIL PROTECTED]> Sent: Monday, July 29, 2002 4:11 PM Subject: [PHP] Array variable in Javascript & PHP > Hello: > > In a form I am using a series of check boxes for a number of lists. Some > calculations has to be done on the client side using Javascript depending > upon the check box values. For this I am using a single variable name > (array) for the check boxes in a list and another for the next list and so > on. The format I have used is > > Education > > Profession > > I can access these variables from Javascript as list1[0] & list1[1]. > (document.form.list1['0'].checked & document.form.list1['1'].checked > > But when this form is submitted to the PHP script I am getting only the > last value. list1 = 'Profession'. I am not getting an array of values. > for ($i=0; $i { > $listall .= '$list1[$i],'; > } > ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PostgreSQL
Checkout this FAQ - http://www.ejip.net/faq/postgresql_win_setup_faq.jsp HTH Danny. - Original Message - From: "1LT John W. Holmes" <[EMAIL PROTECTED]> To: "Richard Lynch" <[EMAIL PROTECTED]>; "Hadi" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Monday, July 29, 2002 2:24 PM Subject: Re: [PHP] Re: PostgreSQL > > I don't *think* PostgreSQL runs under Windows, really... > > > > You can maybe install the CygWin stuff (a Linux emulator under Windows) > and > > get that to "work", but: > > Can anyone confirm that PG will run under CygWin? Will it communicate with > PHP running on Windows, too? I'm just looking for a way to get familar with > PG, nothing production level, so I don't care how slow it is or how often it > crashes... > > Or can PG be compiled for Windows? > > ---John Holmes... > > > -- > 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] Encrypting Passwords - Is it really necessary??
Ok, here's how I do it: 1. User clicks the lost password page: 2. Email is sent to user's registered email address. Email contains a url to the newpassword page and has a validation code. This validation code is also stored in the userinfo table (it's the MD5 of current date + time + random chars). 3. User clicks link and is taken to page. 4. If the supplied validation code checks out, the user gets to pick a new password there and then. 5. If the user didn't want to change the password (i.e.. the abuse scenario you talked of) they simply ignore the email - no change occurs. So : The passwords can be encrypted in the database. The system is difficult to abuse. Passwords are never sent out over email. User gets to choose own password. Well it works for me anyway :) HTH Danny. - Original Message - From: "Monty" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 29, 2002 10:30 PM Subject: [PHP] Encrypting Passwords - Is it really necessary?? > Is it really necessary to store passwords encrypted in a mySQL DB for a > membership site if you're not storing sensitive info such as credit card > numbers? How much security does that offer, really, and for whom? > > The reason I ask is because I'm trying to implement a "forgot password" > feature on a membership site. But if I store passwords encrypted, I can't > just send the password to their e-mail address, I have to generate a new one > before sending it, which essentially locks that member out of the site until > they get their new password. This has the potential to be abused by a > vindictive person. All they need to know is the member's username or e-mail > address and they can keep re-generating new passwords (locking the member > out of their own account) for a member to annoy them. > > If the password wasn't encrypted, I could just e-mail their existing > password. The only annoyance then would be someone sending this password > over and over to another user, but, at least they won't get 20 new passwords > and be locked out of their account as a result. > > If anyone else has dealt with this issue, I'd appreciate your insight. > > Thanks! > > Monty > > > -- > 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] Sessions - Informed Opinions
Hello All, So, I've been using my own implementation of session handling which is mainly storing the userinfo in a cookie (an array, serialised and signed) but I'm starting to come around to the idea of storing this info on the server and just passing a session key about - but I have a couple of reservations, which I'm hoping someone can confirm or resolve : Assuming that sessions are stored on the filesystem by default: 1 How secure is this? Could someone with system level access simple wander into the session store directory and start browsing though the session data? 2 Are expired sessions removed from the filesystem automatically? How often is this garbage collection performed? 3 How can I get a count of currently active (I.e non expired) sessions? 4 Are there any performance issues to worry about doing it this way? 5 Is it quicker to do it this way or store sessions in a db using session_set_save_handler? Like the subject says, I'm after informed opinions on this subject rather than rumours and hearsay. As for my setup - it's a BSD box - Apache2.0.39 + PHP4.2.2 (apache module) + PHP4.3.0dev-Zend2alpha2 (cgi) - both compiled with pretty much everything. Thanks a lot people, Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apache and php
For release systems, the recommended setup is Apache 1.3.26 + PHP4.2.2 The developer systems, I'd go for (indeed have gone for) Apache 2.0.39 + PHP4.2.2 HTH Danny. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 11:01 AM Subject: [PHP] apache and php > Hello, > > Which version of apache and which version of php are good for work > together ? > > Thank for your help... > > Edward. > > > > -- > 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] Sessions - Informed Opinions
<< Comments inline >> - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Cc: "PHP-General" <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 11:24 AM Subject: Re: [PHP] Sessions - Informed Opinions > > Assuming that sessions are stored on the filesystem by default: > > 1 How secure is this? Could someone with system level access simple > > wander into the session store directory and start browsing though the > > session data? > > Well, at least as secure as passing this stuff out across the Internet to > random clients where anybody can steal these cookies and present them back > to you in a spoof attack. > Fair enough > > 2 Are expired sessions removed from the filesystem automatically? How > > often is this garbage collection performed? > > Sure. You configure it. See php.ini > > > 3 How can I get a count of currently active (I.e non expired) sessions? > > Count the number of session files. Can I be sure that the count will only include active sessions though? > > > 4 Are there any performance issues to worry about doing it this way? > > Not really > > > 5 Is it quicker to do it this way or store sessions in a db using > > session_set_save_handler? > > Should be slightly quicker if your database is nice and fast and your > schema is sane. Great > > > As for my setup - it's a BSD box - Apache2.0.39 + PHP4.2.2 (apache module) + > > PHP4.3.0dev-Zend2alpha2 (cgi) - both compiled with pretty much everything. > > Why in the world are you running Apache2? You are not running it threaded > anyway (since you are on FreeBSD) so you are not gaining any of the > threaded scalability that is Apache2's only real selling point right now. > You are running code that acts just like Apache 1.3.x except it is much > less stable (at least with PHP). Can't say I've really noticed any stability issues - even with PHP (there was that multiple cookie bug but even so). It's a dev box (the release boxes all use Apache1.3.x) and TBH, I was playin' about some of Apache2's other features, such as the dynamic vhosting, which might be useful to me later. Thanks for the reply though, Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] apache and php
- Original Message - From: <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 11:30 AM Subject: Re: [PHP] apache and php > Danny Shepherd wrote: > > > For release systems, the recommended setup is Apache 1.3.26 + PHP4.2.2 > > They are good for work under Linux RedHat ( 6.x / 7.x ) system ? > Yeah, should be Ok. Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions - Informed Opinions
- Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Cc: "PHP-General" <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 11:52 AM Subject: Re: [PHP] Sessions - Informed Opinions > > > > 3 How can I get a count of currently active (I.e non expired) > > sessions? > > > > > > Count the number of session files. > > Can I be sure that the count will only include active sessions though? > > By definition, if the session file is there, it is an active session. > There is no such thing as counting active users on the Web. You define a > time window and count how many users accessed your site within that > window. Once a session has been idle for a time > than the configured > session gc time, it will get deleted. I tend to do this out of band > though. PHP has a mechanism for calling the session gc code, but I prefer > to turn this off and run my own cron job that does this regularly. And > yes, this is easier to manage if you have a database where you can do a > simple count() query to get the number of active sessions. Right, db sessions seem to be the way for me, thanks Rasmus. (Oh, thanks for PHP too :) Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Serialised Data & DBs
Hi, Is it necessary to perform addslashes() on serialised data before inserting it into a database? Thanks, Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Serialised Data & DBs
- Original Message - From: "1LT John W. Holmes" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]>; "PHP-General" <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 8:18 PM Subject: Re: [PHP] Serialised Data & DBs > Yes, it'd be really smart to. If any of the data in the serialized string > has a ' or " in it, it could break your query. Or the user being able to > enter a ' or " into the data could open you to SQL attacks. > > You want to do addslashes() on the result of serialize(), not the content > going into it, too. PHP will introduct double quotes around any strings that > are serialized. These should be escaped or they could end up breaking your > query. Yeah, the contents are already stripslashed. > Note that you don't have to do stripslashes() on the serialized string when > you pull it out. Cool, didn't realise that - would've been hard to track down later too! Thanks, Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Trouble Making 4.2.2
I think your actual error is much further up - the sapi appears because you're building PHP as an Apache module. The actual error will have a (kind of) English description - post that along with your config options and a more detailed description of your setup and maybe we can help. Danny. - Original Message - From: "David Busby" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 8:16 PM Subject: [PHP] Trouble Making 4.2.2 > List, > I get this after make installis this thing trying to make sapi? I > want to run on Apache/RH7.3 so I don't know if I need it...couldn't find > how to turn in with ./configure. Please help > > TIA > /B > > > make[1]: Leaving directory `/usr/src/php-4.2.2/regex' > Making install in . > make[1]: Entering directory `/usr/src/php-4.2.2' > make[1]: *** [install-sapi] Error 1 > make[1]: Leaving directory `/usr/src/php-4.2.2' > make: *** [install-recursive] Error 1 > > > > -- > 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] Sessions - Informed Opinions
- Original Message - From: "Tech Support" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 6:44 PM Subject: Re: [PHP] Sessions - Informed Opinions > If you're on a shared system it's very easy for other users on your machine > to read session data. All you have to do is opendir("/tmp") and then > readdir() and copy the files into something you can read. I have programmed > a few commerce sites and this issue has bothered me a few times and with > each new site I find better and more secure methods. Yeah, the whole shared hosting thing has me bothered - until Apache can run as a different user for each vhost (allowing tighter filesystem security on the docroot), I'm steering well clear of the whole situation - thankfully our clients generally own their own boxes :-) > The beauty of sessions in php is that the user does not need to accept > cookies for it to work. If you have --enable-trans-sid, which on by default > in 4.2.X you only need to manually add the session id in two cases: > > 1. you are using a full URL in a form or a link. Even if it's your full URL > php will still assume it's off site and thus not append the session id to > the query string. > > 2. You use a header redirect (relative or full URL) > > I use mysql to store session data via session_set_save handler in favor of > file type. It took me a long time to find code that worked because the > documentation is not as clear as it could be. I found some code that half > way worked but it would seg fault apache on my system so I search message > boards and asked questions until I found the problem. I now have a set of > functions that work great. Anyway, what I'm getting at is that, if you want > it, I would be happy to share it with you. Thanks for the offer but guess what I've just finished doing? :-) I'll agree that the docs were well flaky though! Thanks, Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Public Scripts in a commercial product
- Original Message - From: "David Freeman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 30, 2002 6:09 AM Subject: RE: [PHP] Re: Public Scripts in a commercial product > > > Yes, I am afraid that regarding GPL I have to agree with > > Microsoft when they say it is a cancer. The problem is that if you > want to > > distribute something that incorporates GPL licensed components, your > > software also needs to be distributed as GPL and so it gets > contaminated. > > This means that you can't sell your closed source software if you > > incorporate GPL components. > > I'm quite happy to be corrected on this but I have always understood GPL > licensing to mean that any GPL code you include should be available in > source version. The methods by which you use that GPL code doesn't > necessarily have to be included. The only relevant example I can think > of is if you include a class in php that is GPL then you have to > distribute the source even if you compile it with zend for your own > application. > > It is my understanding, in this situation, that you aren't necessarily > required to release the code you have written as GPL though. Basically, > I thought that once something is GPL it is pretty much public forever > but that doesn't stop you from including it in your own proprietory work > as long as you include the source for the GPL stuff. Unfortunately, you are required to release your entire project as GPL if you use GPL'd components - the GPL licence is quite clear. Quoted from section 2 of the GPL: (http://www.gnu.org/licenses/gpl.txt) "b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License." I think you're thinking of the much less restrictive LesserGPL (LGPL) which requires you to make the source available for the LGPL components and any changes you've made to those components but doesn't require you to release the entire project. Like most people I know, I'm totally against the GPL license and totally for Apache/BSD and LGPL licenses. HTH Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Disabling Browser "BACK" button
On processing page (I.e the form's action page - where the stuff is entered into the db) set another session var so that your app knows that the form has been submitted, data entered etc. The actual form page should have some extra logic at the top which checks for this extra session var, redirecting to an 'already done this' page if the var is set. I suppose this logic should also exist in the action page, in case the user hits back and browser reposts the data. Example: 1. User fills out form on 'form.php' and hits submit - browser loads 'action.php' 2. action.php checks for $_SESSION['formIsFilled'] and redirects if found, enters data into db otherwise. 3. user hits back and goes back to form.php - if browser has cached then user will be able to resubmit but will be caught at step2. If the browser didn't cache they'll be caught here. This method will prevent them resubmitting for the length of their session (or until $_SESSION['formIsFilled'] is unset) HTH Danny. - Original Message - From: "Chris Boget" <[EMAIL PROTECTED]> To: "Dan Vande More" <[EMAIL PROTECTED]>; "Petre" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, July 31, 2002 6:53 PM Subject: Re: [PHP] Disabling Browser "BACK" button > > Page1 (fill in data)->Page2(write data, instant redirect to p1, > > unless dies from php/mysql) > > Then the only way to repost, is to push the forward button. > > Unless, of course, they hit the "Submit" button again and I think > that was the point the original poster was getting at. If the user > cannot hit the back button, they cannot hit submit again. > > Chris > > > > -- > 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] Form asking to refresh when I hit the back button
This is generally caused by using POST as the form's methods. Try using GET instead. Danny. - Original Message - From: "DonPro" <[EMAIL PROTECTED]> To: "php list" <[EMAIL PROTECTED]> Sent: Thursday, August 01, 2002 3:57 PM Subject: [PHP] Form asking to refresh when I hit the back button > Not sure if this is a PHP question but I've traced the problem to a PHP > statement. > > I have a form that when submitted, displays a PDF document in the browser > (using a PDF library). When I click on the back button, it should redisplay > my form but instead, displays a warning that data has expired and I need to > refresh. Now this never happened until recently so I look at recent changes > and traced the problem to one single PHP statement at the top of my file: > > session_start(); > > I am using sessions to pass values between pages and so added the statement > to my page so that I could check the value of a variable. When I comment > out the above statement, I am no longer prompted to refresh. > > Question: How can I have my cake and eat it to? > > Thanks, > Don > > > > -- > 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] web services and PHP
I think he means XML WebServices (probably using SOAP) It's not too difficult, there are a few SOAP classes for PHP now, simply send your SOAP encoded request to the server, via HTTP, and decode the SOAP response that you get back. There's also a SOAP module for PHP (alpha release atm) at http://phpsoaptoolkit.sourceforge.net/phpsoap/ If you're after an all in 1 solution you might want to look at nusoap - but it was really buggy the last time I used it, so I don't recommend it at this time. I've heard something about another all in 1 solution that's quite promising - but it's behind closed doors atm. Danny. - Original Message - From: "Bob Lockie" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 01, 2002 4:09 PM Subject: Re: [PHP] web services and PHP > > >A'la ASP WebServices perhaps? > > > >"Bob Lockie" <[EMAIL PROTECTED]> wrote in message > >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> > >> >I'd like to know if it's possible to use PHP to develop and implement > >> >Web Services. If so, please point me to sites, articles, or tutorials > >> >that discuss this topic in more detail. Thanks. > >> > >> How do you define web services? > > I know nothing about ASP. > > > > > > > > -- > 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] mcrypt
Just base64 encode the mcrypt output if the non printable chars bother you, though I don't really see what the problem is, unless you're pushing the output to a web page. Danny. - Original Message - From: "Randy Johnson" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, August 01, 2002 4:24 PM Subject: [PHP] mcrypt > I am looking into different password encryption solutions. > > i started using crypt() > > then changed to mcrypt() > > which was not any good cause of the high ascii characters > > then i read about converting the high ascii characters to hex . > > Is this the ideal way to encrypt passwords or is their something better. > > Thanks > > Randy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with "" inside the PHP code, due to "?"
Try: Apple"; echo $XML; ?> HTH Danny. - Original Message - From: "Scott Fletcher" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 01, 2002 5:03 PM Subject: [PHP] Problem with "" inside the PHP code, due to "?" > Anyone know the workaround with the situation here? Here is the sample > script. The problem is I include the XML tag into the PHP variable and it > messed up everything. It all had to do with "?" here since PHP use it also. > > --clip-- > $XML = "Apple"; > echo $XML; > ?> > > Thanks, > FletchSOD > > > > -- > 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] mcrypt
Try setting the database field type to 'BLOB' Danny. - Original Message - From: "Randy Johnson" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, August 01, 2002 4:51 PM Subject: Re: [PHP] mcrypt > I found that the some of the high ascii characters would not store right in > the database or something cause when i went to compare them, the comparison > would fail. > > > Randy > > - Original Message - > From: "Danny Shepherd" <[EMAIL PROTECTED]> > To: "Randy Johnson" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Thursday, August 01, 2002 11:31 AM > Subject: Re: [PHP] mcrypt > > > > Just base64 encode the mcrypt output if the non printable chars bother > you, > > though I don't really see what the problem is, unless you're pushing the > > output to a web page. > > > > Danny. > > > > > > - Original Message - > > From: "Randy Johnson" <[EMAIL PROTECTED]> > > Cc: <[EMAIL PROTECTED]> > > Sent: Thursday, August 01, 2002 4:24 PM > > Subject: [PHP] mcrypt > > > > > > > I am looking into different password encryption solutions. > > > > > > i started using crypt() > > > > > > then changed to mcrypt() > > > > > > which was not any good cause of the high ascii characters > > > > > > then i read about converting the high ascii characters to hex . > > > > > > Is this the ideal way to encrypt passwords or is their something better. > > > > > > Thanks > > > > > > Randy > > > > > > > > > > > > -- > > > 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] attachements in mail()
I've looked, and can not find out how you send attachments using the mail() function. I find it difficult to believe that this was left out, so obviously I'm missing something right in front of my face. So my question is, how do you send attachments using the mail() fucntion? -Danny "You are stupid." Dexter of Dexter's labratory Yes, I watch Dexter ... you got a problem with that! :-) _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: attachements in mail()
Ah ... well that's good. I thought I was just being an idiot. Thanks for the resources, a couple of the classes will do the job nicely. -Danny >From: Philip Hallstrom <[EMAIL PROTECTED]> >To: Danny wall <[EMAIL PROTECTED]> >CC: [EMAIL PROTECTED] >Subject: [PHP] Re: attachements in mail() >Date: Thu, 1 Aug 2002 11:17:37 -0700 (PDT) > >You can't (in the sense that there's an $attachment argument), but I've >seen several classes that will let you do it. Check zend.com and >php.resourceindex.com for the classes. > >On Thu, 1 Aug 2002, Danny wall wrote: > > > I've looked, and can not find out how you send attachments using the >mail() > > function. I find it difficult to believe that this was left out, so > > obviously I'm missing something right in front of my face. > > > > So my question is, how do you send attachments using the mail() >fucntion? > > > > -Danny > > "You are stupid." > > Dexter of Dexter's labratory > > > > Yes, I watch Dexter ... you got a problem with that! :-) > > > > > > _ > > Chat with friends online, try MSN Messenger: http://messenger.msn.com > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -Danny "You are stupid." Dexter of Dexter's labratory Yes, I watch Dexter ... you got a problem with that! :-) _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Readdir
>if ($handle = opendir('/my/directory')) { > echo "Directory handle: $handle\n"; > echo "Files:\n"; > > > > while (false !== ($file = readdir($handle))) { > echo "$file\n"; > } Everything is good, you just to make a slight addition to your echo. echo "$file" -Danny "You are stuupid" Dexter of Dexter's Labratory Yeah, I watch Dexter, you got a problem with that! :-) _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: attachements in mail()
This thing's pretty cool! Thanks! -Danny >From: Manuel Lemos <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: [PHP] Re: attachements in mail() >Date: Thu, 01 Aug 2002 17:43:04 -0300 > >Hello, > >On 08/01/2002 03:14 PM, Danny Wall wrote: >>I've looked, and can not find out how you send attachments using the >>mail() function. I find it difficult to believe that this was left out, >>so obviously I'm missing something right in front of my face. >> >>So my question is, how do you send attachments using the mail() fucntion? > >Try this class as it does exactly what you want and probably more. Besides >attachments (multipart/mixed), it is also capable of sending >multipart/related messages to let you compose HTML messages with images and >other embedded files, and multipart/alternative to let you compose messages >with alternative text and HTML versions in the same message body. > >http://www.phpclasses.org/mimemessage > > >-- > >Regards, >Manuel Lemos > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -Danny "You are stupid." Dexter of Dexter's labratory Yes, I watch Dexter ... you got a problem with that! :-) _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Hosting
Take a look at this directive : http://www.php.net/manual/en/configuration.php#ini.open-basedir Danny. - Original Message - From: "Matt Babineau" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 02, 2002 2:04 PM Subject: [PHP] PHP Hosting > If any PHP hosts are out there I have a question: > > How do you keep users from erasing / altering files out side of their > web folder with PHP? Doesn't PHP run in the system user context? Is is > possible to prevent a user from using PHP to alter anything but in their > Web folder? > > Matt Babineau > MCWD / CCFD > - > e: <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED] > p: 603.943.4237 > w: <http://www.criticalcode.com/> http://www.criticalcode.com > PO BOX 601 > Manchester, NH 03105 > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Include php code as variable
http://www.php.net/eval - Original Message - From: "Alawi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 11:41 AM Subject: [PHP] Include php code as variable > How can I Include my php code code as variable and excute it ? > > > -- > 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] string questions
Try, list($test)=explode(' ',$address); HTH Danny - Original Message - From: "webmaster" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, August 02, 2002 5:35 PM Subject: [PHP] string questions > I know there has to be an easy way to do this, but I just can't find the > answer. I need to strip out the first part of a text string. I've > figured out out to strip out the last part of a string using the > following: > > $address = (4455 N. 45th St.); > > $test = strstr($address, " "); > echo $test; > > The variable $test returns N. 45th St. without the 4455. Is there a way > to reverse this so I can just return 4455? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] what is equivalent to Response.End ?
http://php.net/die http://php.net/exit Both will stop your code. Dead. Danny. - Original Message - From: "Ing. Rajesh Kumar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 3:50 PM Subject: [PHP] what is equivalent to Response.End ? > Hi everybody > Can someone tell me what is the PHP equivalent code to ASP's Response.End ? > I want to stop my code at a given position so i need this. > > thanks in advance > Raja > > > > > -- > 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] RegEx (back referencing)
try \\1 - Original Message - From: "Phil Ewington" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 5:03 PM Subject: [PHP] RegEx (back referencing) > Hi, > > I am am writing a function to color code and indent JavaScript source using > regular expressions and cannot seem to get back referencing working. The > pattern match is successful but the output is a single unrecognised > character (a square). > > $string = eregi_replace("<(/?)(scr[^>]*)>", "«font color=maroon»\1«/font»", > $string); > > This results in opening and closing tags being replaced > with a square being wrapped in font tags. I have this working in Cold Fusion > but cannot seem to convert my scripts to PHP. Can anyone help? > > TIA > > Phil Ewington. > > > -- > 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] RegEx (back referencing)
If you're trying to get Lots of javascript to look like Lots of javascript then this will be a start $string = eregi_replace('<(/?)(scr[^>]*)>', '<\\1font color="maroon">',$string); This will produce - Lots of javascript - not perfect, but a start. Danny. - Original Message ----- From: "Phil Ewington" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 5:52 PM Subject: RE: [PHP] RegEx (back referencing) > \\1 outputs nothing at all wrapped in font tags and closing tags \ wrapped > in font tags :o( > > > > > -Original Message- > > From: Danny Shepherd [mailto:[EMAIL PROTECTED]] > > Sent: 03 August 2002 17:47 > > To: [EMAIL PROTECTED]; PHP General > > Subject: Re: [PHP] RegEx (back referencing) > > > > > > try > > > > \\1 > > > > - Original Message - > > From: "Phil Ewington" <[EMAIL PROTECTED]> > > To: "PHP General" <[EMAIL PROTECTED]> > > Sent: Saturday, August 03, 2002 5:03 PM > > Subject: [PHP] RegEx (back referencing) > > > > > > > Hi, > > > > > > I am am writing a function to color code and indent JavaScript source > > using > > > regular expressions and cannot seem to get back referencing working. The > > > pattern match is successful but the output is a single unrecognised > > > character (a square). > > > > > > $string = eregi_replace("<(/?)(scr[^>]*)>", "«font > > color=maroon»\1«/font»", > > > $string); > > > > > > This results in opening and closing tags > > being replaced > > > with a square being wrapped in font tags. I have this working in Cold > > Fusion > > > but cannot seem to convert my scripts to PHP. Can anyone help? > > > > > > TIA > > > > > > Phil Ewington. > > > > > > > > > -- > > > 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] RegEx (back referencing)
What does the input string contain? What does the output look like? It might be a problem with php4.0.4 (I'm using 4.2.2) - why such an old version? Danny. - Original Message - From: "Phil Ewington" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 6:23 PM Subject: RE: [PHP] RegEx (back referencing) > Danny, > > It still doesn't work, could this be a problem in 4.0.4pl1 ?? > > > > > -Original Message- > > From: Danny Shepherd [mailto:[EMAIL PROTECTED]] > > Sent: 03 August 2002 18:11 > > To: [EMAIL PROTECTED]; PHP-General > > Subject: Re: [PHP] RegEx (back referencing) > > > > > > If you're trying to get Lots of javascript to look like > > Lots of javascript then this will be a start > > > > $string = eregi_replace('<(/?)(scr[^>]*)>', '<\\1font > > color="maroon">',$string); > > > > This will produce - Lots of javascript > color="maroon"> - not perfect, but a start. > > > > Danny. > > > > - Original Message - > > From: "Phil Ewington" <[EMAIL PROTECTED]> > > To: "Danny Shepherd" <[EMAIL PROTECTED]> > > Sent: Saturday, August 03, 2002 5:52 PM > > Subject: RE: [PHP] RegEx (back referencing) > > > > > > > \\1 outputs nothing at all wrapped in font tags and closing > > tags \ wrapped > > > in font tags :o( > > > > > > > > > > > > > -Original Message- > > > > From: Danny Shepherd [mailto:[EMAIL PROTECTED]] > > > > Sent: 03 August 2002 17:47 > > > > To: [EMAIL PROTECTED]; PHP General > > > > Subject: Re: [PHP] RegEx (back referencing) > > > > > > > > > > > > try > > > > > > > > \\1 > > > > > > > > - Original Message - > > > > From: "Phil Ewington" <[EMAIL PROTECTED]> > > > > To: "PHP General" <[EMAIL PROTECTED]> > > > > Sent: Saturday, August 03, 2002 5:03 PM > > > > Subject: [PHP] RegEx (back referencing) > > > > > > > > > > > > > Hi, > > > > > > > > > > I am am writing a function to color code and indent > > JavaScript source > > > > using > > > > > regular expressions and cannot seem to get back referencing working. > > The > > > > > pattern match is successful but the output is a single unrecognised > > > > > character (a square). > > > > > > > > > > $string = eregi_replace("<(/?)(scr[^>]*)>", "«font > > > > color=maroon»\1«/font»", > > > > > $string); > > > > > > > > > > This results in opening and closing tags > > > > being replaced > > > > > with a square being wrapped in font tags. I have this > > working in Cold > > > > Fusion > > > > > but cannot seem to convert my scripts to PHP. Can anyone help? > > > > > > > > > > TIA > > > > > > > > > > Phil Ewington. > > > > > > > > > > > > > > > -- > > > > > PHP General Mailing List (http://www.php.net/) > > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RegEx (back referencing)
Ok, a very slightly modified version of your first attempt should work then $fcontent = eregi_replace("<(/?)(scr[^>]*)>", "«font color=maroon»\\0«/font»", $fcontent); Note the \\0 instead of \\1 HTH Danny. - Original Message - From: "Phil Ewington" <[EMAIL PROTECTED]> To: "Danny Shepherd" <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 8:54 PM Subject: RE: [PHP] RegEx (back referencing) > Danny, > > OK, the input string is the contents of a file, the idea is to output color > coded and indented code in HTML. So searching for and replace with > <font color=maroon><script></font>, so the <script> tag shows on a page. I > am slowly converting a ColdFusion script which currently color codes CFML, > HTML, JS & PHP code. > > // get file and pass into string > $filename = "/path_to_file/newsfeed.js"; > $fcontent = implode("", file($filename)); > > // convert new lines, tabs and multiple spaces > $fcontent = eregi_replace(chr(10), "«br»", $fcontent); > $fcontent = eregi_replace(chr(9), " ", $fcontent); > $fcontent = eregi_replace(" {2,2}", " ", $fcontent); > > // color code script > $fcontent = eregi_replace("<(/?)(scr[^>]*)>", "«font > color=maroon»\\1«/font»", $fcontent); > > // allow html tags in strings to print > $fcontent = eregi_replace("[^('|\")]<br>[^('|\")]", "«br»", $fcontent); > > // allow script tags to display > $fcontent = eregi_replace("<", "<", $fcontent); > $fcontent = eregi_replace(">", ">", $fcontent); > $fcontent = eregi_replace("«", "<", $fcontent); > $fcontent = eregi_replace("»", ">", $fcontent); > > > // get filename from path > $filename = explode("/", $filename); > $filename = $filename[count($filename) - 1]; > > // print formatted content > print "\n > <div> > <div style=\"font-family:verdana; font-size:x-small; color:#FF; > background-color:#00; padding:5px;\">$filename</div> > <div style=\"font-family:courier new, mono; font-size:x-small; > background-color:#EE; padding:10px; border:1px #00 > solid;\">$fcontent</div> > </div>"; > > ?> > > The output looks as follows (so far)... > <A HREF="http://www.n-igma.net/regex.php">http://www.n-igma.net/regex.php</A> > > Got the indenting sorted, now needs to be color coded. > > I am using an old version as I know very little about *nix and compiling the > binaries for PHP on a RAQ3 was a headache, well for a Windows user any way > ;o) I have not wanted to upgrade yet as I have a number of sites running on > the box and haven't had the balls to in case I screw it up again! > > > Phil. > > -Original Message- > > From: Danny Shepherd [<A HREF="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>] > > Sent: 03 August 2002 18:26 > > To: [EMAIL PROTECTED]; PHP General > > Subject: Re: [PHP] RegEx (back referencing) > > > > > > What does the input string contain? > > > > What does the output look like? > > > > It might be a problem with php4.0.4 (I'm using 4.2.2) - why such an old > > version? > > > > Danny. > > > > - Original Message - > > From: "Phil Ewington" <[EMAIL PROTECTED]> > > To: "PHP General" <[EMAIL PROTECTED]> > > Sent: Saturday, August 03, 2002 6:23 PM > > Subject: RE: [PHP] RegEx (back referencing) > > > > > > > Danny, > > > > > > It still doesn't work, could this be a problem in 4.0.4pl1 ?? > > > > > > > > > > > > > -Original Message- > > > > From: Danny Shepherd [<A HREF="mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED]</A>] > > > > Sent: 03 August 2002 18:11 > > > > To: [EMAIL PROTECTED]; PHP-General > > > > Subject: Re: [PHP] RegEx (back referencing) > > > > > > > > > > > > If you're trying to get <script>Lots of javascript > > to look like > > > > Lots of javascript then this will > > be a start > > > > > > > > $string = eregi_replace('<(/?)(scr[^>]*)>', '<\\1font > > > > color="maroon">
Re: [PHP] Re: Protect PHP coding
So, go write JSP for someone then and stop bugging us. - Original Message - From: "Acer" <[EMAIL PROTECTED]> To: "Scott" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, August 03, 2002 10:48 PM Subject: RE: [PHP] Re: Protect PHP coding > Scott wrote: > > You're kidding, right? When was the last time you saw one the creator of > > ASP on a mailing list personally answering code questions? > > Call me a cynic but to maintain your status as php god you have to > contribute to the list so you can sign a book deal. > > Scott wrote: > > For what it's worth, I just left a 50,000 employee company that would not > > let me use PHP in production until I showed them the Zend suite of > > products. When I asked for the money to buy their IDE and it arrived I > > was allowed to move my PHP code to production. > > So zend charges a huge amount of money so that your boss can feel good about > making the right decision. That's great but how's that working? Is php > becoming a contender? Like I said before do a search for php developers, > you won't find any demand for it. Jsp is newer then php and they have a lot > more jobs available so something isn't working. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] In version 4.2.1 ereg_replace break Apache
Have you tried it on a non debug build? Danny - Original Message - From: "Marcello Lupo" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 8:14 PM Subject: [PHP] In version 4.2.1 ereg_replace break Apache > ## A simple function to remove consonant ## > $temp="thisisatry"; > $temp=ereg_replace("[BCDFGHJKLMNPQRSTVWXYZ]","",$temp); > echo $temp; > > > I get : > > [Mon Aug 12 18:13:29 2002] [notice] child pid 16363 exit signal Segmentation > fault (11) > FATAL: emalloc(): Unable to allocate 1087156712 bytes > > In apache logs. > > > THis is my configure line: > > './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--enable-debug' > '--enable- calendar' '--enable-ftp' > '--with-imap=../imap-2001.BETA.SNAP-0107022325' '-- with-mcrypt' > '--with-mhash' '--with-mysql=/usr' '--enable-memory-limit' '-- > enable-track-vars' '--with-zlib' '--with-pdflib' > '--with-ttf=/usr/local/include' '-- with-jpeg-dir=/usr' > '--with-tiff-dir=/usr' '--with-system-regex=yes' '--with-gettext' > '--with-openssl' '--with-fdftk' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] dates greater than 2002-01-18 create error
It's a fairly well known problem now but I'm sure we'll all be using (at least) 64bit integers for storing this sort of stuff by 2038. FYI, the current 32bit signed int allows for around 68years - a 64bit signed int will give us a few billion years :) Danny. - Original Message - From: "John Wards" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 5:32 PM Subject: Re: [PHP] dates greater than 2002-01-18 create error > right am i missing something or is that not just an other Y2K "bug" waiting > to happen? > > Not that I plan to be coding php in 2038 but my kids might be.:-P > > John > - Original Message - > From: "Adam Voigt" <[EMAIL PROTECTED]> > To: "Jay Blanchard" <[EMAIL PROTECTED]> > Cc: <[EMAIL PROTECTED]> > Sent: Monday, August 12, 2002 5:26 PM > Subject: RE: [PHP] dates greater than 2002-01-18 create error > > > > Dude, did you read the PHP Date manual page? > > > > I quote: > > > > Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901 > > 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that > > correspond to the minimum and maximum values for a 32-bit signed > > integer). On windows this range is limited from 01-01-1970 to > > 19-01-2038. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whois...
http://phpbuilder.com/snippet/download.php?type=snippet&id=1086 - This one works pretty well - checks most domain (everything except .tv and such) HTH Danny. - Original Message - From: "David Freeman" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, August 12, 2002 11:32 PM Subject: RE: [PHP] Whois... > > > I'd like to implement on my web site an "whois" to know the > > information about a domain name (.com, org, ) > > There's an article about doing exactly this on devshed > (www.devshed.com/Server_Side/PHP/) that you could have a look at. Looked > like a pretty complete solution when I went looking for this yesterday > and found the article. > > CYA, Dave > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Why isn't there much info on apache2?
Apache 2 isn't officially supported yet. If you get the latest version of both then you shouldn't hit to many hurdles but you should know that you'll get no official support and it isn't recommended for production environments. If you need Apache2 then you'll know why - if you don't know what the advantages are, you'll probably be better off with Apache 1.3.26 anyway. Danny. - Original Message - From: "pierre.samson" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 20, 2002 4:00 PM Subject: Re: [PHP] Why isn't there much info on apache2? > Any particular reason... future plans or is apache2 is not worthy? > "Adam Williams" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Yeah, apache 2.0 and php don't like each other. > > > > Adam > > > > On Fri, 20 Sep 2002, pierre.samson wrote: > > > > > I'm building a new server and would like to use: > > > php4 > > > apache 2.xxx > > > mod_ssl > > > MySQL > > > mod_perl > > > > > > Is there any major hurdle? > > > > > > Thanks > > > > > > Pierre B. Samson > > > CAMBAR > > > > > > > > > > > > > > > > > > -- > 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 isn't there much info on apache2?
Mod_ssl is part of the standard Apache2 distro now. - Original Message - From: "Jesse Cablek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 20, 2002 4:22 PM Subject: RE: [PHP] Why isn't there much info on apache2? > "Adam Williams" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > e.ms.us... >> Yeah, apache 2.0 and php don't like each other. >> >> Adam >> >> On Fri, 20 Sep 2002, pierre.samson wrote: >> >>> I'm building a new server and would like to use: >>> php4 >>> apache 2.xxx >>> mod_ssl >>> MySQL >>> mod_perl >>> >>> Is there any major hurdle? >>> mod_ssl is also incompatible with apache 2.x according to www.modssl.org Well, unless they hide the 2.x compatible version. Plus mod_perl as far as I know has completely changed, so if you have old mod_perl scripts they gotta convert. Start here: http://perl.apache.org/docs/2.0/user/overview/overview.html -jesse -- 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] Elliptic curve cryptology
http://www.amazon.com/exec/obidos/ASIN/1884777694/102-5129419-0804910 - Original Message - From: "EjdeR" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, September 22, 2002 11:12 AM Subject: [PHP] Elliptic curve cryptology > i cant find any example about "Elliptic curve cryptology".. do you have any > example? i cant understand without an example :) > > > > > -- > 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] John W. Holmes : User aborting a download and counting the filesize
I will give it a try and let you know what the results where..
Re: [PHP] OOP-related question
Hello, Adding the following as the first line of overall->load() should solve your problem. global $$class; HTH, Danny. - Original Message - From: "Tularis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 14, 2002 8:18 PM Subject: [PHP] OOP-related question > Hey, > I have the following script: > class overall { > > function overall(){ > $this->loaded['overall'] =1; > > function load($class){ > > $$class = new $class; > $this->loaded[$class] = 1; > > $$class->setup(); // Run constructor > > if(!is_object($$class)){ > return false; > } > return true; > } > } > > then I have a few classes, which hold a setup() function as thei > 'constructor'. Then, I do this: > > $overall = new overall; > $overall->load('debug'); > > this should load the debug class. I want it to load to $debug->, but it > won't even load to $overall->debug > > It's not really a *need* to have this, it's just something that will > help me in keeping control over all classes. I don't want to use new > class, because this way it would be easier to 'instruct' the > 'constructor' of those new classes to change the values of the vars to a > specific one, without calling for something weird... > > anyway, it doesn't work, and it doesn't spit out an error either. > Any ideas? > > - Tularis > > > -- > 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] OOP-related question
I think the error is fairly self explanatory here - you can't pass the parameter by reference. Globalising the $$class var will retain scope. Danny. - Original Message - From: "Tularis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 14, 2002 9:29 PM Subject: Re: [PHP] OOP-related question > Ok, I combined both, your tip and Brent's, now I have the following > error, with the following code: > > Fatal error: Cannot pass parameter 1 by reference in > /home/shadowlight/public_html/test/libs/global.lib.php on line 296 > > code: > function load(&$class){ > global $$class; > > $$class = new $class; > $this->loaded[$class] = 1; > > $$class->setup(); // Run constructor > > if(!is_object($$class)){ > return false; > } > return true; > } > } > Danny Shepherd wrote: > > > Hello, > > > > Adding the following as the first line of overall->load() should solve > > your > > problem. > > > > global $$class; > > > > HTH, > > > > Danny. > > > > - Original Message - > > From: "Tularis" > > To: > > Sent: Thursday, November 14, 2002 8:18 PM > > Subject: [PHP] OOP-related question > > > > > > > > >Hey, > > >I have the following script: > > >class overall { > > > > > >function overall(){ > > >$this->loaded['overall'] =1; > > > > > >function load($class){ > > > > > >$$class = new $class; > > >$this->loaded[$class] = 1; > > > > > >$$class->setup(); // Run constructor > > > > > >if(!is_object($$class)){ > > >return false; > > >} > > >return true; > > >} > > >} > > > > > >then I have a few classes, which hold a setup() function as thei > > >'constructor'. Then, I do this: > > > > > >$overall = new overall; > > >$overall->load('debug'); > > > > > >this should load the debug class. I want it to load to $debug->, but it > > >won't even load to $overall->debug > > > > > >It's not really a *need* to have this, it's just something that will > > >help me in keeping control over all classes. I don't want to use new > > >class, because this way it would be easier to 'instruct' the > > >'constructor' of those new classes to change the values of the vars to a > > >specific one, without calling for something weird... > > > > > >anyway, it doesn't work, and it doesn't spit out an error either. > > >Any ideas? > > > > > >- Tularis > > > > > > > > >-- > > >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] Apache 2 and PHP 4.2.3.
In short - looks as if your version of Apache 2 is out of date. You're using a version from 28th June, the PHP dll was built against a version from 3rd September. Danny. - Original Message - From: "Horst Gassner" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 16, 2002 12:06 PM Subject: [PHP] Apache 2 and PHP 4.2.3. > Hi! > > When I am laoding php as module: > LoadModule php4_module c:/php/sapi/php4apache2.dll > > I get the following error: > Apache.exe: module "c:\php4build\snap\sapi\apache2filter\sapi_apache2.c" is not > compatible with this version of Apache (found 20020628, need 20020903). > Please contact the vendor for the correct version. > > What I am doing wrong? > > Thanx in advance > Horst > > > -- > 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: GD 1.5
Actually, GD2 can be compiled (after a patch) to read/write GIFs with LZW compression (the LZW algorithm is the root of the legal iffyness), but (AFAIK) you're only legally allowed to enable it if you live outside the US & Canada. AFAIK only FreeBSD's ports system does this atm. - Original Message - From: "Mako Shark" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, November 15, 2002 7:18 PM Subject: [PHP] Re: GD 1.5 > < he/she should not be using GIF at all!>> > > This is leading me to believe that I can't use GIFs > because of these issues. Is this true? I know now that > Unisys (Unisys?) made a fuss about some compression or > whatever, but someone told me it was still okay to use > old GDs (am I naive? maybe). Is it now considered > piracy to use GIFs at all? Does this mean I have to > switch over to JPGs, even those images that compress > better with GIFs? I just assumed we were still > permitted, what with Jasc and everybody still allowing > it in their products. Is JPEG (or PNG) the way to go? > I hesitate using PNGs since they seem to be the > least-supported out of the 'big three'. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OO Question
Yes, you can do that and yes that's how you do it :) Danny. - Original Message - From: "Jay" <[EMAIL PROTECTED]> To: "Php-General (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, June 10, 2002 5:17 PM Subject: [PHP] OO Question > I was wondering can I create a new Object inside of a different class? > > class One > { > //constructor > function One > { > $this->two = new Two; > $this->test = $this->two->test(); > } > } > > Can you do that? If so is that how you do it? > > Thanks. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ForceType hack with Apache 2?
I ran into this problem too - but there is a conf directive to handle it now (even on FreeBSD, which I use) - http://httpd.apache.org/docs-2.0/mod/core.html#acceptpathinfo Danny - Original Message - From: "a.h.s.boy" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 10, 2002 7:14 PM Subject: [PHP] ForceType hack with Apache 2? > I've built an application framework in PHP that makes heavy use of the > "smart URL" technique for passing variables, which works great with > Apache 1.3.22. I have reports, however, that it breaks under Apache 2.x, > and would like to verify whether or not anyone can confirm this. > > I'm using URLs to pass parameters in the manner of the relatively > well-known method, e.g. > > http://www.server.com/info/display/123/index.php > > with > > >ForceType application/x-httpd-php > > > in the httpd.conf file. It works like a charm (on Linux, anyway). I've > run into problems with it under FreeBSD, but I was forewarned that it > might not work there. > > Another user of the framework, however, just installed Apache 2/PHP > 4.2.1 on Linux, and reports that the "smart URLs" aren't being so smart, > and generate 404s. > > Strangely, the URL > > http://www.server.com/info > > will correctly execute as PHP a script called "info", but > > http://www.server.com/info/display/123 > > will NOT execute the info script, instead looking for a directory path > that doesn't exist, and generating a 404 error. > > Since I don't have Apache 2 installed, I can't test it myself. Has > anyone used this trick (and made it work) with Apache 2? I don't know > whether to blame a fundamental change in Apache 2, or to look for some > other configuration error in the user's system. > > Cheers, > spud. > > > --- > a.h.s. boy > spud(at)nothingness.org"as yes is to if,love is to yes" > http://www.nothingness.org/ > PGP Fingerprint: 7B5B 2E7A FA96 865A D9D9 5D6D 54CD D2C1 3429 56B4 > --- > > > -- > 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] Compare 2 resultsets of db-query
Hi, I've two queries on the same table. They have the following structure: Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY FIELD1 Query2: SELECT FIELD1, COUNT(FIELD2) AS SUB from TABLE WHERE FIELD2=1 GROUP BY FIELD1 Now I want to print a table that prints the values of FIELD1, TOTAL and SUB. Query 1 returns more rows as query 2. Field1 is the same in both queries so I should be able to 'link' the results of both queries together. How do I do this?? Thanks! Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compare 2 resultsets of db-query
Analysis & Solutions wrote: > Hey Danny: > > On Mon, Jun 10, 2002 at 10:09:12PM +0200, Danny Kruitbosch wrote: > >>Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY FIELD1 >>Query2: SELECT FIELD1, COUNT(FIELD2) AS SUB from TABLE WHERE FIELD2=1 >>GROUP BY FIELD1 >> >>Now I want to print a table that prints the values of FIELD1, TOTAL and >> SUB. >> >>Query 1 returns more rows as query 2. Field1 is the same in both queries >>so I should be able to 'link' the results of both queries together. >> > > I'm wondering exactly what you're trying to do. It may be possible to do > in one well crafted query. Why limit the second query only to items where > Field2 = 1? What's in FIELD1 and FIELD2? > > Also, I assume you want each row of your HTML table to have the FIELD1, > TOTAL and SUB fields in them, right? > > --Dan > > FIELD 1 contains IP address pool names (not unique), field2 the status (0 free, 1 leased). So what I try to do is get an overview of the total number of IP adresses in a pool and the number of leased addresses. There's a fourth field that contains the actual address. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Compare 2 resultsets of db-query
Analysis & Solutions wrote: > On Wed, Jun 12, 2002 at 04:54:30PM +0200, Danny Kruitbosch wrote: > >>Analysis & Solutions wrote: >> >>>Hey Danny: >>> >>>On Mon, Jun 10, 2002 at 10:09:12PM +0200, Danny Kruitbosch wrote: >>> >>> >>>>Query1: SELECT FIELD1, COUNT(FIELD2) AS TOTAL from TABLE GROUP BY FIELD1 >>>>Query2: SELECT FIELD1, COUNT(FIELD2) AS SUB from TABLE WHERE FIELD2=1 >>>>GROUP BY FIELD1 >>>> >>FIELD 1 contains IP address pool names (not unique), field2 the status >>(0 free, 1 leased). So what I try to do is get an overview of the total >>number of IP adresses in a pool and the number of leased addresses. >>There's a fourth field that contains the actual address. >> > > 0 and 1 in FIELD2? That makes this a piece of cake! All you need is one > query. In Query1, do a SUM(FIELD2) rather than COUNT(FIELD2). Forget > about Query2. > > --Dan > > Thanks! Sometimes the obvious is the last thing you think about Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printf()
On Sunday 16 June 2002 12:46 am, Gerard Samuel wrote: > Im trying to make a dynamic printf(). > By that I mean -> > > function this($foo, $bar) > { > if (strlen($bar) == '0') > { > print($foo); > } > else > { > printf($foo, $bar); > } > } > > Now it works if there is one argument passed, but it doesn't when there > is more than one. > > $str = 'should'; > this('This %s work', $str); // work > > $str = 'is, a'; > this('This %s just %s test', $str); // doesn't work > > So I guess, arguments passed to it has to be physical arguments, and not > represented in a string. > Am I banging my head on a wall with this?? > Thanks Try this : '); this('Hello %s','"World"'); this('Hello %s %s','"Wide", "World"'); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printf()
On Sunday 16 June 2002 1:13 am, Gerard Samuel wrote: > check to see if $bar is an array and > feed the array to vprintf() Wow, didn't even know that one existed! Might come in handy though :) Danny. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] md5 php vs. md5 perl
Hi, I'm trying to rewrite a perl finction to php. The function uses Digest::MD5. PHP md5() returns a 32 char hex number. The perl Digest::MD5 function returns a 16 char (ascii??) string. Can I also get this from PHP? If so how do I do that? My ultimate goal is to have compatible PHP/Perl functions. Thanks! Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] translate perl unpack to php equivalent
Hi, How would I translate this perl unpack statement to the php equiv. my ($salt, $xor) = unpack('a2 a*', $something) Thanks! Danny -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php