php-general Digest 25 Jun 2003 12:18:52 -0000 Issue 2138

Topics (messages 152678 through 152747):

Re: how to get the date of this Saturday all the time?
        152678 by: poetbox
        152679 by: James Hicks
        152680 by: poetbox
        152682 by: James Hicks
        152690 by: Joseph Szobody
        152695 by: poetbox

generate word docs
        152681 by: Evan Nemerson
        152722 by: dorgon
        152725 by: George Pitcher
        152726 by: dorgon

Re: Security conundrum ....
        152683 by: Miles Thompson

Re: MSWord attachment with mail()
        152684 by: Alberto Brea

PHP & Mysql Error Code 1062 - Duplicates found
        152685 by: Ow Mun Heng
        152699 by: Jeff Harris

PHP & cached data when using browser "back" button
        152686 by: Ow Mun Heng
        152696 by: Jeff Harris
        152698 by: Leif K-Brooks

Re: Performance question
        152687 by: Ow Mun Heng
        152700 by: Jeff Harris

Re: WEB HOST NEEDED!!!!!
        152688 by: PHP4 Emailer
        152705 by: John Zimmerman

Re: free web host needed.
        152689 by: Joel Rees
        152731 by: poetbox

script check/testing
        152691 by: Jay Fitzgerald
        152693 by: James Hicks
        152694 by: James Hicks

Re: Using variables from includes
        152692 by: Ben
        152697 by: Leif K-Brooks

Sorting Country List
        152701 by: Ralph
        152708 by: Boaz Yahav
        152712 by: Craig Avnit
        152730 by: Ralph

PHP Mysql Hit Counter
        152702 by: mwestern.sola.com.au
        152704 by: Jeff Harris
        152709 by: Nadim Attari

Re: PHP General Mailing List <[EMAIL PROTECTED]>
        152703 by: Jeff Harris

Help please!
        152706 by: Nadim Attari
        152707 by: Nadim Attari
        152737 by: sven
        152741 by: Nadim Attari

Re: Returning TWO variables from function
        152710 by: Nadim Attari
        152711 by: Slava

Month name
        152713 by: cavagnaro
        152715 by: Boaz Yahav
        152716 by: Martin Towell
        152719 by: cavagnaro
        152720 by: Nadim Attari

remove characters, add newline & making a twodimensional array
        152714 by: Dore van Hoorn
        152735 by: Marek Kilimajer
        152736 by: sven

Re: ereg_replace and quotation marks
        152717 by: Boaz Yahav
        152740 by: sven

Re: calling functions in classes using text and graphic links
        152718 by: SLanger.spirit21.de

correct syntax
        152721 by: Harry Wiens
        152723 by: dorgon
        152727 by: Ford, Mike               [LSS]
        152738 by: Chris Hayes
        152742 by: Hidayet Dogan
        152746 by: Ford, Mike               [LSS]

rtf files
        152724 by: Steven
        152734 by: sven

Re: status of current online users
        152728 by: Angelo Zanetti

a generic getsql() function
        152729 by: Thomas Hochstetter
        152739 by: French, Alastair

Ldap bind: checking group membership
        152732 by: Jason End

Re: PHP forever ;)
        152733 by: Hatem Ben

Error reporting at runtime
        152743 by: Anthony
        152744 by: Robert Cummings
        152745 by: Ford, Mike               [LSS]

multi language support
        152747 by: Arvind V

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
hi, Jennifer Goodie£¡
       How quickly you are!
       Thank you,I'm testting now:)
        

======= 2003-06-24 17:20:00 you wrote£º=======

>>       We have a meeting at every Saturday,I'd like to post the
>> news and write the date of this Saturday every week,how can I get
>> the date of Saturday.
>
>
>This has not been tested, there might be a bug.
><?php
>function get_sat_ts($timestamp){
>       $dow = date("w",$timestamp);
>       $days_to_add = 6 - $dow;
>       $ts_sat = mktime
>(0,0,0,date("m",$timestamp),date("d",$timestamp)+$days_to_add,date("y",$time
>stamp));
>       return ($ts_sat);
>}
>$ts = get_sat_ts(time());
>echo date("Y-d-m",$ts);
>?>
>
>Something like that should be what you want though.
>
>
>
>.

= = = = = = = = = = = = = = = = = = = =
                        

¡¡¡¡¡¡Thanks for your kindness.
 
                                 
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
[EMAIL PROTECTED]
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-25





--- End Message ---
--- Begin Message ---
How about 

date("Y-m-d",strtotime("next Saturday"));

James Hicks


On Tuesday 24 June 2003 08:01 pm, poetbox wrote:
> hi,php-general£¬
>
>       We have a meeting at every Saturday,I'd like to post the news and
> write the date of this Saturday every week,how can I get the date of
> Saturday. For example,today is Monday,  and today is  2003-23-06,I'd like
> to get the Saturday date "2003-28-06" ;If today is Friday on
> "2003-16-08",I'd like to get the date of "2003-17-08",the date is a var got
> by a special function,How to WRITE THE FUNCTION? Any thoughts or
> suggestions would be greatly appreciated!Thanks in advance.
>
>
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
> [EMAIL PROTECTED]
> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-25


--- End Message ---
--- Begin Message ---
hi, James Hicks£¡

<?
echo   date("Y-m-d",strtotime("next Saturday"));
?>
I got "1970-01-01"!
Perhaps you missing give me the function strtotime().

====================================================

Hi,Jennifer Goodie,

Your function is very perfect!Thank you very much,I tested it and succeed!
BTW,Can you pro it in another way?
I say,I got "2003-28-06",but I like "2003-28-6",needn't the "0" before the month,is it 
difficult?If not,I'd like you to give me another function without '0' before the month!
Thank you!

======= 2003-06-24 20:36:00 you wrote£º=======

>How about 
>
>date("Y-m-d",strtotime("next Saturday"));
>
>James Hicks
>
>
>On Tuesday 24 June 2003 08:01 pm, poetbox wrote:
>> hi,php-general£¬
>>
>>       We have a meeting at every Saturday,I'd like to post the news and
>> write the date of this Saturday every week,how can I get the date of
>> Saturday. For example,today is Monday,  and today is  2003-23-06,I'd like
>> to get the Saturday date "2003-28-06" ;If today is Friday on
>> "2003-16-08",I'd like to get the date of "2003-17-08",the date is a var got
>> by a special function,How to WRITE THE FUNCTION? Any thoughts or
>> suggestions would be greatly appreciated!Thanks in advance.
>>
>>
>> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
>> [EMAIL PROTECTED]
>> ¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-25
>
>.

= = = = = = = = = = = = = = = = = = = =
                        

¡¡¡¡¡¡Thanks for your kindness.
 
                                 
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
[EMAIL PROTECTED]
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-25





--- End Message ---
--- Begin Message ---
On Tuesday 24 June 2003 09:18 pm, poetbox wrote:
> hi, James Hicks£¡
>
> <?
> echo   date("Y-m-d",strtotime("next Saturday"));
> ?>
> I got "1970-01-01"!
> Perhaps you missing give me the function strtotime().
>

You must be using an old version of PHP that does not support strtotime. (PHP 
3>= 3.0.12, PHP 4 ) is what the manual says. That would account for the 
output of date.

James Hicks


--- End Message ---
--- Begin Message ---
> date("Y-m-d",strtotime("next Saturday"));

That would give the Saturday for next week (2003-07-05). Try "this Saturday" or just 
"Saturday".

date("Y-m-d",strtotime("this Saturday"));  // Currently returns 2003-06-28

Joseph





--- End Message ---
--- Begin Message ---
hi, Joseph Szobody£¡

              THank you!I can only use "Jennifer Goodie"'s way because as james 
said,my server is to old to allow the function of "strtotime()"!
          Thank you by any way!

======= 2003-06-24 22:17:00 you wrote£º=======

>> date("Y-m-d",strtotime("next Saturday"));
>
>That would give the Saturday for next week (2003-07-05). Try "this Saturday" or just 
>"Saturday".
>
>date("Y-m-d",strtotime("this Saturday"));  // Currently returns 2003-06-28
>
>Joseph
>
>
>
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>.

= = = = = = = = = = = = = = = = = = = =
                        

¡¡¡¡¡¡Thanks for your kindness.
 
                                 
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
[EMAIL PROTECTED]
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-25





--- End Message ---
--- Begin Message ---
Summary: I have to create a word document on the fly. what's the best way to 
go about it?

Okay so I have a client that would like something output to a word document. I 
already have HTML and PDF versions... I'm trying to figure out the best way 
to do this. I am already aware of the open html in word hack. The way I see 
it, these are my choices:

1)      Use the hack that I'm really don't like. It never looks quite right (which 
is the whole point of this).
2)      Move everything over to a windows host and use COM.
3)      Somehow convice host (hurricane electric) to run PHP5 CVS w/ Sterling's 
mono extension, and use .net to create the word document (does mono support 
that class yet?). I hate C#. VB is even worse.
4)      Find an open-source library that writes word documents (quick search 
revealed nothing...), write an extension for php.
5)      Find a spec for word docs and write a library in php
6)      find a spec and write a library in c, then create php extension. I'm 
willing to do this, but it would take a long time...
7)      Tell my boss to sod off (politely, though), it's not currently feasible... 
I think this is what he's expecting, anyways.

So, does anyone have any suggestions/comments? Anyone know where I could find 
a library (in c or php) or a spec? I'm kinda thinking aloud here hoping 
someone will prod me in the right direction...

Thanks
Evan

--- End Message ---
--- Begin Message --- hmm... sounds troublesome.
do you need all text/paragraph formatting features of word? what if finding a spec for RTF, which is much easier and specifying the word
MIME key respectifely saving as .doc (words opens rtf without a convert
dialog I think).


just a thought

Evan Nemerson wrote:
Summary: I have to create a word document on the fly. what's the best way to go about it?

Okay so I have a client that would like something output to a word document. I already have HTML and PDF versions... I'm trying to figure out the best way to do this. I am already aware of the open html in word hack. The way I see it, these are my choices:

1) Use the hack that I'm really don't like. It never looks quite right (which is the whole point of this).
2) Move everything over to a windows host and use COM.
3) Somehow convice host (hurricane electric) to run PHP5 CVS w/ Sterling's mono extension, and use .net to create the word document (does mono support that class yet?). I hate C#. VB is even worse.
4) Find an open-source library that writes word documents (quick search revealed nothing...), write an extension for php.
5) Find a spec for word docs and write a library in php
6) find a spec and write a library in c, then create php extension. I'm willing to do this, but it would take a long time...
7) Tell my boss to sod off (politely, though), it's not currently feasible... I think this is what he's expecting, anyways.


So, does anyone have any suggestions/comments? Anyone know where I could find a library (in c or php) or a spec? I'm kinda thinking aloud here hoping someone will prod me in the right direction...

Thanks
Evan


--- End Message ---
--- Begin Message ---
RTF is the way to go.

If you know what you want your word doc to look like, set it up in Word, or
whatever will save a formatted rtf file (Sorry, I'm Windows/Mac based, but I
presume that Open Office  etc will do this on Linux).

I insert placeholders into the document where I want to put dynamic data I
use %_varname_% to avoid any RTF conflicts.

In php, read the file into a string and str_replace() or preg_replace() the
placeholders for your data. Save the target file as *.doc and there you go -
done.

George

> -----Original Message-----
> From: dorgon [mailto:[EMAIL PROTECTED]
> Sent: 25 June 2003 9:06 am
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: generate word docs
>
>
> hmm... sounds troublesome.
> do you need all text/paragraph formatting features of word? what if
> finding a spec for RTF, which is much easier and specifying the word
> MIME key respectifely saving as .doc (words opens rtf without a convert
> dialog I think).
>
> just a thought
>
> Evan Nemerson wrote:
> > Summary: I have to create a word document on the fly. what's
> the best way to
> > go about it?
> >
> > Okay so I have a client that would like something output to a
> word document. I
> > already have HTML and PDF versions... I'm trying to figure out
> the best way
> > to do this. I am already aware of the open html in word hack.
> The way I see
> > it, these are my choices:
> >
> > 1)  Use the hack that I'm really don't like. It never looks
> quite right (which
> > is the whole point of this).
> > 2)  Move everything over to a windows host and use COM.
> > 3)  Somehow convice host (hurricane electric) to run PHP5 CVS
> w/ Sterling's
> > mono extension, and use .net to create the word document (does
> mono support
> > that class yet?). I hate C#. VB is even worse.
> > 4)  Find an open-source library that writes word documents
> (quick search
> > revealed nothing...), write an extension for php.
> > 5)  Find a spec for word docs and write a library in php
> > 6)  find a spec and write a library in c, then create php
> extension. I'm
> > willing to do this, but it would take a long time...
> > 7)  Tell my boss to sod off (politely, though), it's not
> currently feasible...
> > I think this is what he's expecting, anyways.
> >
> > So, does anyone have any suggestions/comments? Anyone know
> where I could find
> > a library (in c or php) or a spec? I'm kinda thinking aloud here hoping
> > someone will prod me in the right direction...
> >
> > Thanks
> > Evan
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
If you know what you want your word doc to look like, set it up in Word, or
whatever will save a formatted rtf file (Sorry, I'm Windows/Mac based, but I
presume that Open Office  etc will do this on Linux).

I'm not sure if I got you, but RTF as very different from native word format. RTF doesn't allow you to place images or other floating objects.
I don't know if tables and borders are possible. Tabulatur sometimes
can't fit your needs.


I insert placeholders into the document where I want to put dynamic data I
use %_varname_% to avoid any RTF conflicts.

this idea really sounds great. a faster way can't hardly be found.


/dorgon


--- End Message ---
--- Begin Message --- Justin,

Tks for your reply -- you're partially correct in how it works, and thus far I've not used session id's. Cool.

Login is built into the Flash movie and calls a PHP script to authenticate, which returns appropriate success/fail data to the movie. Everything is buried in the Flash movie to solve a serious pass-around problem we had when using PDF's. If the Flash .swf file gets passed, then the login is the first thing encountered. Passwords shared you say? we limit logins to a fixed number per week.

I thought of sessions, but when I tried to set them in the authentication script called from the .swf, the .swf gobbled them, they did not go to the browser.

What I've done is call a script which opens a window, passing it the ckval and issue date to display. It's only function is to start a session and call a second window, which actually displays the story. That window closes its parent. (Too much JavaScript for my liking.)

This scheme is only working on a test site now. If you want to, check out
http://www.allnovascotia.com/test_flash/feed_print_story.php , which a person might do if they figured they will get the news for free, a rude message appears. (Which will be changed for production, as we would rather encourage, not discourage, potential subscribers.)


To see how this scheme works legally, have a look at
http://www.allnovascotia.com/test_flash/index.php?pgget=1
and login using "flasher" in all the boxes.

So it's not a PHP solution, I'm popping up an intermediate window and closing it, which is ugly - flicker. And I've not been able to figure out a way to have that intermediate window open at a small size -- everything in JS seems to operate on children.

Regards - Miles Thompson

At 01:30 PM 6/23/2003 +1000, you wrote:
Ok, I'm trying to get a grip on what happens here:

1. i visit your site, see a flash movie, which enables me to log-in

2. after i log in, I see a link called "news"

3. I click on it, which pops open a HTML window through javascript, with a
URL like example.com/print_news.php

[At this point, the news page should only be available to authenticated
users, but it isn't -- right?]


The answer appears to be sessions. When you log in, you should be able to pass a session ID back to the flash movie, along with the user's ckval (whatever that is), and add a session variable like 'logged_in' to the session.

When the flash movie uses javascript to pop open the news window, you should
be able to pass the session id as a GET variable in the URL, eg:

example.com/print_news.php?PHPSESSID=xxxxxxxxxxxxxxxxx

print_news.php needs to have this at the top:

<?
session_start();
if($_SESSION['logged_in'])
    {
    ?>
    <html>
    ...
    Your news
    ...
    </html>
    <?
    }
else
    {
    ?>
    <html>
    ...
    Sorry, you must be logged in baby!
    ...
    </html>
    <?
    }
?>


You don't NEED cookies to have session work... it can be done with URLs.


Justin


on 23/06/03 5:18 AM, Miles Thompson ([EMAIL PROTECTED]) wrote:


> This does have to do with PHP, but bear with me.
>
> We're using a Flash movie, which calls various PHP scripts to authenticate
> users & retrieve news articles, to display a daily business digest. As
> Flash's printing capabilities are pathetic, we use JavaScript to popup a
> chromeless window in which runs print_news.php. (This is a small window,
> with selection, resizing, etc. all disabled, and which calls the print
> dialog on load; all that is really visible is its "Close" button.)
>
> It won't be too long before some bright spark realizes that our site could
> be visited and the URL for print_news.php fed in; that person would then
> have free access - not good.
>
> What I planned to do is add authentication to print_news.php, by passing
> the user's ckval  (obtained when first authenticated by user_logon.php)
> back to the browser in a session var. That does not work, as Flash
> apparently gobbles the cookie.
>
> The apparent alternative is to call an intermediate script from Flash,
> passing the ckval, and having that script set the session and then redirect
> to print_news.php, using the header( Location: ... ). The problem is that
> opens in the same window, and I need a new one.
>
> I obviously can't pass ckval in the URL, and I don't have any way, that I
> know of, to fake a <form> POST.
>
> Suggestions or nudges in the right direction will be appreciated.
>
> Regards - Miles Thompson
>


-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Thanks Chris, Dorgon and Esteban for putting me back on the track.

----- Original Message -----
From: "Chris Hayes" <[EMAIL PROTECTED]>
To: "Alberto Brea" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, June 24, 2003 4:34 PM
Subject: Re: [PHP] MSWord attachment with mail()


> At 22:57 24-6-2003, you wrote:
> >Dear list,
> >What header must I use to send a MSWord attachment with mail()?
> >I have looked it up in the manual and on php.net but cannot find it.
>
> for a cvs file aimed at excel i use
>
>
> if (strstr($_SERVER["HTTP_USER_AGENT"],"MSIE 5.5")) {$att = "";} else
{$att
> = " attachment;";}
> header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");               // Date in
> the past
> header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  // always
> modified
> header("Cache-Control: no-store, no-cache, must-revalidate");   //
HTTP/1.1
> header("Cache-Control: post-check=0, pre-check=0", false);
> header("Pragma: no-cache");                                     //
HTTP/1.0
>
> header("Content-type: text/csv");
> header('Content-Disposition: inline;
> filename="Aanmeldingen_SENSE_symposium_2003.csv"');
> echo $string_csv;
>
>
>
> for word i suppose one could use
>
> header("Content-type: application/msword");
>
>
>
>
>


--- End Message ---
--- Begin Message ---
Hi PHP'ers,
        
        I've got a question regarding the input of (multiple) data into
mysql through PHP. 

If there is already an entry in the database, then an mysql will generate an
error 1062 stating that the entry is a duplicate. (This will happen only if
I input the data through mySQL using xterm, if I use PHP, then I only get
the 'duplicate entry found', partly cause I don't know how to get the error
code as well as the duplicate entry returned to PHP to be output'ed to the
browser.

Below is my code. $my_query is concatenated from an array.

$my_query = $my_query.
"\n('".$SN[$i]."','".$DCM[$i]."','".$Supp[$i]."','".$time_now."'),";
$query = "INSERT INTO pioneer(serial_no,dcm,supplier,fa_timestamp) VALUES
$my_query;"; 
$result = mysql_db_query('tracker',$query);

if ($result)
echo "<br><br>".mysql_affected_rows()." Drives & DCM combo inserted into
database.";
else
echo "\n<br><br>Duplicate entry found. Data not inserted.";


Can anyone help me out?


Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168

--- End Message ---
--- Begin Message ---
On Jun 25, 2003, "Ow Mun Heng" claimed that:

|Hi PHP'ers,
|
|       I've got a question regarding the input of (multiple) data into
|mysql through PHP.
|
|If there is already an entry in the database, then an mysql will generate an
|error 1062 stating that the entry is a duplicate. (This will happen only if
|I input the data through mySQL using xterm, if I use PHP, then I only get
|the 'duplicate entry found', partly cause I don't know how to get the error
|code as well as the duplicate entry returned to PHP to be output'ed to the
|browser.
|
|Below is my code. $my_query is concatenated from an array.
|
|$my_query = $my_query.
|"\n('".$SN[$i]."','".$DCM[$i]."','".$Supp[$i]."','".$time_now."'),";
|$query = "INSERT INTO pioneer(serial_no,dcm,supplier,fa_timestamp) VALUES
|$my_query;";
|$result = mysql_db_query('tracker',$query);
|
|if ($result)
|echo "<br><br>".mysql_affected_rows()." Drives & DCM combo inserted into
|database.";
|else
|echo "\n<br><br>Duplicate entry found. Data not inserted.";
|
|
|Can anyone help me out?
|
|
|Cheers,
|Mun Heng, Ow
|H/M Engineering
|Western Digital M'sia
|DID : 03-7870 5168
|
|--
http://marc.theaimsgroup.com/?l=php-general&m=105606491624771&w=2
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



--- End Message ---
--- Begin Message ---
Hi All,

        How can I prevent the browser from sending in cached data after the
user pressed the 'back' button and re-inputted data.

Eg: Originall I enter 3 isbn numbers, submitted it, then the user presses
the 'back' button to re-input 1 new data and then re-submits the data,
instead of only having the 1 new data, I get the 1 new data + 3 old data.

Can anyone help explain this? (if I were to clear the browser's cache, then
there's no problem.)

Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168

--- End Message ---
--- Begin Message ---
On Jun 25, 2003, "Ow Mun Heng" claimed that:

|Hi All,
|
|       How can I prevent the browser from sending in cached data after the
|user pressed the 'back' button and re-inputted data.
|
|Eg: Originall I enter 3 isbn numbers, submitted it, then the user presses
|the 'back' button to re-input 1 new data and then re-submits the data,
|instead of only having the 1 new data, I get the 1 new data + 3 old data.
|
|Can anyone help explain this? (if I were to clear the browser's cache, then
|there's no problem.)
|
|Cheers,
|Mun Heng, Ow
|H/M Engineering
|Western Digital M'sia
|DID : 03-7870 5168
|
|--
|PHP General Mailing List (http://www.php.net/)
|To unsubscribe, visit: http://www.php.net/unsub.php
|
http://marc.theaimsgroup.com/?l=php-general&m=105613536620953&w=2

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



--- End Message ---
--- Begin Message --- Ow Mun Heng wrote:

Hi All,

        How can I prevent the browser from sending in cached data after the
user pressed the 'back' button and re-inputted data.

Eg: Originall I enter 3 isbn numbers, submitted it, then the user presses
the 'back' button to re-input 1 new data and then re-submits the data,
instead of only having the 1 new data, I get the 1 new data + 3 old data.

Can anyone help explain this? (if I were to clear the browser's cache, then
there's no problem.)


This has been discussed a million times. Check the archives.

--
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.



--- End Message ---
--- Begin Message ---
Can someone help explain how I can perform a benchmark on the queries or
whatever?


Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia 
DID : 03-7870 5168


-----Original Message-----
From: Boaz Yahav [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 1:41 AM
To: Hardik Doshi; [EMAIL PROTECTED]
Subject: RE: [PHP] Performance question


It depends on your HW / Application / number of visitors.
If you are planning to have many visitors and plan this number to
constantly
grow than you should avoid going to the DB as much as possible.

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Hardik Doshi [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 23, 2003 5:10 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Performance question


Hi Group,

I have a question regarding retrieving the
information. I have the functionlity in which on every
user click, system needs to retrieve information for
particular user and display the page according to the
retrieved information. Now question is which is the
scalable solution? (1) Retrieve information from the
database on each user click. (2) Retrieve information
from the session (here information is retrieved once
and stored in the session file on the server, when
user logs into the system)

Please let me know

Thanks

Hardik

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
On Jun 25, 2003, "Ow Mun Heng" claimed that:

|Can someone help explain how I can perform a benchmark on the queries or
|whatever?
|
|
|Cheers,
|Mun Heng, Ow
|H/M Engineering
|Western Digital M'sia
|DID : 03-7870 5168
|
|
Do it many times and time it.

--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.









<?
require_once ("Benchmark/Timer.php");
require_once ("DB.php");
$timer = new Benchmark_Timer;
$dblink=DB::connect("mysql://$dbuser:[EMAIL PROTECTED]/$dbname");
print("starting...<BR>\n");
ob_flush();
$timer->start();
$SQLQuery="SELECT * FROM table";
for ($i = 1; $i <= 1000000000; $i++) {
    $insert= $dblink->query($SQLQuery);
}

$timer->stop();
print("Total execution time: ");
print($timer-> timeElapsed());
print(" seconds.\n");
?>


--- End Message ---
--- Begin Message ---
SO let me get this straight, IF I pay 1000.00 a month, you'll "throw the
pony in?"

Sweet, where do I sign up!!

PS, if for some unknown reason the credit card I enter doesn't work it's
because I got it for free. :)

-----Original Message-----
From: erythros [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 24, 2003 5:44 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] WEB HOST NEEDED!!!!!


he should ask for a pony too while he's at it...

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
Like I said, I need a web host.
It MUST support PHP, mySQl and sending emails, optional.
It shouldn't have any ads (pop-ups, ads), but I will allow if it has
watermarks (SMALL! watermarks).
It should be TOTALY FREE!
[/snip]

Denis I am going to make a small suggestion, please Google for this
information. Apparently many of the answers that have been given to you
on this list are not acceptable. Do some research. There is no such
thing as totally free.

HTH!

Jay



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
> [snip]
> Like I said, I need a web host.
> It MUST support PHP, mySQl and sending emails, optional.
> It shouldn't have any ads (pop-ups, ads), but I will allow if it has
> watermarks (SMALL! watermarks).
> It should be TOTALY FREE!
> [/snip]

Not that we really want to attract losers who can't use Google, but if you are looking for a free* ($1 by snail mail) web hosting / shell account you should look at www.freeshell.org.

Web hosting / email / php / ssh just cost that initial $1.

MySQL database is $20 per year. There are a bunch of other features too. This service is aimed at UNIX users. There is no advertising or popups whatsoever. Has a good UNIX community.

Good / Cheap way to host PHP scripts.

Sorry for the advertisement.



--- End Message ---
--- Begin Message ---
>  Perhaps the original poster should just set
> up their own linux box and run it off their home cable/dsl line.

Good answer, although I would recommend looking at the BSDs, too -- netBSD
in particular, runs on hardware you can drag out of dumpsters. Takes a
bit of work to get it all together, of course.

However, guessing from his e-mail address, he may physically not be
anywhere close to any dumpsters that would have old computers and parts
in them, much less to a home that could be hooked up to cable/dsl. 

    http://www.matkurja.com/eng/country-info/

-- 
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp


--- End Message ---
--- Begin Message ---
hi, Joel Rees£¡
          " lycos " can do,and  you can write a program to delete the ad!
        

======= 2003-06-25 11:50:00 you wrote£º=======

>>  
>Joel Rees, programmer, Kansai Systems Group
>Altech Corporation (Alpsgiken), Osaka, Japan
>http://www.alpsgiken.co.jp
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

= = = = = = = = = = = = = = = = = = = =
                        

¡¡¡¡¡¡Thanks for your kindness.
 
                                 
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
[EMAIL PROTECTED]
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-25





--- End Message ---
--- Begin Message --- I seem to be having problem in the last step of this app I am trying to create...can you guys test it as thoroughly as you can and give me tips on how to improve it....it is session based but I cannot seem to get step 5 to recognize the $theseat" variable. If you would like to offer help, please email me off-list and I will provide the code to you, there is way to much code and I am not even sure which part I should post here.

http://www.lamerc.com/jay/test/new/step1.php

TIA

Jay



--- End Message ---
--- Begin Message ---
On Tuesday 24 June 2003 11:27 pm, Jay Fitzgerald wrote:
> I seem to be having problem in the last step of this app I am trying to
> create...can you guys test it as thoroughly as you can and give me tips on
> how to improve it....it is session based but I cannot seem to get step 5 to
> recognize the $theseat" variable. If you would like to offer help, please
> email me off-list and I will provide the code to you, there is way to much
> code and I am not even sure which part I should post here.
>
> http://www.lamerc.com/jay/test/new/step1.php
>
> TIA
>
> Jay

From over here, it looks like you need to change:

<A NAME="theseat"

to 

<A NAME="theseat[]"

--- End Message ---
--- Begin Message ---
Nevermind this suggestion. No idea what I was thinking. I guess it's time to 
go to sleep.

James

On Tuesday 24 June 2003 11:35 pm, James Hicks wrote:
> On Tuesday 24 June 2003 11:27 pm, Jay Fitzgerald wrote:
> > I seem to be having problem in the last step of this app I am trying to
> > create...can you guys test it as thoroughly as you can and give me tips
> > on how to improve it....it is session based but I cannot seem to get step
> > 5 to recognize the $theseat" variable. If you would like to offer help,
> > please email me off-list and I will provide the code to you, there is way
> > to much code and I am not even sure which part I should post here.
> >
> > http://www.lamerc.com/jay/test/new/step1.php
> >
> > TIA
> >
> > Jay
>
> From over here, it looks like you need to change:
>
> <A NAME="theseat"
>
> to
>
> <A NAME="theseat[]"


--- End Message ---
--- Begin Message ---
But how would I go about using the IF THEN statement but allowing the page
to see the variables.

"Leif K-Brooks" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ben wrote:
>
> >How would I do this then?
> >
>
> include('foo.php');
>
> -- 
> 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.
>
>



--- End Message ---
--- Begin Message --- Ben wrote:

But how would I go about using the IF THEN statement but allowing the page
to see the variables.

Not sure if I know what you mean, but:
if($foo == 'bar'){
   include('foo.php');
}

--
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.



--- End Message ---
--- Begin Message ---
I am getting a list of all countries from mysql database, and then I am
sorting by country name. However since most orders will be from US I
want the US to appear first over the rest of the countries. How can I go
about doing this?

Currently, this is my query:

SELECT countries_id, countries_name FROM TABLE_COUNTRIES ORDER BY
countries_name;



--- End Message ---
--- Begin Message ---
Why don't you just add a hard coded line like this:

<OPTION VALUE="USA">USA</OPTION>

as the 1st option in your select box?

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Ralph [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2003 6:43 AM
To: PHP General Mailing List
Subject: [PHP] Sorting Country List


I am getting a list of all countries from mysql database, and then I am
sorting by country name. However since most orders will be from US I
want the US to appear first over the rest of the countries. How can I go
about doing this?

Currently, this is my query:

SELECT countries_id, countries_name FROM TABLE_COUNTRIES ORDER BY
countries_name;



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
I use this code, which extracts from mysql, and you can set the option of
which you want to be selected
<?php
// List Box MySQL Functions
function listbox_field ($mysql_link, $name, $default=0) {
    $result="<select name=\"$name\">\n";
    while (list($key,$val)=mysql_fetch_array($mysql_link)) {
        if ($default  == $key) {$selected="selected";} else {$selected="";}
        $result.="<option value=\"$key\" $selected>$val</option>\n";
    }
    $result.="</select>\n";
return $result;
}
?>

<?php
// Code in actual web page to extract the Countries

        $conn = db_connect();
        if (!$conn)
                return "Could not connect to the Database - Please Try Later.";

                $country=mysql_query("SELECT countryid, country FROM countries");
                echo listbox_field($country, "country", "UK");
?>

<?php
// DB CONNECT function
function db_connect() {
        $result = mysql_pconnect("<HOSTNAME>","<USERNAME>","<PASSWORD>");
                if (!$result)
                        return false;
                if (!mysql_select_db("<DBNAME>"))
                        return false;

        return $result;
}
?>

The country table I use stores the Country Code and then the Country Name,
can send the SQL for that if you need it.


Craig

> -----Original Message-----
> From: Ralph [mailto:[EMAIL PROTECTED]
> Sent: 25 June 2003 06:43
> To: PHP General Mailing List
> Subject: [PHP] Sorting Country List
>
>
> I am getting a list of all countries from mysql database, and then I am
> sorting by country name. However since most orders will be from US I
> want the US to appear first over the rest of the countries. How can I go
> about doing this?
>
> Currently, this is my query:
>
> SELECT countries_id, countries_name FROM TABLE_COUNTRIES ORDER BY
> countries_name;
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---
--- Begin Message ---
Thanks for your replies, however what I was looking for was to have the
countries sorted by alphabetical order starting with the US. I rewrote
the query to:

"SELECT IF(countries_id='US', 0, 1) as ctsort, countries_id,
countries_name
  FROM TABLE_COUNTRIES 
  ORDER BY ctsort, countries_name"

-----Original Message-----
From: Boaz Yahav [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2003 12:13 AM
To: Ralph; PHP General Mailing List
Subject: RE: [PHP] Sorting Country List

Why don't you just add a hard coded line like this:

<OPTION VALUE="USA">USA</OPTION>

as the 1st option in your select box?

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Ralph [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2003 6:43 AM
To: PHP General Mailing List
Subject: [PHP] Sorting Country List


I am getting a list of all countries from mysql database, and then I am
sorting by country name. However since most orders will be from US I
want the US to appear first over the rest of the countries. How can I go
about doing this?

Currently, this is my query:

SELECT countries_id, countries_name FROM TABLE_COUNTRIES ORDER BY
countries_name;



-- 
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




--- End Message ---
--- Begin Message ---
Hi All,
I'm after a fairly neat PHP mysql hit counter with date reporting/url
reporting and perhaps some graphs but not nessasary. i've done my own little
one which simply reports hits, but i'm wondering is there a free one that is
da busiess.  :)

anyone?
ta
M

--- End Message ---
--- Begin Message ---
On Jun 25, 2003, "[EMAIL PROTECTED]" claimed that:

|Hi All,
|I'm after a fairly neat PHP mysql hit counter with date reporting/url
|reporting and perhaps some graphs but not nessasary. i've done my own little
|one which simply reports hits, but i'm wondering is there a free one that is
|da busiess.  :)
|
|anyone?
|ta
|M

Not sure. Why not check a search engine?
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=php+mysql+counter
-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.



--- End Message ---
--- Begin Message ---
http://www.hotscripts.com/PHP/Scripts_and_Programs/index.html

--- End Message ---
--- Begin Message ---
Summary: I have to create a word document on the fly. what's the best way
to go about it?

Okay so I have a client that would like something output to a word
document. I already have HTML and PDF versions... I'm trying to figure out
the best way to do this. I am already aware of the open html in word hack.
The way I see it, these are my choices:

1) Use the hack that I'm really don't like. It never looks quite right
(which is the whole point of this). 2) Move everything over to a windows
host and use COM. 3) Somehow convice host (hurricane electric) to run PHP5
CVS w/ Sterling's mono extension, and use .net to create the word document
(does mono support that class yet?). I hate C#. VB is even worse. 4) Find
an open-source library that writes word documents (quick search revealed
nothing...), write an extension for php. 5) Find a spec for word docs and
write a library in php 6) find a spec and write a library in c, then
create php extension.  I'm willing to do this, but it would take a long
time... 7) Tell my boss to sod off (politely, though), it's not currently
feasible...  I think this is what he's expecting, anyways.

So, does anyone have any suggestions/comments? Anyone know where I could
find a library (in c or php) or a spec? I'm kinda thinking aloud here
hoping someone will prod me in the right direction...

Thanks Evan

-- 

This might help you: http://www.phpreports.com/html/article.php?sid=2

-- 
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.





--- End Message ---
--- Begin Message ---
Hi php-general-digest,

I have subscribed to news://news.php.net/php.general. But when I post
something (i'm using Outlook Express), it seems that the post is sent; but
in fact it isn't and so I don't find my post(s) on the newsgroup.

Help please!

Nadim Attari

--- End Message ---
--- Begin Message ---
Hi php-general,

I have subscribed to news://news.php.net/php.general. But when I post
something (i'm using Outlook Express), it seems that the post is sent; but
in fact it isn't and so I don't find my post(s) on the newsgroup.

Help please!

Nadim Attari

--- End Message ---
--- Begin Message ---
hmm, well this post is here twice. so it works better than you thought? ;-)

Nadim Attari wrote:
> Hi php-general,
>
> I have subscribed to news://news.php.net/php.general. But when I post
> something (i'm using Outlook Express), it seems that the post is
> sent; but in fact it isn't and so I don't find my post(s) on the
> newsgroup.
>
> Help please!
>
> Nadim Attari



--- End Message ---
--- Begin Message ---
> hmm, well this post is here twice. so it works better than you thought? ;-)

Well it doesn't... I have to send it as a mail to [EMAIL PROTECTED], then it works... 
If I click on the thread and try to "Reply to Group", it doesn't work !!!

Anyway I can send my post now... and special thanks goes to Edward Dudlik (Becoming 
Digital).

Nadim Attari
http://www.alienworkers.com

--- End Message ---
--- Begin Message ---
> Can someone let me know how to return TWO variables from a function
Try http://www.php.net/manual/en/language.references.php

--- End Message ---
--- Begin Message ---
The function can return an array that include two or more variables.

"Nadim Attari" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Can someone let me know how to return TWO variables from a function
> Try http://www.php.net/manual/en/language.references.php
>



--- End Message ---
--- Begin Message ---
How can I get the month name from a date? If you could post with an example
i'll be gratefull



--- End Message ---
--- Begin Message ---
Check out : http://www.php.net/manual/en/function.date.php

M  - A short textual representation of a month, three letters Jan
through Dec 

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: cavagnaro [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 25, 2003 8:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Month name


How can I get the month name from a date? If you could post with an
example i'll be gratefull



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
date("F", mktime(0, 0, 0, $mm, $dd, $yyyy));
http://au2.php.net/manual/en/function.date.php
http://au2.php.net/manual/en/function.mktime.php


-----Original Message-----
From: cavagnaro [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 25 June 2003 4:31 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Month name


How can I get the month name from a date? If you could post with an example
i'll be gratefull

--- End Message ---
--- Begin Message ---
Thanks guys! It works perfectly!!
"Boaz Yahav" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
Check out : http://www.php.net/manual/en/function.date.php

M  - A short textual representation of a month, three letters Jan
through Dec

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: cavagnaro [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2003 8:31 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Month name


How can I get the month name from a date? If you could post with an
example i'll be gratefull



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
> How can I get the month name from a date? If you could post with an example
> i'll be gratefull

Two links to help you...
http://www.php.net/manual/en/function.getdate.php
http://www.php.net/manual/en/function.strtotime.php

--- End Message ---
--- Begin Message ---
Well, i'm kind of a newby, but this is what i would like to do in php: 

1. 
i'm writing all instances of a mysql table to a txt file, but when i add
"\n" to go on on the next line, in the txt file there is a square printed.
When i try to import the txt file into ms access, the square is not recognized
by this program to represent a newline.. how can i add a newline to a txt
file, that actually IS a newline (or better: hard return) and that will be
recognized as one, when reading the file into another program? 

2. 
a array contains a string of text, multiple words and interpunction. my first
question: how can i remove the interpunction ( i know how to strip slashes
and trim spaces..)? secondly, after this, i would like to count all double
entries. f.e. when the word computer occurs twice in the sentence, i would
like to make an array that is twodimensional: word-number of occurences (f.e.
'computer' '2'). How do i do that, for i don't really understand the 
phpmanual-explanation
about this topic. And thirdly: how do i get both facts (word and number)
out of the array? (all this has to produce a word-frequecylist, so if anybody
has a clue how to do that......) 

3. 
how can i upload an image to my server and then call the image back into
a webpage, just by using php?
+++++++++++++++++++++++++++++++++++
N    Dore van Hoorn
S    s1000454 AlfaInformatica-RuG
E    [EMAIL PROTECTED]
W    http://www.let.rug.nl/~s1000454
+++++++++++++++++++++++++++++++++++


--- End Message ---
--- Begin Message ---

Dore van Hoorn wrote:
Well, i'm kind of a newby, but this is what i would like to do in php:

1. i'm writing all instances of a mysql table to a txt file, but when i add
"\n" to go on on the next line, in the txt file there is a square printed.
When i try to import the txt file into ms access, the square is not recognized
by this program to represent a newline.. how can i add a newline to a txt
file, that actually IS a newline (or better: hard return) and that will be
recognized as one, when reading the file into another program?
Newline in dos/windows text files is "\r\n"


2. a array contains a string of text, multiple words and interpunction. my first
question: how can i remove the interpunction ( i know how to strip slashes
and trim spaces..)?

strtr() -- cantains also an example


secondly, after this, i would like to count all double
entries. f.e. when the word computer occurs twice in the sentence, i would
like to make an array that is twodimensional: word-number of occurences (f.e.
'computer' '2'). How do i do that, for i don't really understand the phpmanual-explanation
about this topic. And thirdly: how do i get both facts (word and number)
out of the array? (all this has to produce a word-frequecylist, so if anybody
has a clue how to do that......)

First you need to get and array of all words - use explode() or preg_split(). Then you need to loop the array and count the words.



3. how can i upload an image to my server and then call the image back into
a webpage, just by using php?

http://www.php.net/manual/en/features.file-upload.php


+++++++++++++++++++++++++++++++++++
N    Dore van Hoorn
S    s1000454 AlfaInformatica-RuG
E    [EMAIL PROTECTED]
W    http://www.let.rug.nl/~s1000454
+++++++++++++++++++++++++++++++++++




--- End Message ---
--- Begin Message ---
hi dore,

Dore Van Hoorn wrote:
> Well, i'm kind of a newby, but this is what i would like to do in php:
>
> 1.
> i'm writing all instances of a mysql table to a txt file, but when i
> add "\n" to go on on the next line, in the txt file there is a square
> printed.
> When i try to import the txt file into ms access, the square is not
> recognized
> by this program to represent a newline.. how can i add a newline to a
> txt
> file, that actually IS a newline (or better: hard return) and that
> will be
> recognized as one, when reading the file into another program?

seems like you are using a windows-machine, so try '\r\n' instead of '\n'.

>
> 2.
> a array contains a string of text, multiple words and interpunction.
> my first
> question: how can i remove the interpunction ( i know how to strip
> slashes
> and trim spaces..)? secondly, after this, i would like to count all
> double
> entries. f.e. when the word computer occurs twice in the sentence, i
> would
> like to make an array that is twodimensional: word-number of
> occurences (f.e. 'computer' '2'). How do i do that, for i don't
> really understand the phpmanual-explanation about this topic. And
> thirdly: how do i get both facts (word and number)
> out of the array? (all this has to produce a word-frequecylist, so if
> anybody
> has a clue how to do that......)

a little bit confusing with your interpunctation, maybe you can provide some
examples?

to your array: why not using a mono-dimensional array with your words as key
and the occurances as value?

$words = array(
    'myWord1' => 5,
    'myWord2' => 3,
    ...
);

or if you got your $word and $occurance in these vars:

$words[$word] = $occurance;

>
> 3.
> how can i upload an image to my server and then call the image back
> into
> a webpage, just by using php?

there are some articles about uploading files. if you got te file on your
server you can simply use the location in the next script:

$location = /path/to/my.file;

echo '<img source="'.$location.'" />';
(or: echo "<img source=\"$location\" />";)

> +++++++++++++++++++++++++++++++++++
> N    Dore van Hoorn
> S    s1000454 AlfaInformatica-RuG
> E    [EMAIL PROTECTED]
> W    http://www.let.rug.nl/~s1000454
> +++++++++++++++++++++++++++++++++++

ciao SVEN



--- End Message ---
--- Begin Message ---
Your example should work....
Maybe something else is the problem?

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Paul Nowosielski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 24, 2003 8:45 PM
To: [EMAIL PROTECTED]
Subject: [PHP] ereg_replace and quotation marks


I'm trying to strip quotation marks out of user from input but it
doesn't seem to work correctly.

$string=ereg_replace("\"","",$string);

I get a \ mark after I run a quote  through the form. When I want the
quote turned to nothing.

Any suggestions??

Paul
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
maybe stripslashes() can solve your problem?

Paul Nowosielski wrote:
> I'm trying to strip quotation marks out of user from input but it
> doesn't seem to work correctly.
>
> $string=ereg_replace("\"","",$string);
>
> I get a \ mark after I run a quote  through the form. When I want the
> quote turned to nothing.
>
> Any suggestions??
>
> Paul



--- End Message ---
--- Begin Message ---
Hello

What you are asking isn't possible that way. 
You have to write a controller script that calls the appropriate functions 
on your object.
Example:
controller.php  is the controller script

A link on your page:
<a href="controller.php?action=someAction">Some Action</a>

In controller.php you do something like:
<?php
        if(isset($_POST['action']))
        {
                switch $_POST['action']
                {
                        case 'someAction':
                                //Do what ever you need to
                                break;
                        ...
                }
        }
        .... 
?>

You might also want to look into url rewriting for building searchengine 
friendly urls.

Regards
Stefan Langer


--- End Message ---
--- Begin Message ---
What would be the correct syntax?

1. $_SESSION[test]
2. $_SESSION['test']
3. $_SESSION["test"]

mfg.
harry wiens



--- End Message ---
--- Begin Message ---

Harry Wiens wrote:
What would be the correct syntax?

1. $_SESSION[test]

in this case "test" is a constant and must be defined by calling define("test", some_integer_value) before

2. $_SESSION['test']

this is correct. but variables will not be equaled in the string. so when using '' brackets, you cant write $var = 'hello $name!'. even escape chars (\n, etc.) aren't resolved.

3. $_SESSION["test"]

this is best practise for most cases. you can write variables inside the string, which will be substituted by their values and escape chars are resolved


mfg. harry wiens




--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Harry Wiens [mailto:[EMAIL PROTECTED]
> Sent: 25 June 2003 09:04
> 
> What would be the correct syntax?
> 
> 1. $_SESSION[test]
> 2. $_SESSION['test']
> 3. $_SESSION["test"]

All of these are correct depending on the context.  What's your context?

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message --- At 10:08 25-6-03, you wrote:


Harry Wiens wrote:
What would be the correct syntax?
1. $_SESSION[test]

in this case "test" is a constant and must be defined by calling define("test", some_integer_value) before

But PHP is extremely tolerant and if it cannot find a defined constant called test, or if the array is between double quotes, PHP will read thsi as if it is $_SESSION['test'];


example: echo " bla $_SESSION[test] bla ";


--- End Message ---
--- Begin Message ---
On Wed, 25 Jun 2003, Chris Hayes wrote:

> At 10:08 25-6-03, you wrote:
>
>
> >Harry Wiens wrote:
> >>What would be the correct syntax?
> >>1. $_SESSION[test]
> >
> >in this case "test" is a constant and must be defined
> >by calling define("test", some_integer_value) before
>
> But PHP is extremely tolerant and if it cannot find a defined constant
> called test, or if the array is between double quotes, PHP will read thsi
> as if it is $_SESSION['test'];
>
> example: echo " bla    $_SESSION[test]   bla ";
----

or: echo " bla  {$_SESSION['test']}  bla ";

----
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

                                             Hidayet Dogan
                              [EMAIL PROTECTED]

Pleksus Bilisim Teknolojileri D.T.O. A.S.
----------------------------------------------------------
caldiran sok. 14/6 06420 kolej ankara * www.pleksus.com.tr
tel : +90 312 4355343 * faks: +90 312 4354006




--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Chris Hayes [mailto:[EMAIL PROTECTED]
> Sent: 25 June 2003 12:02
> 
> At 10:08 25-6-03, you wrote:
> 
> >Harry Wiens wrote:
> >>What would be the correct syntax?
> >>1. $_SESSION[test]
> >
> >in this case "test" is a constant and must be defined
> >by calling define("test", some_integer_value) before
> 
> But PHP is extremely tolerant and if it cannot find a defined 
> constant 
> called test, or if the array is between double quotes, PHP 
> will read thsi 
> as if it is $_SESSION['test'];
> 
> example: echo " bla    $_SESSION[test]   bla ";

In a double-quoted string, PHP does *not* look for a constant called "test"
in this situation.

Outside strings, it does -- and whilst it's true that if the constant is
undefined PHP will substitute the equivalent string, this is bad practice on
two counts: (1) what if you forget you've done it and at a later date add a
define for a constant called 'test' with some other value? (2) your script
will run fractionally slower because PHP is doing the extra, unnecessary,
constant lookup (may be only tiny per lookup, but if you have many of them
per script, it could add up).

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message ---
I need some advice on how to go about importing rtf files page by page
seperatly into a mysql database, or some way  that can read a file and
break each page into page sized sections, maybe an array, that i could
then import to a database.

The rtf files are mostly about '7mb' in size, and contain anything upto 200
pages, and need to be imported by :

id, filename, page_number , page_content.

I can read whole file into a data table, but that doesnt split the file page
by page.

Has anyone any suggestion to how this can be accomplished,

Steven



--- End Message ---
--- Begin Message ---
hi steven,

i don't know the rft-file-syntax, but i would start here. if you find out,
how the page break is defined, you could splitt the whole file by that.

but i assume, that works only on manual page-breaks. and like other
text-files (i.e. .txt or .doc) the page-break is done by the progamm that
opens the file. in that case, maybe a splitt by chapter or by a special
amount of lines would be a start?

ciao SVEN

Steven wrote:
> I need some advice on how to go about importing rtf files page by page
> seperatly into a mysql database, or some way  that can read a file and
> break each page into page sized sections, maybe an array, that i could
> then import to a database.
>
> The rtf files are mostly about '7mb' in size, and contain anything
> upto 200 pages, and need to be imported by :
>
> id, filename, page_number , page_content.
>
> I can read whole file into a data table, but that doesnt split the
> file page by page.
>
> Has anyone any suggestion to how this can be accomplished,
>
> Steven



--- End Message ---
--- Begin Message ---
there is a program called LivePerson, which tells you what IP address they
are using, where they are situated and how they got to your site.

Used for commercial websites, like online travel consulting company.
----- Original Message -----
From: "Miranda, Joel Louie M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 09, 2003 7:50 AM
Subject: [PHP] status of current online users


> Hello,
>
> I was wondering how did some people do that they can display current
active
> users on a webpage? I was hoping to find even simple info about this even
on
> a first site basis only. Any ideas and howto's/docs will be great.
>
> Thanks,
> Louie
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hi guys,
 
I wrote a generic getsql() function for my project's class. However, I
only manage to retrieve a single row. What it should really do is:
Read all rows into the array (with multiple results).
The code is below:
 
function getsql($sql,$conn,$dbase,&$arr)
{
            if($conn)
            {
                        mysql_select_db($dbase,$conn);
                        $result = mysql_query($sql,$conn);
                        
                        while ($arr = mysql_fetch_assoc($result))
                        {
                                    return $arr;
// Something has to happen here!!!
                        }
            }
            else
            {
                        $arr["Error"] = "No connection";
                        return $arr;        
            }           
}
 
Thanks.
 
Thomas

--- End Message ---
--- Begin Message ---
Thomas Hochstetter wrote:
> Hi guys,
> 
> I wrote a generic getsql() function for my project's class. However, I
> only manage to retrieve a single row. What it should really do is:
> Read all rows into the array (with multiple results). The code is
> below: 
> 
> function getsql($sql,$conn,$dbase,&$arr)
> {
>             if($conn)
>             {
>                         mysql_select_db($dbase,$conn);
>                         $result = mysql_query($sql,$conn);
> 
>                         while ($arr = mysql_fetch_assoc($result))    
>                                     { return $arr;
> // Something has to happen here!!!
>                         }
>             }

I think your problem is that you are returning after the first row has been
read, what you need to do is add the row ($arr) to another array using
$new_array[] = $arr or similar. and then move the return $arr to after the
while loop, but then return $new_array not $arr.

Hope this makes sense.

Alastair


==============================================================================
IMPORTANT NOTICE

The information contained in this e-mail is confidential. It may also
be legally privileged. It is intended only for the stated
addressee(s) and access to it by any other person is unauthorised. If
you are not an addressee, you must not disclose, copy, circulate or
in any other way use or rely on the information contained in this
e-mail. Such unauthorised use may be unlawful.

If you have received this e-mail in error, please inform
Racal Instruments Ltd. immediately by emailing
[EMAIL PROTECTED] or phoning +44 (0)1628 604455 (ask
for the I.T. Dept.) and delete it and all copies from your system.

www.racalinstruments.com

==============================================================================


--- End Message ---
--- Begin Message ---
I need my ldap bind to check whether a user is member
of a group, but the user isn't exclusively from that
group.
So for example, I have the user "jbrown" and the ldap
connection string:
$r=ldap_bind($ds, "uid=$uid,
ou=people,dc=mycompany,dc=mydomain,dc=dom", $passw);

That works fine. But I need to check whether jbrown is
part of the group "admins" (Cn=admins). 
In apache the authldap connects has the feature to
check groups:
AuthLDAPURL
ldap://myserver/ou=people,dc=mycompany,dc=mydomain,dc=dom
require group
cn=admins,ou=people,dc=mycompany,dc=mydomain,dc=dom


How can I do the same with a php script?

thanks, 

Jay

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--- End Message ---
--- Begin Message ---

Hey all,

just to inform u that the choice for baccalaureat 2003 website in tunisia was PHP and 
redhat (www.bac.tn)

http://193.95.69.17/ 

the 1st year it was using oracle, windows, then windows 2000 in load balancing and now 
redhat linux !!

this is what i call the good choice ;)

Cheers,
Hatem

--- End Message ---
--- Begin Message ---
I have error reporting turned off in my php.ini file on my production
server.  I have an app I'm writing that I need to run on the same server (no
one can see it though).  Anyway.  I want to turn on error reporting during
runtime for this particular app while I'm debugging it.  so I put
error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); in the script,
but I don;t see any warnings.  I also tried error_reporting(2047); or
error_reporting(8);  still nothing.  To sest it, I tried to echo some random
variable that doesn't exist in the very next line, but no warning about it.
So what gives?  What am I doing wrong?  Basicaly I want the same effect as
if I had error_reporting  =  E_ALL set in php.ini.

- Anthony



--- End Message ---
--- Begin Message ---
This is hardly perfect since it shows all errors, but it works for me:

ini_set( 'display_errors',       1 );
ini_set( 'log_errors',           1 );
ini_set( 'error_reporting',     -1 );


Anthony wrote:
> 
> I have error reporting turned off in my php.ini file on my production
> server.  I have an app I'm writing that I need to run on the same server (no
> one can see it though).  Anyway.  I want to turn on error reporting during
> runtime for this particular app while I'm debugging it.  so I put
> error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); in the script,
> but I don;t see any warnings.  I also tried error_reporting(2047); or
> error_reporting(8);  still nothing.  To sest it, I tried to echo some random
> variable that doesn't exist in the very next line, but no warning about it.
> So what gives?  What am I doing wrong?  Basicaly I want the same effect as
> if I had error_reporting  =  E_ALL set in php.ini.
> 
> - Anthony
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org   |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the  |
| stuff of nightmares grasp for your soul.    |
`---------------------------------------------'

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Anthony [mailto:[EMAIL PROTECTED]
> Sent: 25 June 2003 12:36
> 
> I have error reporting turned off in my php.ini file on my production
> server.  I have an app I'm writing that I need to run on the 
> same server (no
> one can see it though).  Anyway.  I want to turn on error 
> reporting during
> runtime for this particular app while I'm debugging it.  so I put
> error_reporting (E_ERROR | E_WARNING | E_PARSE | E_NOTICE); 
> in the script,
> but I don;t see any warnings.  I also tried error_reporting(2047); or
> error_reporting(8);  still nothing.  To sest it, I tried to 
> echo some random
> variable that doesn't exist in the very next line, but no 
> warning about it.
> So what gives?  What am I doing wrong?  Basicaly I want the 
> same effect as
> if I had error_reporting  =  E_ALL set in php.ini.

Well, that would be error_reporting(E_ALL);

Do you also have display_error turned Off in php.ini?  If so, this
suppresses all error from the output, regardless of the error_reporting
level -- you'll need to turn it back on as well using
ini_set('display_errors', '1');.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

--- End Message ---
--- Begin Message ---
Hi,

Can anyone suggest the best method (plain
substitution, gettext or db) for implementing a shop
cart with multilanguage support?.As the cart will be
hosted with multiple clients which of these approach
is best for the long run, and which requires less
client intervension.Also i would like to know what all
should i keep in mind with before converting my
scripts using gettext() if i am to use the gettext
option.


Thanks 
Arvi

=====
---------------------------------------------------------------------------
 if you aint living on the edge you're taking up too much space....
----------------------------------------------------------------------------

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

--- End Message ---

Reply via email to