php-general Digest 13 Sep 2002 05:32:35 -0000 Issue 1582

Topics (messages 116175 through 116232):

Re: local and global variables
        116175 by: Neophyte

Re: whois query
        116176 by: yasin inat
        116202 by: Tom Ray
        116203 by: Adam Williams
        116205 by: Tom Ray
        116206 by: Adam Williams
        116232 by: Tom Ray

Re: unless something...
        116177 by: Neophyte
        116187 by: Johnson, Kirk
        116188 by: David Buerer
        116189 by: Johnson, Kirk
        116220 by: David Freeman
        116221 by: Zak Greant

Building PHP for windows
        116178 by: Richard Black

OT - SQL string to get value by latest date only in a join
        116179 by: Merritt, Dave
        116180 by: Jay Blanchard

Help with pattern matching.
        116181 by: Will

Re: Windows Authoring Tools
        116182 by: Dave at Sinewaves.net
        116184 by: Geoff Hankerson

Need help with PDFlib under Linux
        116183 by: Cameron Thorne

mysql_query() & mail() - something weird is going on !
        116185 by: Chris Knipe

can you recommned a simple banner rotator in PHP
        116186 by: Peter J. Schoenster
        116190 by: Seán Dillon
        116223 by: olinux

Problem updating post on a basic weblog system
        116191 by: Jesse Lawrence
        116198 by: Chris Wesley

Processing PHP in Template File
        116192 by: [-^-!-%-
        116193 by: Chris Boget
        116195 by: Support . Fourthrealm.com
        116199 by: [-^-!-%-

HELP - fwrite(...PHP code...)
        116194 by: Hankley, Chip
        116196 by: Chris Wesley

Re: Displaying PDF file
        116197 by: Matt Schroebel

MS SQL Problem
        116200 by: Christopher J. Crane

phpscript as command line with setuid, weird result
        116201 by: Patric de Waha

pdflib encoding error
        116204 by: Michael Plies

PERMISSIONS
        116207 by: Breno Cardoso Perucchi
        116209 by: Adam Williams
        116210 by: Breno Cardoso Perucchi
        116213 by: Chris Wesley
        116229 by: Jesse Cablek

PHP4.2.2 Windows
        116208 by: Tim Thorburn
        116215 by: Barajas, Arturo
        116216 by: Barajas, Arturo

rewriting a line in a text file
        116211 by: drparker
        116222 by: Kumar Lakshminarayanan

array_search() problem
        116212 by: David Orn Johannsson
        116214 by: Bas Jobsen
        116218 by: Bas Jobsen

SSL inside of PHP
        116217 by: Lon Lentz
        116219 by: Chris Shiflett

PHP EXEC();
        116224 by: Doug Kozar
        116231 by: Jesse Cablek

Re: Better Images
        116225 by: Justin French

Re: Mail system with folders? (Clarification)
        116226 by: Leif K-Brooks

Re:PHP
        116227 by: llclmc

error: loading extensions / php_xslt.dll on win32
        116228 by: Marco Siegl

Re: PHP
        116230 by: Jesse Cablek

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

$var = 'value';

function myFunction($var2)
{
    GLOBAL $var;
    $var = $var2;
}

"Skitum" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi all,

Maybe a stupid question, but i have to make it:
How can a local variable pass its value to a global one?
Is it possible?

Thanks in advance.

Peace & Love
skitum



--- End Message ---
--- Begin Message ---
Thanx   friends ....



--- End Message ---
--- Begin Message ---
Yes, but how do you format the information that comes back out of the 
whois? I'm doing this:

<?

$whois = system("whois [EMAIL PROTECTED]");

print "<pre>$whois</pre>";

?>

But all the information is shown as one big line, no breaks or anything. 
How would I do this so it showed properly formatted output?

Adam Williams wrote:

>Have a php page that runs exec() or system() and does a whois query on the
>domain you want and then have it output the text to a page.  Very simple
>to do, less then 2 minutes of coding.
>
>                       Adam
>
>On Thu, 12 Sep 2002, yasin inat wrote:
>
>  
>
>>please  anyone  can  help  me   about  querying  a  domain  ....
>>like   whois  queries ?
>>
>>if  someone  has   got   a   script  ,  it's   acceptable ....
>>
>>
>>
>>
>>
>>
>>    
>>
>
>
>  
>

--- End Message ---
--- Begin Message ---
try with <p> </p> and see if that works.

                Adam

On Thu, 12 Sep 2002, Tom Ray wrote:

> Yes, but how do you format the information that comes back out of the
> whois? I'm doing this:
>
> <?
>
> $whois = system("whois [EMAIL PROTECTED]");
>
> print "<pre>$whois</pre>";
>
> ?>
>
> But all the information is shown as one big line, no breaks or anything.
> How would I do this so it showed properly formatted output?
>
> Adam Williams wrote:
>
> >Have a php page that runs exec() or system() and does a whois query on the
> >domain you want and then have it output the text to a page.  Very simple
> >to do, less then 2 minutes of coding.
> >
> >                     Adam
> >
> >On Thu, 12 Sep 2002, yasin inat wrote:
> >
> >
> >
> >>please  anyone  can  help  me   about  querying  a  domain  ....
> >>like   whois  queries ?
> >>
> >>if  someone  has   got   a   script  ,  it's   acceptable ....
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
> >
>
>

--- End Message ---
--- Begin Message ---
Nope still comes up with everything in one big line. I'm running through 
different options right now..but I'm tired and my brain is starting to 
hurt :)

Adam Williams wrote:

>try with <p> </p> and see if that works.
>
>               Adam
>
>On Thu, 12 Sep 2002, Tom Ray wrote:
>
>  
>
>>Yes, but how do you format the information that comes back out of the
>>whois? I'm doing this:
>>
>><?
>>
>>$whois = system("whois [EMAIL PROTECTED]");
>>
>>print "<pre>$whois</pre>";
>>
>>?>
>>
>>But all the information is shown as one big line, no breaks or anything.
>>How would I do this so it showed properly formatted output?
>>
>>Adam Williams wrote:
>>
>>    
>>
>>>Have a php page that runs exec() or system() and does a whois query on the
>>>domain you want and then have it output the text to a page.  Very simple
>>>to do, less then 2 minutes of coding.
>>>
>>>                     Adam
>>>
>>>On Thu, 12 Sep 2002, yasin inat wrote:
>>>
>>>
>>>
>>>      
>>>
>>>>please  anyone  can  help  me   about  querying  a  domain  ....
>>>>like   whois  queries ?
>>>>
>>>>if  someone  has   got   a   script  ,  it's   acceptable ....
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>
>>>
>>>      
>>>
>>    
>>
>
>
>  
>

--- End Message ---
--- Begin Message ---
try using nl2br() on it before you print it.

                        Adam

On Thu, 12 Sep 2002, Tom Ray wrote:

> Nope still comes up with everything in one big line. I'm running through
> different options right now..but I'm tired and my brain is starting to
> hurt :)
>
> Adam Williams wrote:
>
> >try with <p> </p> and see if that works.
> >
> >             Adam
> >
> >On Thu, 12 Sep 2002, Tom Ray wrote:
> >
> >
> >
> >>Yes, but how do you format the information that comes back out of the
> >>whois? I'm doing this:
> >>
> >><?
> >>
> >>$whois = system("whois [EMAIL PROTECTED]");
> >>
> >>print "<pre>$whois</pre>";
> >>
> >>?>
> >>
> >>But all the information is shown as one big line, no breaks or anything.
> >>How would I do this so it showed properly formatted output?
> >>
> >>Adam Williams wrote:
> >>
> >>
> >>
> >>>Have a php page that runs exec() or system() and does a whois query on the
> >>>domain you want and then have it output the text to a page.  Very simple
> >>>to do, less then 2 minutes of coding.
> >>>
> >>>                   Adam
> >>>
> >>>On Thu, 12 Sep 2002, yasin inat wrote:
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>>please  anyone  can  help  me   about  querying  a  domain  ....
> >>>>like   whois  queries ?
> >>>>
> >>>>if  someone  has   got   a   script  ,  it's   acceptable ....
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
>
>

--- End Message ---
--- Begin Message ---
A working solution to the whois question
<?
$whois = `whois [EMAIL PROTECTED]`;

print "<pre>$whois</pre>";
?>

Notice those are back ticks, not single quotes. This will give youthe 
information you need, and the <pre> tag puts it out in the proper format 
for you.

yasin inat wrote:

>Thanx   friends ....
>
>
>
>
>  
>


--- End Message ---
--- Begin Message ---
if ($A != $C || $B != $C) {

I think, but im fairly new


"Magnus Solvang" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm used to the unless-statement in perl... How do I do this:
>
>   if string A or B are NOT in string C, then do something and quit.
>
> In perl, I would do this:
>
> unless ($c =~ /$a|$b/) {
>   blabla
>   exit 0
> }
>
> - M


--- End Message ---
--- Begin Message ---
There is no 'unless' in PHP, so you just have to grind it out. If you are
searching for known strings, rather than string *patterns*, use the strstr()
function here: http://www.php.net/manual/en/function.strstr.php.

So, something like:

if(!strstr($c,$a) && !strstr($c,$b)) {
  bla;
  exit;
}

Completely untested ;) If you are looking for patterns, see preg_match(),
linked to from the link above.

Kirk

> "Magnus Solvang" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I'm used to the unless-statement in perl... How do I do this:
> >
> >   if string A or B are NOT in string C, then do something and quit.
> >
> > In perl, I would do this:
> >
> > unless ($c =~ /$a|$b/) {
> >   blabla
> >   exit 0
> > }
--- End Message ---
--- Begin Message ---
True, but isn't unless just a negated while?


q.e.d.

while ($c==$a OR $c==$b) 
{
  blabla
  exit 0
}


-----Original Message-----
From: Johnson, Kirk [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 10:28 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] Re: unless something...


There is no 'unless' in PHP, so you just have to grind it out. If you are
searching for known strings, rather than string *patterns*, use the strstr()
function here: http://www.php.net/manual/en/function.strstr.php.

So, something like:

if(!strstr($c,$a) && !strstr($c,$b)) {
  bla;
  exit;
}

Completely untested ;) If you are looking for patterns, see preg_match(),
linked to from the link above.

Kirk

> "Magnus Solvang" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I'm used to the unless-statement in perl... How do I do this:
> >
> >   if string A or B are NOT in string C, then do something and quit.
> >
> > In perl, I would do this:
> >
> > unless ($c =~ /$a|$b/) {
> >   blabla
> >   exit 0
> > }

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

--- End Message ---
--- Begin Message ---
Indeed, it is a negated something or other.

> -----Original Message-----
> From: David Buerer [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, September 12, 2002 11:23 AM
> To: '[EMAIL PROTECTED]'
> Subject: RE: [PHP] Re: unless something...
> 
> 
> True, but isn't unless just a negated while?
--- End Message ---
--- Begin Message ---
Doing stuff with || is always a good way to stuff up.  In the case of
your example it will always evaluate to true.

 > if ($A != $C || $B != $C) {
 > 
 > I think, but im fairly new

This would work if you did this:

If (!($A == $C || $B == $C)) {

 > > In perl, I would do this:
 > >
 > > unless ($c =~ /$a|$b/) {
 > >   blabla
 > >   exit 0
 > > }



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

On September 12, 2002 09:47, Magnus Solvang wrote:
> I'm used to the unless-statement in perl... How do I do this:
>
>   if string A or B are NOT in string C, then do something and quit.
>
> In perl, I would do this:
>
> unless ($c =~ /$a|$b/) {
>   blabla
>   exit 0
> }

  ... and in the more verbose PHP you could say

  if( ! preg_match("/$a|$b/", $c) ) {
    blah blah blah
    exit(0);
  }

  Cheers!
  --zak
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9gSNrb6QONwsK8bIRAnIiAKCPcmTiSO+7G4dwt9pQ0LyXnd/o7wCgiIiX
YRogR4f45nZLdGioazfwvAo=
=PxCf
-----END PGP SIGNATURE-----

--- End Message ---
--- Begin Message ---
Sorry if this question has been asked before...

Is it possible to build PHP on Windows using Borland's C++ Builder? All
the docs I've seen talk about MS Visual C++, so I wondered if that's the
only compiler that will build it. I've not seen any mention of other
compilers.

Cheers,

Richy

==========================================
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED] 

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

I apologize up front for being off topic, but I don't want to have to
subscribe to other lists unless necessary.  I know that someone on this list
should be able to help me out.

I have the SQL string below that I am running.  The problem I'm having is
that the history table being called in the join has multiple entries
referencing back to the single entry in the customer table.  What I want to
be able to do is return only the latest/newest entry by date in the history
table and not older entries.  I assume that I need to add some conditional
to the outer join.  The problem I have is that I don't know what the
conditional would be to allow returning the latest row by date.

Thanks in advance, and again I apologize for the OT question,

Dave Merritt
[EMAIL PROTECTED]

currently running this string:

SELECT customer.customer_id, customer.customer_name,
business_unit.business_unit, customer.created_date, CONCAT_WS(", ",
username.last_name, username.first_name), history.modify_date, CONCAT_WS(",
", modified.last_name, modified.first_name), history.description
FROM `customer` 
LEFT OUTER JOIN `business_unit` ON business_unit.bu_id = customer.bu_id 
LEFT OUTER JOIN `username` ON username.user_id = customer.creator_id 
LEFT OUTER JOIN `history` ON ( history.item_id = customer.customer_id  AND
history.module_id = 1003 )
LEFT OUTER JOIN `username` AS modified ON modified.user_id =
history.modifier_id 
WHERE customer.customer_id LIKE "%man%" 
OR customer.customer_name LIKE "%man%" 
OR customer.created_date LIKE "%man%" 
OR business_unit.business_unit LIKE "%man%" 
OR username.first_name LIKE "%man%" 
OR username.last_name LIKE "%man%" 
OR history.modify_date LIKE "%man%"
OR history.description LIKE "%man%"
OR modified.first_name LIKE "%man%" 
OR modified.last_name LIKE "%man%" 
ORDER BY customer.customer_name

which returns the following results:

'1040','Allmand Bros. Inc.','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','2002-11-12 10:53:23','Burnstingle,
Robert','Additional changes made','1003',
'1040','Allmand Bros. Inc.','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','2002-11-09 13:15:34','Merritt, Dave','A test of
history','1003',
'1050','Ameritool Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1053','Ammann-Yanmar','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1065','Art's Way Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL', .....


What I'm trying to achieve is the above results both with only one row
returned for the 1040 item like so, and the row returned should be the row
with the latest/newest modified date:

1040','Allmand Bros. Inc.','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','2002-11-12 10:53:23','Burnstingle,
Robert','Additional changes made','1003',
'1050','Ameritool Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1053','Ammann-Yanmar','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL',
'1065','Art's Way Manufacturing','Gas Springs, Industrial','2002-03-01
00:00:00','Admin, PDMWeb','NULL','','NULL','NULL', .....




**************************************************************************************************
Any views, opinions or authorizations contained in this email are solely those of the 
author and do not necessarily represent those of ArvinMeritor, Inc. If you are not 
familiar with the corporate authority of the author, please obtain confirmation in 
writing 
of the content of this email prior to taking any action on the basis of the 
information. If 
you are not the intended recipient, you are hereby notified that any disclosure, 
copying 
or distribution of the information enclosed is strictly prohibited. 
**************************************************************************************************

--- End Message ---
--- Begin Message ---
[snip]
SELECT customer.customer_id, customer.customer_name,
business_unit.business_unit, customer.created_date, CONCAT_WS(", ",
username.last_name, username.first_name), history.modify_date, CONCAT_WS(",
", modified.last_name, modified.first_name), history.description
FROM `customer`
LEFT OUTER JOIN `business_unit` ON business_unit.bu_id = customer.bu_id
LEFT OUTER JOIN `username` ON username.user_id = customer.creator_id
LEFT OUTER JOIN `history` ON ( history.item_id = customer.customer_id  AND
history.module_id = 1003 )
LEFT OUTER JOIN `username` AS modified ON modified.user_id =
history.modifier_id
WHERE customer.customer_id LIKE "%man%"
OR customer.customer_name LIKE "%man%"
OR customer.created_date LIKE "%man%"
OR business_unit.business_unit LIKE "%man%"
OR username.first_name LIKE "%man%"
OR username.last_name LIKE "%man%"
OR history.modify_date LIKE "%man%"
OR history.description LIKE "%man%"
OR modified.first_name LIKE "%man%"
OR modified.last_name LIKE "%man%"
ORDER BY customer.customer_name
[/snip]

Try this;

SELECT customer.customer_id, customer.customer_name,
business_unit.business_unit, customer.created_date, CONCAT_WS(", ",
username.last_name, username.first_name), MAX(history.modify_date),
CONCAT_WS(",
", modified.last_name, modified.first_name), history.description
FROM `customer`
LEFT OUTER JOIN `business_unit` ON business_unit.bu_id = customer.bu_id
LEFT OUTER JOIN `username` ON username.user_id = customer.creator_id
LEFT OUTER JOIN `history` ON ( history.item_id = customer.customer_id  AND
history.module_id = 1003 )
LEFT OUTER JOIN `username` AS modified ON modified.user_id =
history.modifier_id
WHERE customer.customer_id LIKE "%man%"
OR customer.customer_name LIKE "%man%"
OR customer.created_date LIKE "%man%"
OR business_unit.business_unit LIKE "%man%"
OR username.first_name LIKE "%man%"
OR username.last_name LIKE "%man%"
OR history.modify_date LIKE "%man%"
OR history.description LIKE "%man%"
OR modified.first_name LIKE "%man%"
OR modified.last_name LIKE "%man%"
GROUP BY customer.customer_name
ORDER BY customer.customer_name

Note the MAX(history.modify_date) in the SELECT and the GROUP BY
customer_name

HTH! Peace ...

Jay


--- End Message ---
--- Begin Message ---
Hi,
 
I'm looking for somebody to give me a hand to create some expressions to
extract my information out of an ebay auction page. So that I can manage
them more effectively. 
I've try lost of patterns but can't seem to get the hang of it. 
 
Is there anybody willing to lone their brain to a php newbie before my
computer gets both barrels?
 
Thanks
 
Will
--- End Message ---
--- Begin Message ---

<snip>
In the past I've been using TextPad and UltraEdit but really want
something that picks up on PHP syntax and function spelling (eg
Homesite would 'bold' a function word if it was splt correctly).
</snip>


Just download the PHP syntax file for TextPad.

Dave



--- End Message ---
--- Begin Message ---
jEdit is nice
www.jedit.org

Seán Dillon wrote:

>As an fan of Homesite for many years I'm a little annoyed I can
>no-longer purchase the product seperately, so am going to be
>stuck with v5.0 as I don't fancy the idea of forking out
>for Dreamweaver MX.
>
>I'm looking for (hopefully) a GNU/GPL Open source product that
>supports PHP syntax (and preferably with support for additional
>languages with ad-ins or plugins).
>
>Currently I'm looking at HTML-Kit (http://www.chami.com/html-kit/)
>which seems to come with a vast array of add-ins and seems very
>'extensible'.
>
>In the past I've been using TextPad and UltraEdit but really want
>something that picks up on PHP syntax and function spelling (eg
>Homesite would 'bold' a function word if it was splt correctly).
>
>I'd be interested to hear what others are using so I can take a
>look at them before I change my main authoring product.
>
>Seán
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>  
>



--- End Message ---
--- Begin Message ---
First some background.  I have two "servers":
    1) Windows XP with Apache 1.3.26 and PHP 4.2.2
    2) GNU/Linux with Apache 1.3.26 and PHP 4.2.3 compiled in statically

Both are working well, but I now want to add PDFlib support to both servers.
On the win32 machine it was as easy as uncommenting out php_pdf.dll line in
php.ini and it was working great.

What is the best/easiest way to get PDFlib working on my Linux server?  I
don't have PDFlib itself installed on EITHER system (other than the
precompiled DLL on Windows).  Does the PHP source come with all the code
necessary to compile php_pdf.so or do I need to install PDFlib, libtiff,
libjpeg, libpng, libz....all from their respective sources in order to do
this?

Thanks.

-- Cameron



--- End Message ---
--- Begin Message ---
Lo all,

I get a timeout on line 523 of my code (posted and marked below).  However,
I fail to see where the timeout is occurring, and even debugging
(mysql_error()) doesn't report anything wrong!

I'm baffled as to what exactly is causing this timeout....  The code is
currently on Apache (Win32) with PHP 4.2.3.  When I move the code over to a
*nix system, it works perfectly via sendmail_path in php.ini, but when it
calls the SMTP server via a remote address, it fails.

The mail server's exim-3.36, receiver and sender verification has been
turned off.  The mail does go through the mail server.  I also tried
bouncing the messages through a local Exchange server, and the result of
this, is that the email get's additional headers that becomes part of the
body!

Line 523 is indicated with a **

<SNIP>
    // Insert the Technical Administrator's details into the Database as the
Company
    // Administrator.
    $MakePassword = new GeneratePassword(16,5);
    $Password = $MakePassword->makePassword();

    $SQL  = "INSERT INTO CompanyContacts (ContactActive, CompanyID, ";
    $SQL .= "ContactName, IDNumber, EMailAddress, CellNumber, Password)
VALUES ('1', '";
    $SQL .= mysql_escape_string($CompanyID) . "', '" .
mysql_escape_string($_POST['TechName']) . "', '";
    $SQL .= mysql_escape_string($_POST['TechID']) . "', '" .
mysql_escape_string($_POST['TechEMail']) . "', '";
    $SQL .= mysql_escape_string($_POST['TechCell']) . "', PASSWORD('" .
mysql_escape_string($Password) . "'));";
    $TechRegisterSQL = mysql_query($SQL) or die(mysql_error());

    // Mail the login details for the Company Administrator, Redirect him to
the login
    // page, and we're done!.
    $msg = "";
    $msg .= "Dear " . $_POST['TechName'] . ",\n";
    $msg .= "\n";
    $msg .= "Below follows your login details for MegaMonitor.  As the
registrar of\n";
    $msg .= "        " . $_POST['CompanyName'] . ",\n";
    $msg .= " you have been given the rights of Company Administrator.\n";
    $msg .= "\n";
    $msg .= "This allows you to log in at the MegaMonitor web site, and add
further\n";
    $msg .= "configurations for your company.  These may include account
contacts, \n";
    $msg .= "technical contacts, time periods, service checks, and
everything else \n";
    $msg .= "needed to setup monitoring for your company.\n";
    $msg .= "\n";
    $msg .= "You also may request for any number of additional services from
MegaLAN\n";
    $msg .= "Corporate Networking Services, including access to a wider
spectrum of\n";
    $msg .= "monitoring by purchasing more licenses for IP addresses.\n";
    $msg .= "\n";
    $msg .= "MegaLAN Corporate Networking Services also will be offering
other\n";
    $msg .= "excellent value added services over the not to distant future.
We are\n";
    $msg .= "hard at work to get these up and running, and as a client, we
will notify\n";
    $msg .= "you when they become available.  Some of these services
include:\n";
    $msg .= "\n";
    $msg .= "  - MegaMAIL, a e-mail virus scanning service for corporates.
We scan all\n";
    $msg .= "              in and outgoing e-mails on your behalf to ensure
your company\n";
    $msg .= "              does not get infected with viruses via
e-mail.\n";
    $msg .= "  - MegaDNS,  a DNS hosting and administrating service for
corporates,\n";
    $msg .= "              where we will provide access to DNS
administrative tools, as\n";
    $msg .= "              well as secondary domain hosting - free of
charge.\n";
    $msg .= "\n";
    $msg .= "To log in to MegaMonitor and configure your company's profile,
please visit\n";
    $msg .= "http://www.imadethis.co.za/login.php\n";;
    $msg .= "\n";
    $msg .= "Your Username: " . $_POST['TechEMail'] . "\n";
    $msg .= "Your Password: " . $Password . "\n";
    $msg .= "\n";
    $msg .= "You may change your password at anytime via our administrative
interface on\n";
    $msg .= "our web site.\n";
    $msg .= "\n";
    $msg .= "Thank you for your interest in MegaMonitor, and we hope we will
benefit\n";
    $msg .= "your company tremendously.\n";
    $msg .= "\n";
    $msg .= "MegaLAN Customer Support.\n";
    $msg .= "\n";
    mail($_POST['TechEMail'], "MegaMonitor Registration Details", $msg,
         "From: MegaLAN Customer Support <[EMAIL PROTECTED]>\r\n");

    // Mail everything to MegaLAN support for confirmation.
    // Look up the bank name in the Database.
**    $BankQuery = mysql_query("SELECT BankName FROM GlobalBankNames WHERE
BankID='" . mysql_escape_string($_POST['BankInstitution']) . "';") or die
(mysql_error());
    while ($BankList = mysql_fetch_array($BankQuery)) {
      $BankLongName = $BankList['BankName'];
    }
    if ($_POST['BankAccountType'] == "3") {
      $BankAccountTypeLong = "Cheque Account";
    } elseif ($_POST['BankAccountType'] == "2") {
      $BankAccountTypeLong = "Transmission Account";
    } elseif ($_POST['BankAccountType'] == "1") {
      $BankAccountTypeLong = "Savings Account";
    } else {
      // We should never get this!!!
      $BankAccountTypeLong = "Error - Confirm with Client";
    }

    $msg  = "";
    $msg .= "New company registration for MegaMonitor service:\n";
    $msg .= "-------------------------------------------------\n";
    $msg .= "Company Name: " . $_POST['CompanyName'] . " (ID:
$CompanyID)\n";
    $msg .= "Telephone Number: " . $_POST['TelNumber'] . "    Fax Number: "
. $_POST['FaxNumber'] . "\n";
    $msg .= "\n";
    $msg .= "Physical Address:\n";
    $msg .= "  " . $_POST['PhysAddress1'] . "\n";
    $msg .= "  " . $_POST['PhysAddress2'] . "\n";
    $msg .= "  " . $_POST['PhysTown'] . "\n";
    $msg .= "  " . $_POST['PhysCode'] . "\n";
    $msg .= "\n";
    $msg .= "Postal Address:\n";
    $msg .= "  " . $_POST['PostAddress1'] . "\n";
    $msg .= "  " . $_POST['PostAddress2'] . "\n";
    $msg .= "  " . $_POST['PostTown'] . "\n";
    $msg .= "  " . $_POST['PostCode'] . "\n";
    $msg .= "\n";
    $msg .= "Banking Details:\n";
    $msg .= "  Bank Name       " . $BankLongName . "\n";
    $msg .= "  Account Type    " . $BankAccountTypeLong . "\n";
    $msg .= "  Branch          " . $_POST['BankBranch'] . "\n";
    $msg .= "  Account Number  " . $_POST['BankAccount'] . "\n";
    $msg .= "\n";
    $msg .= "Technical Administrator Details:\n";
    $msg .= "  " . $_POST['TechName'] . " (" . $_POST['TechEMail'] . ")\n";
    $msg .= " Contact Number " . $_POST['TechCell'] . "\n";
    $msg .= " ID Number      " . $_POST['TechID'] . "\n";
    $msg .= "\n";
    $msg .= "\n";
    mail("[EMAIL PROTECTED]", "MegaMonitor Company Registration
Details", $msg,
         "From: MegaLAN Customer Support <[EMAIL PROTECTED]>\r\n");
?>
        <table border="0" cellpadding="5" cellspacing="0" height="100%"
width="100%">
        <tbody>
</SNIP>

I really don't see anything wrong here at all!!!

HELP! ;)

--
me

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

I've got a customer who needs a banner rotation system. I don't want to 
recreate any wheels and I'm tryin to avoid a lot of research.

I'd like one that doesn't use globals, it uses PEAR classes and preferably 
uses the Smarty template system or another template system, or you've used 
it and it works like a charm :) I would like something that has some statistics, 
works with MySQL, but they'd prefer a freebie or low cost. They don't need a 
super duper package at this time.

Thanks,

Peter

http://www.coremodules.com/
Web Development and Support  at Affordable Prices
901-757-8322    [EMAIL PROTECTED]



--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Peter J. Schoenster [mailto:[EMAIL PROTECTED]]
>
> Hi,
>
> I've got a customer who needs a banner rotation system. I don't want to
> recreate any wheels and I'm tryin to avoid a lot of research.

Have a look at phpAdsNew
http://sourceforge.net/projects/phpadsnew/

Seán

--- End Message ---
--- Begin Message ---
I'll second that - It's a truly professional solution.
[even has a full user manual]

Here are a couple articles you might want to checkk
out:

http://www.devarticles.com/content.php?articleId=126&page=1

http://www.devshed.com/Server_Side/PHP/CommercialBreak/page1.html

olinux


--- Seán_Dillon <[EMAIL PROTECTED]> wrote:
> > -----Original Message-----
> > From: Peter J. Schoenster
> [mailto:[EMAIL PROTECTED]]
> >
> > Hi,
> >
> > I've got a customer who needs a banner rotation
> system. I don't want to
> > recreate any wheels and I'm tryin to avoid a lot
> of research.
> 
> Have a look at phpAdsNew
> http://sourceforge.net/projects/phpadsnew/
> 
> Seán
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com
--- End Message ---
--- Begin Message ---
Hello all,

I've got a bit of a code problem that's been baffling
me for a while now.

I'm working on a basic weblog system for personal use,
using MySQL.  I've got the "new post" and "delete a
post" aspects working fine, but for some reason, I
can't get the "update a post" part happening.  

What happens is I select a post to update, and then
the post comes up in a textarea box.  You then make
your update, and submit.

Doing this calls the following function:

 function updateBlog($input,$edit_blog) {     


         include 'db_connect.php';
    $update_query = "update $table set blog='$input'
where id='$edit_blog'";
    if(mysql_db_query ($database, $update_query,
$link)) {
       print "Successfully Edited!!";
    }else{
        print "no";

    }   

 The variables being passed to the function are:
  $input = "The body of the post"
 and
  $edit_blog =  id # of post

At this point everything appears to have been a
success.  The "Successfully Edited!!" confirmation
appears, and everything seems fine, but when I look at
my database, nothing has been updated or changed in
any way.

Does anyone have any suggestions or help they could
lend me?  I've been facing this problem for a while
now, and can't seem to get my head around it.

You can view the entire code here:
http://soniceast.d2g.ca/~jalaw/blog/admin.txt

Thanks a bunch for any help,

Jesse Lawrence
 

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca
--- End Message ---
--- Begin Message ---
<code snippet>
       if ($post == "post") {
          postBlog ($post,$input,$title);
       }elseif ($post == "edit"){

          updateBlog ($input,$edit_post);  //  <---- BINGO!
       }
</code snippet>

Just looking at the code you posted to your site, there's only one thing
obvious to me: You want to use $edit_blog in that call to updateBlog
instead of $edit_post?

        g.luck,
        ~Chris

On Thu, 12 Sep 2002, Jesse Lawrence wrote:

> Hello all,
>
> I've got a bit of a code problem that's been baffling
> me for a while now.
>
> I'm working on a basic weblog system for personal use,
> using MySQL.  I've got the "new post" and "delete a
> post" aspects working fine, but for some reason, I
> can't get the "update a post" part happening.
>
> What happens is I select a post to update, and then
> the post comes up in a textarea box.  You then make
> your update, and submit.
>
> Doing this calls the following function:
>
>  function updateBlog($input,$edit_blog) {
>
>
>          include 'db_connect.php';
>     $update_query = "update $table set blog='$input'
> where id='$edit_blog'";
>     if(mysql_db_query ($database, $update_query,
> $link)) {
>        print "Successfully Edited!!";
>     }else{
>         print "no";
>
>     }
>
>  The variables being passed to the function are:
>   $input = "The body of the post"
>  and
>   $edit_blog =  id # of post
>
> At this point everything appears to have been a
> success.  The "Successfully Edited!!" confirmation
> appears, and everything seems fine, but when I look at
> my database, nothing has been updated or changed in
> any way.
>
> Does anyone have any suggestions or help they could
> lend me?  I've been facing this problem for a while
> now, and can't seem to get my head around it.
>
> You can view the entire code here:
> http://soniceast.d2g.ca/~jalaw/blog/admin.txt

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

Hello everyone.

I want to implement templates in a site, but am having trouble processing
php within the template file. The application flow is as follow:

-open the template file (which has some place holders) with
$fileHandler =  file($file_name)

-Replace placeholders (within the template files) with
 $fileHandler = ereg_replace("--PlaceHolder--","New content",$Handler)
 //disregard syntax errors...

-Then display the content of the modified template
 $fileHandler = implode('',$fileHandler)
 echo $fileHandler;


The above process works, as far as replace the place holders, and printing
the new content (which is an HTML file). However, it will not process PHP
scripts, within the template.

For example, if my template has

<html>
 ......
<body>

   <?php>
     echo "hello!";
   ?>
<p>blah blah blah
</body>
</html>

the above process will display the PHP code within the HTML file, without
processing.

How can I process the PHP codes that's in the template?


-john



=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.


--- End Message ---
--- Begin Message ---
> The above process works, as far as replace the place holders, and printing
> the new content (which is an HTML file). However, it will not process PHP
> scripts, within the template.

If it's really a template, why does it have PHP scripts within?  Why not just
replace those scripts with place holders and process as you would normally?

Chris


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

Include your template this way:

$file_name="templates/somefile.php"
$New_Content1 = 'This is the new text';
$New_Content2 = 'This is the other text';
include $file_name;


In the template file, have <?php echo $New_Content; ?> etc wherever the 
content should appear.

Then you can put other php code in the template file as well.

I use this all the time.


Peter


At 12:00 PM 9/12/2002 -0700, you wrote:

>Hello everyone.
>
>I want to implement templates in a site, but am having trouble processing
>php within the template file. The application flow is as follow:
>
>-open the template file (which has some place holders) with
>$fileHandler =  file($file_name)
>
>-Replace placeholders (within the template files) with
>  $fileHandler = ereg_replace("--PlaceHolder--","New content",$Handler)
>  //disregard syntax errors...
>
>-Then display the content of the modified template
>  $fileHandler = implode('',$fileHandler)
>  echo $fileHandler;
>
>
>The above process works, as far as replace the place holders, and printing
>the new content (which is an HTML file). However, it will not process PHP
>scripts, within the template.
>
>For example, if my template has
>
>...... <?php> echo "hello!"; ?>
>
>blah blah blah
>the above process will display the PHP code within the HTML file, without
>processing.
>
>How can I process the PHP codes that's in the template?
>
>
>-john
>
>
>
>=P e p i e  D e s i g n s
>  www.pepiedesigns.com
>  Providing Solutions That Increase Productivity
>
>  Web Developement. Database. Hosting. Multimedia.
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -

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

You are absolutly correct.
Thx!


=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

On Thu, 12 Sep 2002, Chris Boget wrote:

> > The above process works, as far as replace the place holders, and printing
> > the new content (which is an HTML file). However, it will not process PHP
> > scripts, within the template.
>
> If it's really a template, why does it have PHP scripts within?  Why not just
> replace those scripts with place holders and process as you would normally?
>
> Chris
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I have an application where I need to write PHP code to a file that will be
used later...but it's not working the way I'd expect.

When I issue the following:

fwrite($fp, "<? echo $LayerScale");

If $LayerScale is defined, then fwrite outputs the value of $LayerScale to
the target, NOT the string $LayerScale.

How can I overcome this?

Chip
--- End Message ---
--- Begin Message ---
On Thu, 12 Sep 2002, Hankley, Chip wrote:

> fwrite($fp, "<? echo $LayerScale");
> If $LayerScale is defined, then fwrite outputs the value of $LayerScale to
> the target, NOT the string $LayerScale.
> How can I overcome this?

fwrite($fp, "<? echo \$LayerScale");

        g.luck,
        ~Chris

--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Erwin [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, September 12, 2002 11:02 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Displaying PDF file
> 
> 
> Joseph Szobody wrote:
> > Thanks Erwin, that helps.... but I'm still not getting it to work.
> > Should I still use the .... 
> > 
> > Header("Content-type: application/pdf");
> > 
> > line?
> > 
> > I tried using readfile() keeping the header. When I click 
> the link to
> > the PHP script that should show me the PDF, the IE status bar says
> > something like "Downloading from site .....blah", then says "Done".
> > Nothing happens. I'm still on the previous page. No error, no pdf
> > file... nothing.    

Send these three headers:
header('Content-type: application/pdf'); 
header("Content-Disposition: inline; filename=$file");
header("Content-Length: $length");

You need to send the length of the document, so use filesize() to get it.

Also, if you had an error in the script, close the browser window and then re-open it 
and browse to the page again.

Lastly, IE changes a POST request to a GET request on a pdf document, so you can't hit 
refresh on the POSTed to page.  If that's what you're going, you might want to 
consider changing the POST to a GET ...
--- End Message ---
--- Begin Message ---
I am trying to get a script to work to retrieve data from a MS SQL database.
I also tried using a ODBC connection, but that didn't work either.

Here is the error I get;
    Warning: MS SQL: Unable to connect to server: LocalServer in
     C:\WEBS\CTTechCouncil\stocks\mssql.php on line 7
     DATABASE FAILED TO RESPOND.

Here is what I have:

<?PHP
$hostname = "LocalServer";
$username = "ctorg";
$password = "sbc123";
$dbName = "DirectoryDB";

MSSQL_CONNECT($hostname, $username, $password) or DIE("DATABASE FAILED TO
RESPOND.");
mssql_select_db($dbName) or DIE("Table unavailable");

$query = "SELECT * FROM Company";

$result = MSSQL_QUERY($query);

$number = MSSQL_NUM_ROWS($result);

$i=0;

if ($number == 0) :
 print "No data?";
elseif ($number > 0) :
 print "Data:\n";

 while ($i < $number) :
 $name = mssql_result($result,$i,"CompanyName");
 print $name;
 print "
 ";
 $i++;
 endwhile;
endif;
?>


--- End Message ---
--- Begin Message ---
Hi,
 I wrote a command line script which makes some administration things on my server.
 The script is setuid (set uid to root).

 I call the script simply through its name.

 I've put a >>print getuid()." ".get_current_user();<<< in the script to see under 
which
 user it is running.

 When I su to nobody and run the script it returns "0 root".
 apparently it has got root rights at that moment.

 But the script can't execute anything it should be able to, 
 example: creating a file in root's directory, cat-ing the /etc/shadow..

 It always says: "No permission etc"

 Is it a security switch in the php.ini or what can this be?



thanks in advance

patric de waha
 
 
--- End Message ---
--- Begin Message ---
Hello,

maybe someone can help me.

i have specified the *.PFB and the *.AFM file. this all works
by setting the encoding to

pdf_set_font("the_typo_name",size,"winansi",1);

i got the error :

Warning: Internal PDFlib warning: Can't reencode Symbol font
'TheSansBold-Caps' (using builtin) in where_the_file_is on line 222


i have to use "builtin" encoding, but this don't look fine (its maybe a
german prob;-( )

does anybody knows the matter of this error? a corrupt afm file maybe?

please help
--- End Message ---
--- Begin Message ---
HI,
I am trying to use a script php with the command:
system("mkdir /home/hosting/test");
but the PERMISSION IS DENIED and I am the root on my server.

How I change the user to root?

Thanks

--
Atenciosamente

Breno Cardoso Perucchi
[EMAIL PROTECTED]
Consultor - Omega Tecnologia
http://www.omegatec.net/



--- End Message ---
--- Begin Message ---
you don't.  php/apache run as the user nobody for security purposes.

                        Adam

On Thu, 12 Sep 2002, Breno Cardoso Perucchi wrote:

> HI,
> I am trying to use a script php with the command:
> system("mkdir /home/hosting/test");
> but the PERMISSION IS DENIED and I am the root on my server.
>
> How I change the user to root?
>
> Thanks
>
> --
> Atenciosamente
>
> Breno Cardoso Perucchi
> [EMAIL PROTECTED]
> Consultor - Omega Tecnologia
> http://www.omegatec.net/
>
>
>
>
>

--- End Message ---
--- Begin Message ---
I know, but how I change to root user?

--
Atenciosamente

Breno Cardoso Perucchi
[EMAIL PROTECTED]
Consultor - Omega Tecnologia
http://www.omegatec.net/

"Adam Williams" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> you don't.  php/apache run as the user nobody for security purposes.
>
> Adam
>
> On Thu, 12 Sep 2002, Breno Cardoso Perucchi wrote:
>
> > HI,
> > I am trying to use a script php with the command:
> > system("mkdir /home/hosting/test");
> > but the PERMISSION IS DENIED and I am the root on my server.
> >
> > How I change the user to root?
> >
> > Thanks
> >
> > --
> > Atenciosamente
> >
> > Breno Cardoso Perucchi
> > [EMAIL PROTECTED]
> > Consultor - Omega Tecnologia
> > http://www.omegatec.net/
> >
> >
> >
> >
> >
>


--- End Message ---
--- Begin Message ---
On Thu, 12 Sep 2002, Breno Cardoso Perucchi wrote:

> system("mkdir /home/hosting/test");
> but the PERMISSION IS DENIED and I am the root on my server.
> How I change the user to root?

Dude, you don't change to the root user ... you'll get yourself owned that
way.  Change the permissions on the directory to allow the web server's
user to write files and create subdirectories.

For example, most of my boxen run apache as user 'www-data' --
# chown root:www-data /home/hosting
# chmod 2775 /home/hosting

        ~Chris

--- End Message ---
--- Begin Message ---
Breno Cardoso Perucchi writes: 

> HI,
> I am trying to use a script php with the command:
> system("mkdir /home/hosting/test");
> but the PERMISSION IS DENIED and I am the root on my server. 
> 
> How I change the user to root? 
> 

If you /really/ want to use this, use a C wrapper that's setuid root.
Otherwise, give access to your httpd user to the mentioned directory. 

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

I've got a local test machine running WinXP Pro SP1 with PHP 4.2.2 and 
Apache 1.3.26.  What I'd like to do is change the include_path settings for 
PHP in a .htaccess file (as I have several sites being tested on this 
machine and do not wish to have to edit the php.ini in my Windows directory 
each time I switch sites).

I've made this work under several flavors of Unix, but not under Windows - 
does the Windows version of Apache not support .htaccess?

Here is the command I'm using:

php_value include_path ".;D:\WebPages\2002\www.site.com\docs\"

now under Unix it works by doing the following:

php_value include_path ".:/client/site/docs"

Is there some little step that I've completely missed?

Thanks
-Tim


--- End Message ---
--- Begin Message ---
> From: Tim Thorburn [mailto:[EMAIL PROTECTED]]

> Yes, I had tried the forward slashes before and I just tried 
> to escape the 
> backslashes as you thought - sadly neither have worked :(

>From the Apache site:

"Since it is often difficult to manage files with names like .htaccess under windows, 
you may find it useful to change the name of this configuration file using the 
AccessFilename directive."
--
Un gran saludo/Big regards...
   Arturo Barajas
   Sistemas PPG MX (SJDR)
--- End Message ---
--- Begin Message ---
BTW:

AccessFileName directive
Syntax: AccessFileName filename [filename] ...
Default: AccessFileName .htaccess
Context: server config, virtual host
Status: core
Compatibility: AccessFileName can accept more than one filename only in Apache 1.3 and 
later 
When returning a document to the client the server looks for the first existing access 
control file from this list of names in every directory of the path to the document, 
if access control files are enabled for that directory. For example:

AccessFileName .acl 
before returning the document /usr/local/web/index.html, the server will read /.acl, 
/usr/.acl, /usr/local/.acl and /usr/local/web/.acl for directives, unless they have 
been disabled with 
<Directory />
AllowOverride None
</Directory> 
See Also: AllowOverride and Configuration Files
--
Un gran saludo/Big regards...
   Arturo Barajas
   Sistemas PPG MX (SJDR)
--- End Message ---
--- Begin Message ---
hi - i have a text file that i am using as a database.  the format for
each line is such (2 lines shown):

Fashion|508|Text Text
Text.|http://qtbras.com/qtbrascat/images/508_big.jpg|http://qtbras.com/qtbrascat/images/508_thumb.jpg

Fashion|510|Text Text
Text|http://qtbras.com/qtbrascat/images/510_big.jpg|http://qtbras.com/qtbrascat/images/510_thumb.jpg

I'm putting each line into an array, then splitting each value by the
pipe symbol to get individual values.  i need to know how to select a
line in the text file and rewrite over it - for example if i wanted to
replace:

Fashion|510|Text Text
Text|http://qtbras.com/qtbrascat/images/510_big.jpg|http://qtbras.com/qtbrascat/images/510_thumb.jpg

with:

Allure|533|Text Text
Text|http://qtbras.com/qtbrascat/images/510_big.jpg|http://qtbras.com/qtbrascat/images/510_thumb.jpg

or something like that, how do i select which line in the text file i
want to replace and write over it?  i would prefer not to delete the
line and then write a new one at the end, but if that's the only way,
i'll do it.

thanks

--- End Message ---
--- Begin Message ---
Try using an unique number as the first field of the line.
You can then use that number to select the line (entry) and update it.
Kumar

drparker wrote:

> hi - i have a text file that i am using as a database.  the format for
> each line is such (2 lines shown):
>
> Fashion|508|Text Text
> 
>Text.|http://qtbras.com/qtbrascat/images/508_big.jpg|http://qtbras.com/qtbrascat/images/508_thumb.jpg
>
> Fashion|510|Text Text
> 
>Text|http://qtbras.com/qtbrascat/images/510_big.jpg|http://qtbras.com/qtbrascat/images/510_thumb.jpg
>
> I'm putting each line into an array, then splitting each value by the
> pipe symbol to get individual values.  i need to know how to select a
> line in the text file and rewrite over it - for example if i wanted to
> replace:
>
> Fashion|510|Text Text
> 
>Text|http://qtbras.com/qtbrascat/images/510_big.jpg|http://qtbras.com/qtbrascat/images/510_thumb.jpg
>
> with:
>
> Allure|533|Text Text
> 
>Text|http://qtbras.com/qtbrascat/images/510_big.jpg|http://qtbras.com/qtbrascat/images/510_thumb.jpg
>
> or something like that, how do i select which line in the text file i
> want to replace and write over it?  i would prefer not to delete the
> line and then write a new one at the end, but if that's the only way,
> i'll do it.
>
> thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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

Hi I'm runing a PHP Version 4.0.4pl1 on Solaris 8 X86 on apache, and I'm
trying to search an array




while(list($findId) = mysql_fetch_row($resultNextLast)){
    $NextLast[] = $findId;
}
$currArrayPos   = array_search($ImgId, $NextLast);


and this code results this error:
Fatal error: Call to undefined function: array_search()


Any body have any idea what could be wrong?


Thanks David

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

> Hi I'm runing a PHP Version 4.0.4pl1 on Solaris 8 X86 on apache, and I'm
> trying to search an array

>From the manual: array_search (PHP 4 >= 4.0.5)

send earlier to this list:

Re: [PHP] Array - Match
From: Bas Jobsen <[EMAIL PROTECTED]>
To: "N. Pari Purna Chand" <[EMAIL PROTECTED]>, 
<[EMAIL PROTECTED]>


<?
$sub = "abcd";

$subs[] = "cde";
$subs[] = "iyu";
$subs[] = "abc";
$subs[] = "xyx";
$match=false;
foreach($subs as $value)
{
 if($sub==$value){$match=true; break;}
}
if($match) echo 'found!';
else  echo 'not found!';

//or better use
//for PHP 4
if(in_array($sub,$subs))echo 'found!';
else  echo 'not found!';

//also possible
//for PHP 4 >= 4.0.5 && < 4.2.0
if(is_null(($b=array_search($sub,$subs))))  echo 'not found!';
else echo 'found! In $sub['.$b.']';
//or for  PHP 4 >= 4.2.0
if(($b=array_search($sub,$subs)))  echo 'found! In $sub['.$b.']';
else echo 'not found!';
?>
--- End Message ---
--- Begin Message ---
> What I was  looking for was finding out what was the index of thet
> value, lets say I have a array with some values like (23, 56, 45, 47)
> and i don't know where the walue I'm looking for is indexed in the array
> and I want to find out what the indexnumber is, how would that be
> possable

<?

function array_index($array,$needle)
{
/* written by [EMAIL PROTECTED] */
foreach($array as $key=>$value)
if($value==$needle)
return $key;
return -1;
}

$array=array(23, 56, 45, 47);

echo array_index($array,45);
echo array_index($array,48);
if(array_index($array,48)<0)echo 'not found';
else echo 'found';
?>

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

  I'm running PHP 4.1.2 and am looking for information on doing an HTTP post
action from PHP to another web server using SSL (and capturing the
response). I've searched the online docs to no avail. Can somone point me in
the right direction?


__________________________
Lon Lentz
Applications Developer
EXImpact.com


--- End Message ---
--- Begin Message ---
I've never done this, but I understand that curl is supposed to offer 
support for SSL.

http://www.php.net/manual/en/ref.curl.php

The manual looks a bit weak in this regard, but maybe that will give you 
a decent starting point. If someone else has an example, that would be 
more useful.

Happy hacking.

Chris

Lon Lentz wrote:

>I'm running PHP 4.1.2 and am looking for information on doing an HTTP post
>action from PHP to another web server using SSL (and capturing the
>response). I've searched the online docs to no avail. Can somone point me in
>the right direction?
>

--- End Message ---
--- Begin Message ---
Does anyone know why the following script will not rebuild one of my
sendmail databases?

<?
exec('/usr/sbin/makemap hash /etc/mail/virtusertable.db <
/etc/mail/virtusertable');
exit;
?>




--- End Message ---
--- Begin Message ---
Doug Kozar writes: 

> Does anyone know why the following script will not rebuild one of my
> sendmail databases? 
> 
> <?
> exec('/usr/sbin/makemap hash /etc/mail/virtusertable.db <
> /etc/mail/virtusertable');
> exit;
> ?> 
> 

Check your httpd logs. I'd be willing to bet it's a permissions issue as 
httpd's usually aren't run as root (unless you're crazy ;) 

 -jesse 
--- End Message ---
--- Begin Message ---
Why would you convert them to PDF on the fly???  If you wanted to show
really hi-res images, yes PDF would result in *slightly* smaller files, in
*some cases*, but for standard web stuff, why not consider the humble
compressed JPG?  Whatever format, the file is gonna be huge if they're
trying to read a scan of a magazine page...!

As far as the PDF thing goes, I would generate your PDFs on your desktop
machine, and load them onto the site via FTP -- there is no point generating
PDFs on the on-the-fly if the content is static (ie, you'll only ever need
to generate it once).

Plus, you'll need PDFlib, not GD for that.


Justin




on 12/09/02 11:56 PM, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:

> Hi all,
> 
> One of my customers needs to show magazine & newspapers reviews of his
> work, which are scanned in such a low res due to a file size matter, that
> the images are not quite readable. Can I convert large size images to pdf
> with PHP in order to show them faster on-the-fly? Will this be better? Is
> there another quick and easy solution?
> 
> BTW, I do have access to GD lib if this should matter.
> 
> Thanks in advance,
> 
> César Aracena
> On Dial-Up
> 
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
This message sounds as though I want a system that checks email, etc. 
 That is not what I'm after.  What I'm trying to do is make a system 
where users can mail each other, using a mysql database.
Leif K-Brooks wrote:

> I'm designing a site, and I want to put mail with folders on it.  
> Fairly simply, but I'm not sure what to do for the default folders.  I 
> want to have three precreated folders: inbox, trash, and sent.  I'm 
> not sure about the best way to do these.  Any ideas?
>
>


--- End Message ---
--- Begin Message ---
I am trying to copy *.log files to a file called dir.data. Does anyone have a 
suggestion on the php code to use? I am using Redhat 7.0. Using "ls *.log > dir.data 
doesn't work.

Also does anyone know how to insert a text on about the 4 or 5 line of a file using 
php? I can add text to the end of a file and to the beginning, but I'm not sure how to 
do it for specific lines.

Thanks


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002
--- End Message ---
--- Begin Message ---
hi there @php.net,
please, can you help me enabling the extensions in php?

i tried for hours to accomplish the right settings, but it seems, the
solution is out
of reach. you'll find a mini screenshot of my error message so you'll see
exactly
what i mean.

machine details: php v4.2.3, apache v2.0.40., winXP

php is installed in "c:\system\php\"
the 'extensiom_dir' in the php.ini  is "c:\system\php\extensions\"

i only found little information about people having the same trouble, and i
tried
copying the *.dll files from the php/dlls and php/extensions dir to
"c:windows,
c:\windows\system, c:\windows\system32" - but no effect.

thank you in advance,
mailto [EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
llclmc writes: 

> I am trying to copy *.log files to a file called dir.data. Does anyone have a 
>suggestion on the php code to use? I am using Redhat 7.0. Using "ls *.log > dir.data 
>doesn't work. 
> 

Try: "cat *.log > dir.data"
ls will just give filenames, cat will do the inside of the files. 

> Also does anyone know how to insert a text on about the 4 or 5 line of a file using 
>php? I can add text to the end of a file and to the beginning, but I'm not sure how 
>to do it for specific lines. 
> 

Sorry.. 

 -jesse 
--- End Message ---

Reply via email to