php-general Digest 2 Sep 2002 09:32:28 -0000 Issue 1561

Topics (messages 114851 through 114887):

dumping mysql database with php script
        114851 by: rdkurth.starband.net
        114879 by: rdkurth.starband.net
        114881 by: Petre Agenbag
        114882 by: rdkurth.starband.net
        114883 by: rdkurth.starband.net

Re: str_replace question
        114852 by: Gregor J
        114853 by: olinux
        114887 by: Erwin

using shell_exec
        114854 by: rdkurth.starband.net
        114871 by: Todd Pasley
        114873 by: Todd Pasley
        114876 by: rdkurth.starband.net
        114878 by: Erwin

fopen() and flock()
        114855 by: David McInnis

Chaillan->Re: [PHP] Re: PHP shopping
        114856 by: Ryan A

PHP checkbox/hidden field question
        114857 by: Paul Maine
        114880 by: Erwin

Imap Open Timeout
        114858 by: Andy Chapman

Re: addslashes($variable)?
        114859 by: Justin French

Re: PHP shopping
        114860 by: Justin French
        114861 by: David T-G

Re: Imagemangick, can I install on a virtual host?
        114862 by: David T-G

unexpected T_SL
        114863 by: Voisine
        114864 by: Peter Houchin
        114865 by: Voisine
        114877 by: Erwin
        114884 by: Steel

Escape characters won't go away
        114866 by: Mike Mannakee
        114868 by: Justin French
        114869 by: Mike Mannakee

regex help
        114867 by: Gerard Samuel

linking to secure ssl page using php and Microsoft Explorer - general error serviing 
up page from MSE... Netscape works fine
        114870 by: phplist

Still cannot get gd graphics to work....
        114872 by: David Herring

Re: Average Number For Math Functions
        114874 by: David Robley

Re: Mail problem
        114875 by: David Robley

Imagemagick
        114885 by: Sascha Braun

Am I just being stupid or something?
        114886 by: Francis

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

I am having a problem with a script to dump a mysql database to a text
file. When I run the command below it creates the database.sql file but
it only puts the first three lines in that file they look like this
# MySQL dump 8.13
#
# Host: localhost    Database: testdata1
#--------------------------------------------------------
# Server version        3.23.37


If I run the following at the command line it work perfect passing the whole
database to the txt file
/usr/bin/mysqldump -u testdata1 -ptestdata1 testdata1
> /home/sites/www.directphp.net/sitebackup/databases/testdata1.sql

Why is it stopping on the third line when I run it with a PHP script

This is my script


$sql="Select * from datba where domname = '$domname'";
$results=safe_query($sql);
while($row = mysql_fetch_array($result)){
$databasename=$row["databasename"];
$databaseusername=$row["$databaseusername"];
$databasepassword=$row["$databasepassword"];
exec("/usr/bin/mysqldump -u $databaseusername -p$databasepassword $databasename > 
$Databasesdir/$databasename.sql");
}


-- 
Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]

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

I am having a problem with a script to dump a mysql database to a text
file. When I run the command below it creates the database.sql file but
it only puts the first three lines in that file they look like this
# MySQL dump 8.13
#
# Host: localhost    Database: testdata1
#--------------------------------------------------------
# Server version        3.23.37


If I run the following at the command line it work perfect passing the whole
database to the txt file
/usr/bin/mysqldump -u testdata1 -ptestdata1 testdata1
> /home/sites/www.directphp.net/sitebackup/databases/testdata1.sql

Why is it stopping on the third line when I run it with a PHP script

This is my script

while($row = mysql_fetch_array($result)){
$databasename=$row["databasename"];
$databaseusername=$row["$databaseusername"];
$databasepassword=$row["$databasepassword"];

exec("/usr/bin/mysqldump -u $databaseusername -p$databasepassword $databasename >
$Databasesdir/$databasename.sql");
}


  

-- 
Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
put the exec(...) line OUTSIDE the while loop.As your codeis now, it's
dumping with each new row , so i'ts overwriting itself.

On Mon, 2002-09-02 at 09:47, [EMAIL PROTECTED] wrote:
> 
> I am having a problem with a script to dump a mysql database to a text
> file. When I run the command below it creates the database.sql file but
> it only puts the first three lines in that file they look like this
> # MySQL dump 8.13
> #
> # Host: localhost    Database: testdata1
> #--------------------------------------------------------
> # Server version        3.23.37
> 
> 
> If I run the following at the command line it work perfect passing the whole
> database to the txt file
> /usr/bin/mysqldump -u testdata1 -ptestdata1 testdata1
> > /home/sites/www.directphp.net/sitebackup/databases/testdata1.sql
> 
> Why is it stopping on the third line when I run it with a PHP script
> 
> This is my script
> 
> while($row = mysql_fetch_array($result)){
> $databasename=$row["databasename"];
> $databaseusername=$row["$databaseusername"];
> $databasepassword=$row["$databasepassword"];
> 
> exec("/usr/bin/mysqldump -u $databaseusername -p$databasepassword $databasename >
> $Databasesdir/$databasename.sql");
> }
> 
> 
>   
> 
> -- 
> Best regards,
>  rdkurth                          mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Hello Petre,
There is more than one database to back up so every time it runs
through the while loop it is suppose to back up the next database and
it changes the name of the text file it is sending it to.

I have already tried just doing one database without the while loop
and I get the same results.
So it is not an over writing  problem
But Thanks anyway

Monday, September 02, 2002, 12:51:12 AM, you wrote:


PA> put the exec(...) line OUTSIDE the while loop.As your codeis now, it's
PA> dumping with each new row , so i'ts overwriting itself.

PA> On Mon, 2002-09-02 at 09:47, [EMAIL PROTECTED] wrote:
>> 
>> I am having a problem with a script to dump a mysql database to a text
>> file. When I run the command below it creates the database.sql file but
>> it only puts the first three lines in that file they look like this
>> # MySQL dump 8.13
>> #
>> # Host: localhost    Database: testdata1
>> #--------------------------------------------------------
>> # Server version        3.23.37
>> 
>> 
>> If I run the following at the command line it work perfect passing the whole
>> database to the txt file
>> /usr/bin/mysqldump -u testdata1 -ptestdata1 testdata1
>> > /home/sites/www.directphp.net/sitebackup/databases/testdata1.sql
>> 
>> Why is it stopping on the third line when I run it with a PHP script
>> 
>> This is my script
>> 
>> while($row = mysql_fetch_array($result)){
>> $databasename=$row["databasename"];
>> $databaseusername=$row["$databaseusername"];
>> $databasepassword=$row["$databasepassword"];
>> 
>> exec("/usr/bin/mysqldump -u $databaseusername -p$databasepassword $databasename >
>> $Databasesdir/$databasename.sql");
>> }
>> 
>> 
>>   
>> 
>> -- 
>> Best regards,
>>  rdkurth                          mailto:[EMAIL PROTECTED]
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 




-- 
Best regards,
 rdkurth                            mailto:[EMAIL PROTECTED]

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


I figured it out it was a permission problem with database username and
password

Monday, September 02, 2002, 12:51:12 AM, you wrote:


PA> put the exec(...) line OUTSIDE the while loop.As your codeis now, it's
PA> dumping with each new row , so i'ts overwriting itself.

PA> On Mon, 2002-09-02 at 09:47, [EMAIL PROTECTED] wrote:
>> 
>> I am having a problem with a script to dump a mysql database to a text
>> file. When I run the command below it creates the database.sql file but
>> it only puts the first three lines in that file they look like this
>> # MySQL dump 8.13
>> #
>> # Host: localhost    Database: testdata1
>> #--------------------------------------------------------
>> # Server version        3.23.37
>> 
>> 
>> If I run the following at the command line it work perfect passing the whole
>> database to the txt file
>> /usr/bin/mysqldump -u testdata1 -ptestdata1 testdata1
>> > /home/sites/www.directphp.net/sitebackup/databases/testdata1.sql
>> 
>> Why is it stopping on the third line when I run it with a PHP script
>> 
>> This is my script
>> 
>> while($row = mysql_fetch_array($result)){
>> $databasename=$row["databasename"];
>> $databaseusername=$row["$databaseusername"];
>> $databasepassword=$row["$databasepassword"];
>> 
>> exec("/usr/bin/mysqldump -u $databaseusername -p$databasepassword $databasename >
>> $Databasesdir/$databasename.sql");
>> }
>> 
>> 
>>   
>> 
>> -- 
>> Best regards,
>>  rdkurth                          mailto:[EMAIL PROTECTED]
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 




-- 
Best regards,
 rdkurth                            mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Same as with <b>".$reserved_words."</b>, i get Array :)


"Chaillan Nicolas" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What about a
> str_replace($reserved_words, "<b>$reserved_words</b>",$string);
>
> Tell me.
>
>
> --
> Merci de nous avoir choisi. - Thanks you for your choice.
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> www.GroupAKT.com - Hébergement Group.
> www.WorldAKT.com - Hébergement de sites Internet
> "Gregor Jak¹A" <[EMAIL PROTECTED]> a écrit dans le message de news:
> [EMAIL PROTECTED]
> > Hello, i have array $reserved_words which i want to replace with bold ..
> > but when i tried to do str_replace($reserved_words,
> > "<b>".$reserved_words."</b>", $string) it showed Array instead of
> > <b>word</b>
> > if i simply do  str_replace($reserved_words, $reserved_words, $string)
> then
> > it shows the words not Array but not in bold ;)
> > I know i could use 2 arrays one with bold words one without or i could
use
> > foreach but i want a simpler solution :)... Any suggestions ?
> >
> >
> > thx in advance !
> >
> >
>
>


--- End Message ---
--- Begin Message ---
something like this should do

foreach ($reserved_words as $key => $value)
{
   $reserved_words_bold[$key] = '<b>'.$value.'</b>';
}
$string = str_replace($reserved_words,
$reserved_words_bold,$string);

olinux


--- Gregor J <[EMAIL PROTECTED]> wrote:
> Same as with <b>".$reserved_words."</b>, i get Array
> :)
> 
> 
> "Chaillan Nicolas" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > What about a
> > str_replace($reserved_words,
> "<b>$reserved_words</b>",$string);
> >
> > Tell me.
> >
> >
> > --
> > Merci de nous avoir choisi. - Thanks you for your
> choice.
> > Nicos - CHAILLAN Nicolas
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > www.GroupAKT.com - Hébergement Group.
> > www.WorldAKT.com - Hébergement de sites Internet
> > "Gregor Jak¹A" <[EMAIL PROTECTED]> a écrit
> dans le message de news:
> > [EMAIL PROTECTED]
> > > Hello, i have array $reserved_words which i want
> to replace with bold ..
> > > but when i tried to do
> str_replace($reserved_words,
> > > "<b>".$reserved_words."</b>", $string) it showed
> Array instead of
> > > <b>word</b>
> > > if i simply do  str_replace($reserved_words,
> $reserved_words, $string)
> > then
> > > it shows the words not Array but not in bold ;)
> > > I know i could use 2 arrays one with bold words
> one without or i could
> use
> > > foreach but i want a simpler solution :)... Any
> suggestions ?
> > >
> > >
> > > thx in advance !
> > >
> > >
> >
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com
--- End Message ---
--- Begin Message ---
> Hello, i have array $reserved_words which i want to replace with bold
> .. but when i tried to do str_replace($reserved_words,
> "<b>".$reserved_words."</b>", $string) it showed Array instead of
> <b>word</b>
> if i simply do  str_replace($reserved_words, $reserved_words,
> $string) then it shows the words not Array but not in bold ;)
> I know i could use 2 arrays one with bold words one without or i
> could use foreach but i want a simpler solution :)... Any suggestions

That does make sence.
You try to append <b> and prepend </b> to an array, which will (of course)
be converted to string then. Result is that you're call to the str_replaced
function can also be written as:

str_replace(  $reserved_words, '<b>Array</b>', $string )

which is definitely not what you want!
You have two options:
a) Create another array of reserved_words, only then appended and prepended
with <b> and </b>
b) Use the code from Olinux

Option B sounds best to me ;-))

HTH
Erwin


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

Can somebody tell me way this will work at the command line but will
not work using PHP I also tried exec and system. from the command line
it adds all the files and directors. But using the script below from
PHP it creates an empty archive.

shell_exec("cd /home/sites/www.directphp.net/ | tar --create --verbose
--file=/home/sites/www.directphp.net/sitebackup/backup.192002.tar web");

  

-- 
Best regards,
 rdkurth                          mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Use ; instead of | 

e.g.

shell_exec("cd /change/to/dir; tar cvf /place/for/backup.tar files");

Todd.


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 2 September 2002 9:40 AM
> To: php-general
> Subject: [PHP] using shell_exec
> 
> 
> 
> Can somebody tell me way this will work at the command line but will
> not work using PHP I also tried exec and system. from the command line
> it adds all the files and directors. But using the script below from
> PHP it creates an empty archive.
> 
> shell_exec("cd /home/sites/www.directphp.net/ | tar --create --verbose
> --file=/home/sites/www.directphp.net/sitebackup/backup.192002.tar web");
> 
>   
> 
> -- 
> Best regards,
>  rdkurth                          mailto:[EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Only just noticed this when I read my post...

Why do you want to use verbose?

If you want to capture the output for some reason, use this....

exec("cd /change/to/dir; tar cvf /place/for/backup.tar files",
$capturedoutput);

otherwise drop the v (or --verbose) which will chew less resources.

Todd.

> -----Original Message-----
> From: Todd Pasley [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 2 September 2002 1:32 PM
> To: Richard Kurth; php-general
> Subject: RE: [PHP] using shell_exec
>
>
> Use ; instead of |
>
> e.g.
>
> shell_exec("cd /change/to/dir; tar cvf /place/for/backup.tar files");
>
> Todd.
>
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, 2 September 2002 9:40 AM
> > To: php-general
> > Subject: [PHP] using shell_exec
> >
> >
> >
> > Can somebody tell me way this will work at the command line but will
> > not work using PHP I also tried exec and system. from the command line
> > it adds all the files and directors. But using the script below from
> > PHP it creates an empty archive.
> >
> > shell_exec("cd /home/sites/www.directphp.net/ | tar --create --verbose
> > --file=/home/sites/www.directphp.net/sitebackup/backup.192002.tar web");
> >
> >
> >
> > --
> > Best regards,
> >  rdkurth                          mailto:[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
>

--- End Message ---
--- Begin Message ---
Hello Todd,
 verbose was just in there so I could see what was going on at the
 command line it is not in the php script becase there is no need for
 it

Sunday, September 01, 2002, 8:41:42 PM, you wrote:


TP> Only just noticed this when I read my post...

TP> Why do you want to use verbose?

TP> If you want to capture the output for some reason, use this....

TP> exec("cd /change/to/dir; tar cvf /place/for/backup.tar files",
TP> $capturedoutput);

TP> otherwise drop the v (or --verbose) which will chew less resources.

TP> Todd.

>> -----Original Message-----
>> From: Todd Pasley [mailto:[EMAIL PROTECTED]]
>> Sent: Monday, 2 September 2002 1:32 PM
>> To: Richard Kurth; php-general
>> Subject: RE: [PHP] using shell_exec
>>
>>
>> Use ; instead of |
>>
>> e.g.
>>
>> shell_exec("cd /change/to/dir; tar cvf /place/for/backup.tar files");
>>
>> Todd.
>>
>>
>> > -----Original Message-----
>> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>> > Sent: Monday, 2 September 2002 9:40 AM
>> > To: php-general
>> > Subject: [PHP] using shell_exec
>> >
>> >
>> >
>> > Can somebody tell me way this will work at the command line but will
>> > not work using PHP I also tried exec and system. from the command line
>> > it adds all the files and directors. But using the script below from
>> > PHP it creates an empty archive.
>> >
>> > shell_exec("cd /home/sites/www.directphp.net/ | tar --create --verbose
>> > --file=/home/sites/www.directphp.net/sitebackup/backup.192002.tar web");
>> >
>> >
>> >
>> > --
>> > Best regards,
>> >  rdkurth                          mailto:[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
>>





-- 
Best regards,
 rdkurth                            mailto:[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
Todd Pasley wrote:
> Use ; instead of |
>
> e.g.
>
> shell_exec("cd /change/to/dir; tar cvf /place/for/backup.tar files");

Or, if you only want tar to execute after changing directories has
succeeded, use && instead of |

e.g.

shell_exec("cd /change/to/dir && tar cvf /place/for/backup.tar files");

Grtz Erwin


--- End Message ---
--- Begin Message ---
I use fopen() in a template system that I have developed.  I noticed
that occasionally I get blank pages served up.  Here is one of my
snippets.

$filename = "$ROOTDIR/content/myfile.txt";
$fd = fopen ($filename, "r");
$PAGE_CONTENT  = fread ($fd, filesize ($filename));
fclose ($fd);

Doing this I get the contents of the file read into the $PAGE_CONTENT
variable.  

I never use fopen() to write to files.  Only read with the "r"
directive.  So what could be causing my conflicts?  Do I need to flock
the file to shared?

I am running Linux PHP, Apache and Linux.

David McInnis

--- End Message ---
--- Begin Message ---
Hey,
Thanks for your reply,
I have no problems trying to make an upload script as I have seen lots of
dudes on the list doing so and I know if I screw up being a newbie there are
a lot of people on the list who will be kind enough to help me.
I am trying to learn PHP, and no, I did not think this was a newsletter to
get free programs, coz I tried the search engines and script archives and
didnt get anyway I was hopeing someone on the list had come accross such a
program....a desperate bid I know.
If I have to make this myself I was hopeing someone would share some
valuable info on shopping cart theory as i'm sure its pretty complex to
begin with.

I'll take your advise and see what I can find on PHP.net though, thanks.

Cheers,
-Ryan A.

> Hi,
>
> Making an upload script is really easy, I can't do it because of too much
> work, but you should learn php yourself to do that, anyway this is not a
> newsletter to get free programs. Just look at www.php.net and start
reading
> the manual to learn PHP.
>
> --
> Merci de nous avoir choisi. - Thanks you for your choice.
> Nicos - CHAILLAN Nicolas
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> www.GroupAKT.com - Hébergement Group.
> www.WorldAKT.com - Hébergement de sites Internet
> "Ryan A" <[EMAIL PROTECTED]> a écrit dans le message de news:
> 000a01c251f7$d80eb650$[EMAIL PROTECTED]
> Hi guys,
> Kinda reached the end of my line, searched on
yahoo,google,altavista,excite
> etc and hotscripts,scriptsearch etc but could not find what i require....
>
> I need a shopping cart software which will display and sell .swf files, it
> does *not* have to integrate with ANY ecom credit card processing.
>
> Basically all I want it to do is give me a chance to upload a .swf file in
a
> category (eg: images/text/movies etc) and should allow the visitor to
search
> that category,take an order and email it to me....
>
> Have any or you seen such a script anywhere? unfortunately I dont know PHP
> to make it myself and am not rich to order custom programming......I am
> hoping that someone has already made the script and has made it available
to
> the public.
> Anybody?
>
> or even if you know a place (URL) where I can learn shopping cart examples
> kindly direct me to it so maybe i can learn?
>
> Cheers and thank you for reading this message.
> -Ryan
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I am executing the follwoing statement as part of a "while" loop. This is
part of a form and I wish to pass the name and value of the checkbox as a
hidden field only is the checkbox is checked. Can you suggest how I can
accomplish this task?


<td><input type="checkbox" name="d_c_arr[]" value="<?php echo
$db->f("order_id") ?>"></td>

Thank You
Paul
php

--- End Message ---
--- Begin Message ---
> I am executing the follwoing statement as part of a "while" loop.
> This is part of a form and I wish to pass the name and value of the
> checkbox as a hidden field only is the checkbox is checked. Can you
> suggest how I can accomplish this task?
>
>
> <td><input type="checkbox" name="d_c_arr[]" value="<?php echo
> $db->f("order_id") ?>"></td>

As you might know, checkboxes don't have the VALUE attribute. HTML won't
even submit the VALUE attribute to the next page. You will only have an
array containing 0's and 1's, the results of the checkboxes. So, on the next
page, you will have to lookup the values again.
Then print the hidden input's to the page in a for loop, while looping
trough $d_c_arr.

HTH
Erwin


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

just wondering if there is any easy way to set a timeout on
the Imap Open function.  I've written a script that polls
about 50 different peoples e-mail accounts and sometimes it
gets stuck on a few accounts that are taking ages to
respond.

Any thoughts would be gratefully received.

Cheers,
Andy Chapman


--- End Message ---
--- Begin Message ---
on 01/09/02 10:23 PM, cLeAnEr ([EMAIL PROTECTED]) wrote:

> Hi.
> I have recently started prograemming some php. Now I wonder exactly what
> addslashes() is good for...
> I´ve read about it that it insert slashes where needed to get data in right
> form to Mysql? and then use stripeslashes() to remove slashes when reciving
> data out of database?

Yes.  Depending on your server set-up, adding strings to your database which
include quotes will produce errors.  Escaping them (adding a slash) will
prevent this, and then the slashes will to be removed on the way out of the
DB.


Justin

--- End Message ---
--- Begin Message ---
on 02/09/02 6:40 AM, Ryan A ([EMAIL PROTECTED]) wrote:

> Hi guys,
> Kinda reached the end of my line, searched on yahoo,google,altavista,excite
> etc and hotscripts,scriptsearch etc but could not find what i require....
> 
> I need a shopping cart software which will display and sell .swf files, it
> does *not* have to integrate with ANY ecom credit card processing.

So how do they place an order?  You said the cart produces an email, but
does that email include a credit card number, bank details or anything else
secure?

> Basically all I want it to do is give me a chance to upload a .swf file in a
> category (eg: images/text/movies etc) and should allow the visitor to search
> that category,take an order and email it to me....

There is a perfect upload example in the PHP manual.
http://www.php.net/manual/en/features.file-upload.php

The rest of it is all pretty standard shopping cart stuff, except you want
to be searching off directories of SWF files.  This is of course similar to
searching directories for MP3s or for images.  So perhaps this will help
broaden your search/cart search.

The strange bit is that in the case of a SWF, Image, MP3, etc etc, by the
time you search the directory and file the file, there's no point adding the
item to the cart, because you can just save (steal) it directly from the
browser.


> Have any or you seen such a script anywhere? unfortunately I dont know PHP to
> make it myself and am not rich to order custom programming......I am hoping
> that someone has already made the script and has made it available to the
> public.

The simple answer is to learn some PHP.  But first you need to refine your
business model and flow.  You don't need anything complex, but you have a
reasonably unique criteria, which is pretty conducive to learning some PHP
and building exactly what you want, just like most of us do everyday.


> Anybody?
> 
> or even if you know a place (URL) where I can learn shopping cart examples
> kindly direct me to it so maybe i can learn?

Sorry, this is a really big question.  You really need to learn:

1. sessions (remembering a user, and remembering what the user has in thier
cart) -- maybe start with Kevin Yank's article and develop it into what you
need? http://www.webmasterbase.com/article/319

2. looking through directory structures (see the user contributed notes on
all of the filesystem pages of php.net:
http://www.php.net/manual/en/ref.filesystem.php)

3. email using mail() see php.net/mail

4. possibly SSL on the server

5. possibly encryption with a key using the mycrypt functions of PHP


I seriously doubt you'll find a cart which does everything you want... so
why not start researching these topics, and start building your own.   At
the end of the project, you'll know a heap about PHP :)


Justin


> Cheers and thank you for reading this message.
> -Ryan
> 
> 

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

...and then Ryan A said...
% 
% Hi guys,

Hello!


% Kinda reached the end of my line, searched on yahoo,google,altavista,excite etc and 
hotscripts,scriptsearch etc but could not find what i require....

Of course not; it's never that easy :-)


% 
% I need a shopping cart software which will display and sell .swf files, it does 
*not* have to integrate with ANY ecom credit card processing.

Hmmm...  No ccard stuff; how will you make any money?


% 
% Basically all I want it to do is give me a chance to upload a .swf file in a 
category (eg: images/text/movies etc) and should allow the visitor to search that 
category,take an order and email it to me....

So far all you've mentioned are an upload script for you and a search
engine for your visitors.  Both of those things are fairly easy and don't
require any special cart software.


% 
% Have any or you seen such a script anywhere? unfortunately I dont know PHP to make 
it myself and am not rich to order custom programming......I am hoping that someone 
has already made the script and has made it available to the public.
% Anybody?

Nothing like that...  Of course, I wouldn't call that a shopping cart,
either!


% 
% or even if you know a place (URL) where I can learn shopping cart examples kindly 
direct me to it so maybe i can learn?

If I were you I'd start with upload scripts and search engines.  Once you
get those done (particularly the latter), then you might look at how to
keep your users from grabbing the files and instead going through
whatever hoops you want to have up...

I know you said you weren't rich, but if you insist that you can't write
this stuff yourself I might be able to help out; I need to build my code
library to show off :-)


% 
% Cheers and thank you for reading this message.
% -Ryan


HTH & HAND

:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg77454/pgp00000.pgp
Description: PGP signature

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

...and then Al said...
% 
% I'd like to use some of the Imagemagick functions; but my virtual host 
% doesn't include it and won't bother to install it.

Phooey on them.  You should switch to me :-)


% 
% Is it practical to install Imagemagick php on a virtual host?

Sure; it doesn't have to be under /usr or /usr/local by any means.


% 
% Has php.  It's not a shell account.  FTP is the only basic access.

The trick will be compiling it.  If you don't have an identical (or
nearly so) platform, then you'll have to compile on your server.  I
suppose if you were really sneaky you could write some php scripts that
run your config and compile for you :-) but you'll probably need access
to a shell at least temporarily.


HTH & HAND

:-D
-- 
David T-G                      * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/    Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: msg77454/pgp00001.pgp
Description: PGP signature

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

What is wrong witht his code? Parse error: parse error, unexpected T_SL
in c:\program files\easyphp\www\tutorial\eod.php on line 2

<?php
$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
?>

Regards!
Joe

--- End Message ---
--- Begin Message ---
simple .. look up docs on putting straight text to the screen and u'll find
a number of options such as echo and print i bet ya'd be able to solve
really quickly


> -----Original Message-----
> From: Voisine [mailto:[EMAIL PROTECTED]]
> Sent: Monday, 2 September 2002 12:34 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] unexpected T_SL
>
>
> Hi,
>
> What is wrong witht his code? Parse error: parse error, unexpected T_SL
> in c:\program files\easyphp\www\tutorial\eod.php on line 2
>
> <?php
> $str = <<<EOD
> Example of string
> spanning multiple lines
> using heredoc syntax.
> EOD;
> ?>
>
> Regards!
> Joe
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I know how to use echo and print but I'm learning php so I try to understand
why I have this error with the heredoc syntax.

Thanks!

Peter Houchin wrote:

> simple .. look up docs on putting straight text to the screen and u'll find
> a number of options such as echo and print i bet ya'd be able to solve
> really quickly
>
> > -----Original Message-----
> > From: Voisine [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, 2 September 2002 12:34 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] unexpected T_SL
> >
> >
> > Hi,
> >
> > What is wrong witht his code? Parse error: parse error, unexpected T_SL
> > in c:\program files\easyphp\www\tutorial\eod.php on line 2
> >
> > <?php
> > $str = <<<EOD
> > Example of string
> > spanning multiple lines
> > using heredoc syntax.
> > EOD;
> > ?>
> >
> > Regards!
> > Joe
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >

--- End Message ---
--- Begin Message ---
Voisine wrote:
> Hi,
>
> What is wrong witht his code? Parse error: parse error, unexpected
> T_SL in c:\program files\easyphp\www\tutorial\eod.php on line 2
>
> <?php
> $str = <<<EOD
> Example of string
> spanning multiple lines
> using heredoc syntax.
> EOD;
> ?>

To be honest, there is nothing wrong. It works in version 4.2.2 (at least,
here it does) ;-))

Grtz Erwin


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

Monday, September 2, 2002, 11:28:09 AM, I've got:

E> Voisine wrote:
>> Hi,
>>
>> What is wrong witht his code? Parse error: parse error, unexpected
>> T_SL in c:\program files\easyphp\www\tutorial\eod.php on line 2
>>
>> <?php
>> $str = <<<EOD
>> Example of string
>> spanning multiple lines
>> using heredoc syntax.
>> EOD;
>> ?>

E> To be honest, there is nothing wrong. It works in version 4.2.2 (at least,
E> here it does) ;-))

E> Grtz Erwin

Why not to try
<?php
$str = <<< EOT
???

It seems to me, that EOD  -> End Of Data, and EOT -> End Of Text

Silly, but why not to try? :)

-- 
The Same,
 Steel                            mailto:[EMAIL PROTECTED]
                                       http://www.none.ru

--- End Message ---
--- Begin Message ---
I'm getting multiple backslashes in data I get out of a mysql database.

Example :

...Here\\\'s the d...

No problem.  Except I CANT GET RID OF THEM.  I've tried several things:

1. $string  = stripslashes($string);   - Doesn't do anything

2. $string = ereg_replace("\\\\\\", "", $string); - Doesn't do anything

3. $string = ereg_replace("\\", "", $string); - Gives the following error
message:
Warning: REG_EESCAPE in script.php on line 1684

None of these have worked.  Any thoughts on how to get rid of them? I'm
going batty.

Mike





--- End Message ---
--- Begin Message ---
on 02/09/02 1:14 PM, Mike Mannakee ([EMAIL PROTECTED]) wrote:

> I'm getting multiple backslashes in data I get out of a mysql database.
> 
> Example :
> 
> ...Here\\\'s the d...
> 
> No problem.  Except I CANT GET RID OF THEM.  I've tried several things:
> 
> 1. $string  = stripslashes($string);   - Doesn't do anything

have you tried:

$string = stripslashes(stripslashes($string));
// OR
$string = stripslashes(stripslashes(stripslashes($string)));

For multiple occurrences, you have to call it twice... or even three times.


also try

$string = str_replace("\'", "", $string);
$string = str_replace("\\", "", $string);


Justin French

--- End Message ---
--- Begin Message ---
Thanks.  I just figured it out myself.  I had to change the expression:

$string= ereg_replace("[\\]+", "", $string);

The above is what worked.

Mike


"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> on 02/09/02 1:14 PM, Mike Mannakee ([EMAIL PROTECTED]) wrote:
>
> > I'm getting multiple backslashes in data I get out of a mysql database.
> >
> > Example :
> >
> > ...Here\\\'s the d...
> >
> > No problem.  Except I CANT GET RID OF THEM.  I've tried several things:
> >
> > 1. $string  = stripslashes($string);   - Doesn't do anything
>
> have you tried:
>
> $string = stripslashes(stripslashes($string));
> // OR
> $string = stripslashes(stripslashes(stripslashes($string)));
>
> For multiple occurrences, you have to call it twice... or even three
times.
>
>
> also try
>
> $string = str_replace("\'", "", $string);
> $string = str_replace("\\", "", $string);
>
>
> Justin French
>


--- End Message ---
--- Begin Message ---
Im trying to apply htmlspecialchars() to hrefs in a string.
Here is what I have.
------------------------
<?php

$str = 'hi <b>my friend</b>! <br /> this message uses html entities <a 
href="http://www.trini0.org";>test</a>!';
$str = preg_replace('/(<a href="http:\/\/.*">.*<\/a>)/', 
htmlspecialchars("$1"), $str);
print($str);

?>

Any help would be appreciated.
Thanks

-- 
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/


--- End Message ---
--- Begin Message ---
Get general MSE error when using PHP to go from a non-secure page to an ssl
page. If I use the back button and try it again it will work, so the code
seems solid. Does not fail on Netscape. I heard that there is a Microsoft
Explorer issue with secure pages and/or php. Any ideas on how to resolve?
Stan

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

Help....

I want to install apache 1.3.26 with php 4.2.2 (plus png support) on a 
suse 8.0 machine.

I constantly get segV errors when using imagecreatefrompng.....

Have tried gd 1.8.4 / and the gd beta 2.0.1, have also tried installed 
the latest libpng 1.2.4.

The php INSTALL file makes it seem trivial to have this working ??

Has anyone else having issues with getting png support on the latest 
builds ?

Thanks dave


ps. My php configure look like:-

./configure --enable-debug \
            --with-gd=/usr/local/gd-1.8.4 \
            --with-png-dir=/usr \
            --with-jpeg-dir=/usr \
            --with-zlib-dir=/usr \
            --with-mysql=/usr/local/mysql \
            --with-apxs=/usr/local/apache/bin/apxs \
            --with-config-file-path=/usr/local/apache/config



--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Ok I think your definently going in the right direction - when I put this
> into my "series" I seem to be getting this message for each result:
> "Resource id #40" or some other number that in some way represents
> something?  Any Clue?  Here is my SQL:
> 
> $rsum =mysql_query("select sum(rating) from ratings")or
> die (mysql_error());
> 
> John

You are missing quite a bit there - $rsum is merely a pointer to the data. 
Look at http://www.php.net/mysql_fetch_assoc which has an example of how 
to connect to mysql, issue a query and display the results of the query. 
Also, you might find http://www.php.net/extract useful in future.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
In article <002101c25029$2ca0c490$[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I have this set on both boxes. Here are the settings -
> 
>                   local box (which does send mail)    isp box (does not send
> mail)
> sendmail_from me@@localhost.com                               'no value'
> sendmail_path /usr/sbin/sendmail -t -i                /usr/sbin/sendmail -t -i
> SMTP                  localhost                                       localhost
> 
> 
> >
> >
> > I actually had to set the SMTP setting to localhost on our
> > solaris boxes to
> > get this to work. I discovered this because we have a few
> > older machines
> > without php.ini files altogether, and the default is to have
> > this set (the
> > older machines worked).
> >

You may wish to test the value tht mail() returns - if it returns true 
then the mail has been successfully handed off to the MTA and beyond the 
scope of PHP; in this case you then need to look at your system mail logs 
to see if there is something useful there. It may also be that the mail is 
successfully sent, but bounces for whatever reason; a check of the 
relevant mailboxes (postmaster, admin etc) may turn up more info.

-- 
David Robley
Temporary Kiwi!

Quod subigo farinam
--- End Message ---
--- Begin Message ---
Hi,

I want to use Imagemagick together with PHP, but I'm not able to find some 
documentation for it.

I've read, that some people are buildung an PHP Module for Imagemagick.

And how is the --with-imagemagick command working, when I compile PHP?

Is it possible to compile Imagemagick into PHP on a Windows System for testing?

Or is it just better to set up an Linux Webserver for my test runs.

Where can I find some docs?

PLEASE HELP

Schura
--- End Message ---
--- Begin Message ---
Ok whats going on here:

  echo "Location: ".$_SESSION["Project"]["location"];
  // above echo's "Location: 0"
  if($_SESSION["Project"]["location"] !=""){
   if (checkAccess("folder", $_SESSION["Project"]["location"], "create")){
    newfile();
   }else{
    reportError(1, "Access Denied");
   }
  }else{
   fatelError(1, "Session Location Error");
  }

Ok $_SESSION["Project"]["location"] is set to 0 but for some reason it
always calls fatelError? even tho $_SESSION["Project"]["location"] is set to
0 can anyone see anything wrong? is 0 treated as null or something?



--- End Message ---

Reply via email to