php-general Digest 8 Jun 2002 14:10:08 -0000 Issue 1393

Topics (messages 101231 through 101273):

Re: Form Variables
        101231 by: Beeman

Not php related - php.net logo in Netscape 7?
        101232 by: Leif K-Brooks
        101233 by: Timothy J. Luoma
        101234 by: Stuart Dallas
        101239 by: Timothy J. Luoma
        101261 by: Mark Gallagher

Search a flat file.
        101235 by: Tom Ray
        101236 by: Gaylen Fraley
        101237 by: Tom Ray
        101246 by: Miguel Cruz

CONVERT
        101238 by: sonjaya
        101241 by: Justin French

Re: PHP 4.0.6 file upload problems?
        101240 by: Edward Marczak

Re: eregi not working
        101242 by: Jason Wong

Re: restricting files
        101243 by: Jason Wong
        101244 by: Justin French
        101245 by: Jason Wong
        101250 by: Justin French
        101254 by: Miguel Cruz

Sessions and Forms
        101247 by: Greg Macek
        101248 by: Jason Wong
        101249 by: Greg Macek
        101252 by: Nick Wilson
        101253 by: Nick Wilson

Re: disabled cookies and sessions
        101251 by: Nick Wilson
        101268 by: Giancarlo Pinerolo

e-commerce example
        101255 by: savaidis
        101256 by: Chris Knipe
        101257 by: SP

ssl security question
        101258 by: Jan Grafström

Warning: Too many connections in xxx on line xx
        101259 by: Dan Morris
        101260 by: Nick Wilson

Re: Sablotron broken in 4.2.1 ?
        101262 by: William S.

invalid path
        101263 by: Webmaster

not so
        101264 by: Rob Packer
        101267 by: Jason Wong
        101270 by: Rob Packer

Storing mysql result into a pointer (or something)
        101265 by: Bård Tommy Nilsen
        101266 by: Bård Tommy Nilsen
        101269 by: Jason Wong

Suggestions for getting started with poll app.
        101271 by: webmaster.tececo.com

Javascript & PHP cookies
        101272 by: webmaster.tececo.com

NOTICE MOZILLA BEHAVIOUR 2 PHPMYSQLADMIN?
        101273 by: Septic Flesh

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 ---
You are correct. My web server is Running 4.2.1 and all of the sites are
still working.. That is why I assumed that it was a problem locally, but
after looking at the web server the globals is turned on. Thanks.. I can go
forward now. I appreciate your help


On 6/7/02 9:33 PM, "Philip Olson" <[EMAIL PROTECTED]> wrote:

> Actually, they are.  You are assuming the PHP directive
> register_globals = on when using $phrase from the form
> below.  register_globals = on is what creates $phrase.
> 
> As of PHP 4.2.0 the default value for register_globals
> has become off.  Regardless, there are other options:
> 
> Try either:
> 
> // Worked since PHP 3 (forever)
> print $HTTP_GET_VARS['phrase'];
> 
> // Worked since PHP 4.1.0
> print $_GET['phrase'];
> print $_REQUEST['phrase'];
> 
> // Worked since PHP 4.1.0 too
> // See docs for details (see also extract())
> import_request_variables('gpc', 'r_');
> print $r_phrase;
> 
> Those are some options.  See also:
> 
> http://www.php.net/manual/en/language.variables.predefined.php
> 
> Regards,
> Philip Olson
> 
> 
> On Fri, 7 Jun 2002, Beeman wrote:
> 
>> I just read the release notes and do not believe they are referring to my
>> dilemma.
>> 
>> Here is the code I am using. Just a basic form
>> 
>> <<Form.php>>
>> <body>
>> <form action="form_act.php" method="get" enctype="multipart/form-data">
>>   <p>Phrase: 
>>     <input name="phrase" type="text" id="phrase" >
>>   </p>
>>   <input name="Submit" type="submit" value="Submit">
>> </form>
>> 
>> </body>
>> 
>> <<Form_act.php>>
>> <? 
>> if ($phrase){ echo "Phrase-- $phrase";}
>> Else{ echo "No Variables";}
>> ?>
>> 
>> 
>> On 6/7/02 9:08 PM, "Stuart Dallas" <[EMAIL PROTECTED]> wrote:
>> 
>>> On Saturday, June 8, 2002 at 1:56:35 AM, you wrote:
>>> 
>>>> I recently installed PHP 4.2.1 on my G4 Powerbook (OS X v10.1.4) running
>>>> Apache 1.3.2. I have verified that php is running and apache is running.
>>>> When I access a page locally http://127.0.0.1/simple_form.php, fill in the
>>>> only text box and submit the form to form_act.php. The variable doesn't
>>>> exist (as far as PHP is concerned. I have tested for its existance using an
>>>> IF ELSE). This happens with POST as well as GET, but when using GET I can
>>>> obviously see the variable name and value in the URL. Do I need to change
>>>> the default config for apache?? Or PHP? Can anyone please help before I go
>>>> completely crazy.
>>> 
>>> Are you using $_GET['varname']/$_POST['varname'] or just $varname? If you
>>> are
>>> trying to use the latter, I suggest you read the release note for the
>>> software
>>> you just installed: http://www.php.net/release_4_2_1.php (specifically the
>>> 'External Variables' section).
>> 
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>> 
> 

--- End Message ---
--- Begin Message ---
I am using Netscape 7 preview release.  When I go to www.php.net, it 
displays the php logo in the address bar.  Does anyone know how this is 
done?

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

I believe it is a favicon.ico

MSIE started this and apparently Netscape/Mozilla now have them
too.
TjL



--- End Message ---
--- Begin Message ---
On Saturday, June 8, 2002 at 3:04:30 AM, you wrote:

> I am using Netscape 7 preview release.  When I go to www.php.net, it 
> displays the php logo in the address bar.  Does anyone know how this is 
> done?

If I'm not mistaken, it's a favicon.ico file. See http://www.favicon.com/ for
full info.

-- 
Stuart

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

Oh, I forgot to mention that it is a different way of indicating
that a favicon to be used, which is found in the HEAD of the HTML
document.

 <link rel="shortcut icon" href="/favicon.ico" />

This works in browsers other than IE, but I don't think that IE
supports this

TjL



--- End Message ---
--- Begin Message ---
Timothy J. Luoma wrote:
> Oh, I forgot to mention that it is a different way of indicating
> that a favicon to be used, which is found in the HEAD of the HTML
> document.
> 
>  <link rel="shortcut icon" href="/favicon.ico" />
> 
> This works in browsers other than IE, but I don't think that IE
> supports this

See <http://www.favicon.com/> for some good information on favicons.


-- 
Mark Gallagher
http://cyberfuddle.com/infinitebabble/


--- End Message ---
--- Begin Message ---
I want to be able to search a flat file line by line looking for data 
such as a username then display all the information in that line. Is 
there some way to search the following format:

record1:username:info:info:info
record2:username:info:info:info
record3:username:info:info:info


So if someone submits the username in record two for the search I want 
it to stop at record two and then display that information...

any suggestions?

--- End Message ---
--- Begin Message ---
Use the explode() function based on the colon.  Then parse the 2nd array
element for the username that you want.  If matched, display all elements in
that array row.  Conversely you could use the implode() to reassemble the
array row.

(Assume $file_row is the row name that you have assigned)

/* your code to loop through the file goes here */
$your_array = explode(":",$file_row);
/* remember that arrays start with element 0 */
if ($your_array[1]) == "some name" {
    /* routine to display entire row */
}
/* continue processing loop */

--
Gaylen
PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/

"Tom Ray" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I want to be able to search a flat file line by line looking for data
> such as a username then display all the information in that line. Is
> there some way to search the following format:
>
> record1:username:info:info:info
> record2:username:info:info:info
> record3:username:info:info:info
>
>
> So if someone submits the username in record two for the search I want
> it to stop at record two and then display that information...
>
> any suggestions?
>


--- End Message ---
--- Begin Message ---
ok I believe I follow you on that, I will give that a try. But the 
question I have now is how do I loop that request?

Gaylen Fraley wrote:

>Use the explode() function based on the colon.  Then parse the 2nd array
>element for the username that you want.  If matched, display all elements in
>that array row.  Conversely you could use the implode() to reassemble the
>array row.
>
>(Assume $file_row is the row name that you have assigned)
>
>/* your code to loop through the file goes here */
>$your_array = explode(":",$file_row);
>/* remember that arrays start with element 0 */
>if ($your_array[1]) == "some name" {
>    /* routine to display entire row */
>}
>/* continue processing loop */
>
>--
>Gaylen
>PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/
>
>"Tom Ray" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>  
>
>>I want to be able to search a flat file line by line looking for data
>>such as a username then display all the information in that line. Is
>>there some way to search the following format:
>>
>>record1:username:info:info:info
>>record2:username:info:info:info
>>record3:username:info:info:info
>>
>>
>>So if someone submits the username in record two for the search I want
>>it to stop at record two and then display that information...
>>
>>any suggestions?
>>
>>    
>>
>
>
>
>  
>


--- End Message ---
--- Begin Message ---
If the file is of a reasonable size (not hundreds of kilobytes), then you 
can just slurp it all into an array and foreach through it:

  $matched = 0;
  $myfile = file('/usr/home/crud/myfile');
  foreach ($myfile as $line)
  {
    $split_line = explode(':', $line);
    if ($split_line[1] == 'bob')
    {
      echo '<p>Got a match!</p>';
      $matched = 1;
      break;
    }
  }
  if (!$matched)
    echo '<p>Username not found.</p>';

If it's larger, you're doing it an awful lot, or your server is 
resource-cramped, you'd probably want to fopen() it and loop over fgets() 
so you don't have to read in any more than necessary.

miguel

On Fri, 7 Jun 2002, Tom Ray wrote:
> ok I believe I follow you on that, I will give that a try. But the 
> question I have now is how do I loop that request?
> 
> Gaylen Fraley wrote:
> 
> >Use the explode() function based on the colon.  Then parse the 2nd array
> >element for the username that you want.  If matched, display all elements in
> >that array row.  Conversely you could use the implode() to reassemble the
> >array row.
> >
> >(Assume $file_row is the row name that you have assigned)
> >
> >/* your code to loop through the file goes here */
> >$your_array = explode(":",$file_row);
> >/* remember that arrays start with element 0 */
> >if ($your_array[1]) == "some name" {
> >    /* routine to display entire row */
> >}
> >/* continue processing loop */
> >
> >--
> >Gaylen
> >PHP KISGB v4.0.5 Guest Book http://www.gaylenandmargie.com/phpwebsite/
> >
> >"Tom Ray" <[EMAIL PROTECTED]> wrote in message
> >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >  
> >
> >>I want to be able to search a flat file line by line looking for data
> >>such as a username then display all the information in that line. Is
> >>there some way to search the following format:
> >>
> >>record1:username:info:info:info
> >>record2:username:info:info:info
> >>record3:username:info:info:info
> >>
> >>
> >>So if someone submits the username in record two for the search I want
> >>it to stop at record two and then display that information...
> >>
> >>any suggestions?
> >>
> >>    
> >>
> >
> >
> >
> >  
> >
> 
> 
> 
> 

--- End Message ---
--- Begin Message ---
i have databse paradox (extension *.db) how to read in php and save to
mysql , thanks i just new bie in php
--- End Message ---
--- Begin Message ---
I think you'll get MUCH better answers if you join the MySQL mailing list,
and search the MySQL website, rather than this PHP list.

Also less chance of getting flamed :)

Justin French


on 08/06/02 1:20 PM, sonjaya ([EMAIL PROTECTED]) wrote:

> i have databse paradox (extension *.db) how to read in php and save to
> mysql , thanks i just new bie in php
> 

--- End Message ---
--- Begin Message ---
On 6/7/02 11:43 AM, "Bogdan Stancescu" <[EMAIL PROTECTED]> wrote:

> One of the users of OPT has major problems uploading files to the system and I
> have absolutely no clue why that is. His PHP version is 4.0.6 on Linux.
> Quoting his description of the problem:
> 
> "In fact, now it doesn't even report an error. It just takes some time
> (about 30 seconds) trying to upload, I guess. The progress bar in the
> bottom of MSIE 6.0 shows it doing something, but then it 'finishes',
> while still showing the page with the 'Add a new document' form."
> 
> I know, your first thought is that OPT has a problem - but here's
> another report from the same user when I directed him to alter some
> stuff in a MySQL database:
> 
> "By pasting it into the 'query' window in phpMyAdmin, but I was
> surprised by the result. Instead of an error or successful result from
> phpMyAdmin, I got a browser error from MSIE: 'This page cannot be
> displayed'"
> 
> I have absolutely no idea why this happens - when he sent the first
> report, I started thinking it may have been some php.ini setting
> regarding uploads, but I was completely confused by the second report.
> 
> Did anyone encounter this? Is it a PHP bug? Is it a setting?

Well, you could post the code you're trying....but as I found out recently
while learning this, if a file is bigger than max file size, $_FILES['name']
will have 'none' and $_FILES['size'] will be 0.  (I thinks that's
$HTTP_POST_FILES under 4.0.6).  Check that....Otherwise, we need more info
about what 'is not working'. (Not sure what query you're checking in
phpMyAdmin...)
-- 
Ed Marczak
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
On Saturday 08 June 2002 10:48, Robert Packer wrote:
> Can someone tell me why this isn't working? To me it say open the file,
> read it, stick into a variable, close the file. Then search that variable
> (the file) and look for the eregi statements. Can someone tell me why this
> only gets the first instance of what I'm searching for? Thanks a bunch.
>
> #!/usr/bin/php -q
> <?
>  $site = "proxy.html";
>  $open = fopen($site, "r");
>  $contents= fread($open,filesize($site));
>  fclose($open);
>   $search=eregi("[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}",
> $contents,$array);
>   echo $array[0];
>   echo $array[1];
>   echo $array[2];
> ?>

It looks like you're trying to match IP addresses? In which case shouldn't you 
have "echo $array[3];" as well? 

Anyway that's besides the point, what is the format of your file?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
I've got a bad feeling about this.
*/

--- End Message ---
--- Begin Message ---
On Saturday 08 June 2002 09:19, Justin French wrote:
> Hi,
>
> I wish to restrict access to a dir of files, depending on if the user is a
> logged in and validated member.

What kind of files are they? html? php? or others?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If it wasn't so warm out today, it would be cooler.
*/

--- End Message ---
--- Begin Message ---
MP3 and quick time -- otherwise the solution would be easy :)

Thanks,

Justin


on 08/06/02 3:42 PM, Jason Wong ([EMAIL PROTECTED]) wrote:

> On Saturday 08 June 2002 09:19, Justin French wrote:
>> Hi,
>> 
>> I wish to restrict access to a dir of files, depending on if the user is a
>> logged in and validated member.
> 
> What kind of files are they? html? php? or others?

--- End Message ---
--- Begin Message ---
On Saturday 08 June 2002 13:46, Justin French wrote:
> MP3 and quick time -- otherwise the solution would be easy :)
>
> Thanks,
>
> Justin
>
> on 08/06/02 3:42 PM, Jason Wong ([EMAIL PROTECTED]) wrote:
> > On Saturday 08 June 2002 09:19, Justin French wrote:
> >> Hi,
> >>
> >> I wish to restrict access to a dir of files, depending on if the user is
> >> a logged in and validated member.
> >
> > What kind of files are they? html? php? or others?

The quick answer is, store the files outside of the website's DOCUMENTROOT, 
then serve the files through a script (which naturally checks whether the 
user is logged in).

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Sic transit gloria Monday!
*/

--- End Message ---
--- Begin Message ---
When you say serve the files through a script, I assume you mean
"download.php" force-feeds an MP3 (or whatever) to the browser.

Is this correct?

I read people have lots of problems with this...


Justin



on 08/06/02 4:08 PM, Jason Wong ([EMAIL PROTECTED]) wrote:

> On Saturday 08 June 2002 13:46, Justin French wrote:
>> MP3 and quick time -- otherwise the solution would be easy :)
>> 
>> Thanks,
>> 
>> Justin
>> 
>> on 08/06/02 3:42 PM, Jason Wong ([EMAIL PROTECTED]) wrote:
>>> On Saturday 08 June 2002 09:19, Justin French wrote:
>>>> Hi,
>>>> 
>>>> I wish to restrict access to a dir of files, depending on if the user is
>>>> a logged in and validated member.
>>> 
>>> What kind of files are they? html? php? or others?
> 
> The quick answer is, store the files outside of the website's DOCUMENTROOT,
> then serve the files through a script (which naturally checks whether the
> user is logged in).

--- End Message ---
--- Begin Message ---
On Sat, 8 Jun 2002, Justin French wrote:
> When you say serve the files through a script, I assume you mean
> "download.php" force-feeds an MP3 (or whatever) to the browser.
> 
> Is this correct?
> 
> I read people have lots of problems with this...

Only until they get it working (I should hope). We use it for many, many 
sites and I can't think of any problems it's caused.

miguel

--- End Message ---
--- Begin Message ---
What is the best/recommended method of saving form data into session 
variables? Currently only have to deal with regular text input, 
checkboxes and radio buttons (no multiple selects for now). Any sample 
code someone could throw up on the list? I've only recently begun 
working with sessions, but I'm interested to see what I can do with 
them. Any sort of direction on this would be appreciated. Thanks!

- Greg

--- End Message ---
--- Begin Message ---
On Saturday 08 June 2002 14:39, Greg Macek wrote:
> What is the best/recommended method of saving form data into session
> variables? Currently only have to deal with regular text input,
> checkboxes and radio buttons (no multiple selects for now). Any sample
> code someone could throw up on the list? I've only recently begun
> working with sessions, but I'm interested to see what I can do with
> them. Any sort of direction on this would be appreciated. Thanks!

What I do is try to put all the form elements into a single array. That way 
you'll only have a single variable to worry about.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Future looks spotty.  You will spill soup in late evening.
*/

--- End Message ---
--- Begin Message ---
Ok, I'll have to try that on my next project. Unfortunately these forms were 
written by another developer and there too many variables to rename to make an 
array and not enough time on the project :-)  But for next time.

I've seen many examples of assigning values to session variables w/o forms on 
the list and online. Now should I look to set those values on the next page in 
the sequence of forms that the user is entering?

page1.php
<?php
session_start();
*** session_register("test_var");*** // Is this ok?
?>
<form action="page2.php">
<input type="text" name="test_var"></input>
<input type="submit">
</form>

page2.php
<?php
session_start();
*** $_SESSION["test_var"] = $test_var;  *** // Or is this ok?
// or $HTTP_SESSION_VARS["test_var"] = $test_var on <=4.0.6
?>
... (rest of page here)

Which of the two lines is more failsafe in terms of working every time?

Jason Wong wrote:
> On Saturday 08 June 2002 14:39, Greg Macek wrote:
> 
>>What is the best/recommended method of saving form data into session
>>variables? Currently only have to deal with regular text input,
>>checkboxes and radio buttons (no multiple selects for now). Any sample
>>code someone could throw up on the list? I've only recently begun
>>working with sessions, but I'm interested to see what I can do with
>>them. Any sort of direction on this would be appreciated. Thanks!
> 
> 
> What I do is try to put all the form elements into a single array. That way 
> you'll only have a single variable to worry about.
> 


--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Greg Macek declared....
> Ok, I'll have to try that on my next project. Unfortunately these forms 
> were written by another developer and there too many variables to rename 

How about something like this:

foreach($HTTP_POST_VARS as $key => $val) {
    $myFormData['$key']=$val;
}

Then you just register the $myFormData and it will be available to you
whenever you need it.

- -- 
Nick Wilson     //  www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9AbEvHpvrrTa6L5oRAirPAJ9HylqSk9NBsNsTjjRZZ2fBHN3K3QCdGzdS
t6yXIWhWu76VxfGkpQp6JdI=
=uZMW
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Nick Wilson declared....
> How about something like this:
> 
> foreach($HTTP_POST_VARS as $key => $val) {
>     $myFormData['$key']=$val;
> }

Actually that may be a little redundent. You may well get away with:

$myFormData=$HTTP_POST_VARS;
- -- 
Nick Wilson     //  www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9AbHmHpvrrTa6L5oRAnYDAJ97cMzKPwdp42y+G7KiixEAavdFYACdEOlP
bBSkoamAv10hHnDAmrVfiBk=
=NHHQ
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Chris Sechiatano declared....
> You have to code the PHPSESSID into your URL if your browser has cookies
> disabled or else it won't work.

No. As I said, i have php compiled with --enable-trans-sid

- -- 
Nick Wilson     //  www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9AbANHpvrrTa6L5oRAr7xAKCygTDnlygZpepWQf1iwojVzld2LgCcCllO
QGC9nkE6Gb7NLL6V9IzzcTg=
=U8TD
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Nick Wilson wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> * and then Chris Sechiatano declared....
> > You have to code the PHPSESSID into your URL if your browser has cookies
> > disabled or else it won't work.
> 
> No. As I said, i have php compiled with --enable-trans-sid
> 

Php session work differently from PHPLIB.
PHPLIB will generate a session, if no cookie and no SID in URL is found,
then append it to the URL and redirect you there. In this situation,
phplib used to accept and adopt any SID in the url, if there was one.
Now no more: phplib will accept a session in the url only if it exists.

PHP session don't quite work the same. if no cookie nor SID in url, you
have to provide it in the URL, and it will be the session. In fact, if
you provide it in the url, it will adopt it and create it even if you
have cookies enabled! Great feature for spies.

Gian

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


I'm looking for  e-commerce example (PHP+MySQL) so I don't start from zero
and save some time.

Does  somebody knows something about?

Thanks

Makis Savaidis

--- End Message ---
--- Begin Message ---
www.google.com / www.freshmeat.net


Kind Regards,

Chris Knipe
MegaLAN Corporate Networking Services
Tel: +27 21 854 7064
Cell: +27 72 434 7582

----- Original Message -----
From: "savaidis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 08, 2002 5:59 AM
Subject: [PHP] e-commerce example


>
>
> I'm looking for  e-commerce example (PHP+MySQL) so I don't start from zero
> and save some time.
>
> Does  somebody knows something about?
>
> Thanks
>
> Makis Savaidis
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
try this link
http://www.devshed.com/Server_Side/PHP/Commerce

-----Original Message-----
From: savaidis [mailto:[EMAIL PROTECTED]]
Sent: June 7, 2002 11:59 PM
To: [EMAIL PROTECTED]
Subject: [PHP] e-commerce example




I'm looking for  e-commerce example (PHP+MySQL) so
I don't start from zero
and save some time.

Does  somebody knows something about?

Thanks

Makis Savaidis


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


--- End Message ---
--- Begin Message ---
I have made a file wich start a session and set a session variable if user
and pass are verifyed.
Than I use the session variable to protect all other userfiles.


To run the file I enter:
http://myserver.com/start.php3?user=xxxxx&pass=yyyyyy

What is the differans using SSL and enter the same url?
If a hacker sniff the ssl-string can he send that string and start the file
anyway?

--
Regards,
Jan Grafström
Sweden

--- End Message ---
--- Begin Message ---
Is there anyway to get rid of this message:

Warning: Too many connections in xxx on line xx

line xx is a connection to a mysql database.

In PHP.ini I have:

[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links.  -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent).  -1 means no limit.
mysql.max_links = -1

Can anyone suggest what I can do to get rid of this error? I am running on a
Dell PowerEdge 350 with the max of 1GB of memory running RH7.2, php 4.1.1,
and mysql 3.23.49a.

Thanks.

Dan


--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


* and then Dan Morris declared....
> Is there anyway to get rid of this message:
> 
> Warning: Too many connections in xxx on line xx

Can you show the code that connects?

- -- 
Nick Wilson     //  www.explodingnet.com



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)

iD8DBQE9AdECHpvrrTa6L5oRAmUkAJ0S/N7E8ifYqP4bm6mb38wWoZqJ+gCfRPVp
dxNJezvEs5aav5Yw814axIE=
=QH6x
-----END PGP SIGNATURE-----
--- End Message ---
--- Begin Message ---
Thank you for the feedback. Sablotron is running
fine now. Just had to do some modifications
with my *.xsl file.

Here is what I have going now with the
implementation:

http://213.84.71.105/

On Tue, Jun 04, 2002 at 10:57:45AM +1000, Tom Rogers wrote:
> hi
> I am using 4.2.1 and it works fine, I can't see your source code as web 
> servers don't show it by design :)
> But from the error message it can't find your class file. I used the code 
> below to test it.
> Tom
> 
> 
> $xsltproc = xslt_create();
> 
> $html = xslt_process($xsltproc, 'news.xml', 'news.xsl');
> 
> if (!$html) die('XSLT processing error: '.xslt_error($xsltproc));
> 
> xslt_free($xsltproc);
> 
> echo $html;
> 
<snip>
-- 
Bill
Amsterdam, NL
--- End Message ---
--- Begin Message ---
My OS is XP Pro.

I installed my web folders in c:\web instead of c:\apache\htdocs

My php folder is: > c:/php

In the httpd.conf:
DocumentRoot "/web/myweb"
ScriptAlias /php/ "c:/php/"
   AddType application/x-httpd-php .php
   Action application/x-httpd-php "/php/php.exe"

In my Php.ini:
include_path = "c:/web/myweb/ezp/"

My ez Publish folder is > c:/web/myweb/ezp


Error text in browser is:

Warning: fopen("c:/web/myweb/php/php.exe/ezp/error.log","a") - No such file
or directory in classes/ezfile.php on line 282
Log file could not be opened.

Error:
"/php/php.exe" is inserted unexpectly..

What's wrong with my php?


--- End Message ---
--- Begin Message ---
[0] would match the whole ip, I was hoping [1] and[2] would echo the next 2
found, but it doesn't
Thanks


--- End Message ---
--- Begin Message ---
On Saturday 08 June 2002 22:36, Rob Packer wrote:
> [0] would match the whole ip, I was hoping [1] and[2] would echo the next 2
> found, but it doesn't

1) Could you not start a new thread each time? It makes it difficult for 
people to help because your responses and their repsonses are all over the 
place. 

And a subject which matches the discussion in hand would be appreciated. When 
people search through the archives and come across a thread named "not so", 
what on earth are they supposed to make of that?

2) I asked you to show the format of your input file. Without knowing what it 
looks like there's not much anyone can do to help you.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Memory fault -- core...uh...um...core... Oh dammit, I forget!
*/

--- End Message ---
--- Begin Message ---
oops, no coffee yet

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Saturday 08 June 2002 22:36, Rob Packer wrote:
> > [0] would match the whole ip, I was hoping [1] and[2] would echo the
next 2
> > found, but it doesn't
>
> 1) Could you not start a new thread each time? It makes it difficult for
> people to help because your responses and their repsonses are all over the
> place.
>
> And a subject which matches the discussion in hand would be appreciated.
When
> people search through the archives and come across a thread named "not
so",
> what on earth are they supposed to make of that?
>
> 2) I asked you to show the format of your input file. Without knowing what
it
> looks like there's not much anyone can do to help you.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Memory fault -- core...uh...um...core... Oh dammit, I forget!
> */
>


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


I am trying to store several results from an mysql_query into an "int"
I want to produce several lines into $result, so i can include $result
Into my email, or is there a better way to do this ?




$query = mysql_query("select * from $table");
$number = mysql_numrows($query) ;
$i = 0;
while ($i < $number) {
 $id = mysql_result($query,$i,"id");
 $Name = mysql_result($query,$i,"Name");


## WHAT MUST I DO HERE ??? ##


$i++;
}


Echo "$result";

I will use the result to send an email


$FromName = "$Name";
$FromAddress = "$Email";
$ToAdress = "$ToAdress";
$message = '<b><br>

$result

';
 
mail($ToAdress." <".$ToAdress.">", $Subject, $message, "From: ".$FromName."
<".$FromAddress.">\nContent-Type: text/html; charset=iso-8859-1");
--- End Message ---
--- Begin Message ---


I am trying to store several results from an mysql_query into an "int" I
want to produce several lines into $result, so i can include $result Into my
email, or is there a better way to do this ?




$query = mysql_query("select * from $table");
$number = mysql_numrows($query) ;
$i = 0;
while ($i < $number) {
 $id = mysql_result($query,$i,"id");
 $Name = mysql_result($query,$i,"Name");


## WHAT MUST I DO HERE ??? ##


$i++;
}


Echo "$result";

I will use the result to send an email


$FromName = "$Name";
$FromAddress = "$Email";
$ToAdress = "$ToAdress";
$message = '<b><br>

$result

';
 
mail($ToAdress." <".$ToAdress.">", $Subject, $message, "From: ".$FromName."
<".$FromAddress.">\nContent-Type: text/html; charset=iso-8859-1");
--- End Message ---
--- Begin Message ---
On Saturday 08 June 2002 19:42, Bård Tommy Nilsen wrote:
> I am trying to store several results from an mysql_query into an "int" I
> want to produce several lines into $result, so i can include $result Into
> my email, or is there a better way to do this ?

> $query = mysql_query("select * from $table");
> $number = mysql_numrows($query) ;
> $i = 0;
> while ($i < $number) {
>  $id = mysql_result($query,$i,"id");
>  $Name = mysql_result($query,$i,"Name");
>
>
> ## WHAT MUST I DO HERE ??? ##
>
>
> $i++;
> }

The above can be rewritten as:

  $query = mysql_query("select * from $table");
  while ($row = mysql_fetch_array($query)) {
    $id   = $row('id');
    $Name = $row('Name');
    $result .= "$id $Name<br>";
  }

Salt and pepper to taste.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
If you see an onion ring -- answer it!
*/

--- End Message ---
--- Begin Message ---
I want to build my own poll(The ones availble from sites such as hotscripts.com are not quite what I need)
 
Could any one tell me of a *good* tutorial?
 
Particularly the number of questions would be different between each poll not a fixed number.
 
--- End Message ---
--- Begin Message ---
Is it possible to read cookies from javascript written by PHP and vice-versa?
 
Just out of curiousity
 
--- End Message ---
--- Begin Message ---
Did u notice and problems when you are accessing the mysql server using
mozilla ??

I am in a 1.53Mhz amd and the CPU usage goes to the max when use
phpmyadmin...... ??????

while in IE everything is fine..

Did I missed any previews post ?


--
~~~~~~~~~~~~~~~~

Sapilas@/dev/pinkeye

~~~~~~~~~~~~~~~~


--- End Message ---

Reply via email to