Re: [PHP] Do any of you provide hosting?

2001-04-12 Thread Lindsay Adams

yes, the subdomains cost you $20/setup, and $2/month extra.

the reason for the setup? they won't let you mess with the dns (which makes
a lot of sense)

overall, it is worth it. you will of course pass the setup fee on to your
clients, and charge more than $2/month, but you can see, that the return
comes pretty quickly.


On 4/12/01 11:01 AM, "Chris Anderson" [EMAIL PROTECTED] wrote:

 i'll have to try that. But can they use my current domain. Also do setting
 up sub-domains in an hour cost me anything?
 - Original Message -
 From: "Lindsay Adams" [EMAIL PROTECTED]
 To: "PHP" [EMAIL PROTECTED]
 Sent: Thursday, April 12, 2001 1:36 PM
 Subject: Re: [PHP] Do any of you provide hosting?
 
 
 Check out aitcom.net
 
 get a resellers account, and go hog wild. you can even edit the httpd.conf
 page for custom liasing of directories, and anything else.
 
 I wasn't able to get them to compile PHP with some of the extras, at least
 not as an apache module, BUT I was able to compile PHP as a cgi for a few
 custom features.(libpdf.so)
 
 and setting up new domains is a breeze. Just order it, and wait an hour.
 
 So, if you are wanting to host other sites (and charge for them) a
 reseller's account with AIT is a great way to go. A couple of paid sites
 can
 quickly cover the costs for your own site.
 
 I am up to 27 virtual hosts on my account
 
 On 4/12/01 10:28 AM, "Matt McClanahan" [EMAIL PROTECTED] wrote:
 
 On Thu, Apr 12, 2001 at 10:34:26AM -0400, Chris Anderson wrote:
 
 Someone who can host my domain (I own the domain already)
 Can provide MySQL and PHP. Both up-to-date.
 Can give around 60 meg of space (ballpark, less should be fine)
 Also a way to set up subdomains without needing to go through the admin
 (some
 hosts can do his). But this isn't necessary.
 Can anyone help with that?
 
 Handy PHP hosting directory:
 
 http://hosts.php.net
 
 Matt
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] no reponse -- Need FTP help

2001-04-12 Thread Lindsay Adams

sure.

keep track of the files on the server drive, then open a connection using
fopen() and fputs the contents of each file.

On 4/12/01 3:13 PM, "David Minor" [EMAIL PROTECTED] wrote:

 Well, I didn't get a response from my previous post, so I'm trying again.  I
 need to collect a group of files in a form and ftp them to a different
 server than the script is located on.  Can this be done? how?
 
 Thank you,
 David Minor
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] radio groups in looped form

2001-04-11 Thread Lindsay Adams

My question:

are the groups all within different forms? does each for have a different
name? don't know, something to try.


On 4/11/01 5:05 PM, "Peter Houchin" [EMAIL PROTECTED] wrote:

 even though i am putting them in an array?
 
 like
 
 input type="radio" name="avail[]" value="y" ? if ($avail == 'y') { echo
 'CHECKED'; }?
 
 (i have another 2 radio buttons with this group)
 
 Peter
 
 -Original Message-
 From: SED [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 12, 2001 10:05 AM
 To: Peter Houchin
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] radio groups in looped form
 
 
 I don't think you can. The browser groups them by the name, so you will have
 to write some code (simple) to change the name...
 
 SED
 
 -Original Message-
 From: Peter Houchin [mailto:[EMAIL PROTECTED]]
 Sent: 11. aprl 2001 23:33
 To: Php-General@Lists. Php. Net
 Subject: [PHP] radio groups in looped form
 
 
 hiya,
 
 I have a script that repeats a form x number of times depending on how many
 records there are, what's happening is when i go to update my radio buttons
 it sees every radio button on the page as the ONE group when really it's x
 number of groups (again depending on how many records there are)
 
 How can i differ between raido groups with out having to get the name
 changed for every record after the 1st one?
 
 Peter Houchin
 [EMAIL PROTECTED]
 =
_  __   /\
   /_/_/_\/  |_/  \
  /_/_/___  __  __   __  / \
  \_/_/_\  /_/ /_/ /_/  /_/  \   _ /
 ___\_\_\/ /_/_/_/ /_//\/_/\_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/v
   
   /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  /_/_ _/_/ __  __   __  /_/   __ __
 /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\/_//_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
 /_/\_\/_/_/_/ /_/ \/_/ /_/ /_/\_\/_/_/_//_/_/_/
 =
 Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
 * We rent the dot in .COM!  **
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] radio groups in looped form

2001-04-11 Thread Lindsay Adams

by this I mean, html code of the form:
FORM NAME="form1" METHOD="post" ACTION=""
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
/FORM
FORM NAME="form2" METHOD="post" ACTION=""
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"
INPUT TYPE="radio" NAME="radiobutton" VALUE="radiobutton"

INPUT TYPE="radio" NAME="radiobutton" ALUE="radiobutton"
/FORM

radiobuttons with the same name, in the same FORM tag will always be
considered a group. if they are in separate form tags, they should be
separate groups, even if the form does not have a name (unless the browser
is buggy)

the way around this is multidimensional arrays

printing your radio buttons as name="avail[1][]" will put make different
subgroups or radio buttons every time you change the index in the first [].

but, if you truly have separate form tags, the only data that is going to
get sent back, is the data within that for, doesn't matter WHAT the other
buttons in the other forms say.

personally, I try to stay away from multiple forms per page.

in a situation like yours sounds to be, I like to put a hidden field on each
line that is mykey[] and set the value to a unique id in the database.

I can then put a lot of data into multiple rows, enabling me to update a
whole group of data at once.

I still have to send one update to my database per row, but what the hell.




On 4/11/01 5:07 PM, "Lindsay Adams" [EMAIL PROTECTED] wrote:

 My question:
 
 are the groups all within different forms? does each for have a different
 name? don't know, something to try.
 
 
 On 4/11/01 5:05 PM, "Peter Houchin" [EMAIL PROTECTED] wrote:
 
 even though i am putting them in an array?
 
 like
 
 input type="radio" name="avail[]" value="y" ? if ($avail == 'y') { echo
 'CHECKED'; }?
 
 (i have another 2 radio buttons with this group)
 
 Peter
 
 -Original Message-
 From: SED [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, April 12, 2001 10:05 AM
 To: Peter Houchin
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP] radio groups in looped form
 
 
 I don't think you can. The browser groups them by the name, so you will have
 to write some code (simple) to change the name...
 
 SED
 
 -Original Message-
 From: Peter Houchin [mailto:[EMAIL PROTECTED]]
 Sent: 11. aprl 2001 23:33
 To: Php-General@Lists. Php. Net
 Subject: [PHP] radio groups in looped form
 
 
 hiya,
 
 I have a script that repeats a form x number of times depending on how many
 records there are, what's happening is when i go to update my radio buttons
 it sees every radio button on the page as the ONE group when really it's x
 number of groups (again depending on how many records there are)
 
 How can i differ between raido groups with out having to get the name
 changed for every record after the 1st one?
 
 Peter Houchin
 [EMAIL PROTECTED]
 =
_  __   /\
   /_/_/_\/  |_/  \
  /_/_/___  __  __   __  / \
  \_/_/_\  /_/ /_/ /_/  /_/  \   _ /
 ___\_\_\/ /_/_/_/ /_//\/_/\_/ \/\_/
 \_//_/_/ /_/_/_/ /_/ \/_/v
   
   /_/_/_/_/  /_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
  /_/_ _/_/ __  __   __  /_/   __ __
 /_/_/_/_/ /_/_/_/ /_/  /_/ /_/ /_/\_\/_//_/_/_/
 /_/  \_\  /_/ _/  /_//\/_/ /_/ /_/__\_\  /_/___ _\_\_\
 /_/\_\/_/_/_/ /_/ \/_/ /_/ /_/\_\/_/_/_//_/_/_/
 =
 Telephone : (03) 9329 1455  Facsimile : (03) 9329 6755
 * We rent the dot in .COM!  **
 
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] can't restart apache, help needed

2001-04-10 Thread Lindsay Adams

do you have php3 installed still?
if so, your mime types might be conflicting or something



On 4/10/01 3:35 AM, "Thomas Angst" [EMAIL PROTECTED] wrote:

 I didn't get any further errors as this in /ver/log/httpd/error_log:
 PHP Warning:  Function registration failed - duplicate name - define in
 Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name - defined in
 Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name - each in
 Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name - strlen in
 Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name - strcmp in
 Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name - strcasecmp in
 Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name -
 error_reporting in Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name - leak in
 Unknown on line 0
 PHP Warning:  Function registration failed - duplicate name -
 function_exists in Unknown on line 0
 PHP Warning:  Basic Functions:  Unable to register functions, unable to load
 in Unknown on line 0
 
 and /sbin/init.d does no more exist
 
 Thomas
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Forcing a dynamic created text file to be saved

2001-04-10 Thread Lindsay Adams

You are not going to be able to use PHP to tell the client browser to do
anything.

you are going to have to embed either a java.applet, or javascript to do it.
I dont know a whole lot about either, so I don't know if they are even a
possibility.

On 4/10/01 2:29 PM, "Nando2" [EMAIL PROTECTED] wrote:

 Hello all!
 
 I have a PHP4 script that produces a text file and I would like that when the
 user access this script the text content of it was forced to be saved meaning
 that when the user selects it he/she will have the save dialog form to save
 the text file with the filename specified in the header function. So far I
 have managed to create the text file dynamicaly but still I have to click the
 browser's save button to save the file with the determined filename. I wanted
 it to be forced.
 
 Does anyone know how to do it ?
 
 Here's the code :
 
 ?php
   
   // Carlos Fernando Scheidecker Antunes : Test saving text files with PHP
   // this sets the content type as being plain text
 
   header("Content-Type : text/plain; charset=\"iso-8859-1\"");
   
   // this sets the file name
 
   header("Content-Disposition: filename=\"test.txt\"");
 
   // creates the dynamic content of the text file here
 
   print("TextFile test\r\n\");
   for ($i=1; $i  100; $i++) {
   print("This is line number ".$i."\r\n");
   }
   
 ?
 
 Thanks,
 
 Carlos Fernando Scheidecker Antunes
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Forcing a dynamic created text file to be saved

2001-04-10 Thread Lindsay Adams

I stand happily corrected :)


On 4/10/01 7:01 PM, "Stuart J. Browne" [EMAIL PROTECTED] wrote:



 
 "Lindsay Adams" [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 You are not going to be able to use PHP to tell the client browser to do
 anything.
 
 you are going to have to embed either a java.applet, or javascript to do it.
 I don1t know a whole lot about either, so I don't know if they are even a
 possibility.
 
 On 4/10/01 2:29 PM, "Nando2" [EMAIL PROTECTED] wrote:
 
 Hello all!
 
 I have a PHP4 script that produces a text file and I would like that when
 the
 user access this script the text content of it was forced to be saved
 meaning
 that when the user selects it he/she will have the save dialog form to
 save
 the text file with the filename specified in the header function. So far I
 have managed to create the text file dynamicaly but still I have to click
 the
 browser's save button to save the file with the determined filename. I
 wanted
 it to be forced.
 
 Does anyone know how to do it ?
 
 Here's the code :
 
 ?php
 
   // Carlos Fernando Scheidecker Antunes : Test saving text files with PHP
   // this sets the content type as being plain text
 
   header("Content-Type : text/plain; charset=\"iso-8859-1\"");
 
   // this sets the file name
 
   header("Content-Disposition: filename=\"test.txt\"");
 
   // creates the dynamic content of the text file here
 
   print("TextFile test\r\n\");
   for ($i=1; $i  100; $i++) {
   print("This is line number ".$i."\r\n");
   }
 
 ?
 
 
 try:
 
 header("Content-Type: unknown/unknown");
 
 browswer won't know what type of file it is, so will prompt to save.. should
 get the file-name right from the other.
 
 bkx
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Where to get php_pdf.so?

2001-04-09 Thread Lindsay Adams

I too, am trying to get this module, so that it will load with dl()

On unix, it is libpdf.so

So, if anyone can answer me this:
How do you compile a module under unix/linux for use with dl()?

Anyone, anyone?
Fry? Fry? Fry?
(sorry, little ferris buehler ref there.)



On 4/8/01 7:00 PM, "Jochen Kaechelin" [EMAIL PROTECTED] wrote:

 Where can I get a php_pdf.so file
 for trying the dl-function on our server?
 
 I locally use a Win-System and therfore only
 have a php_pdf.dll!
 
 --
 Jochen Kaechelin - Ihr WEBberater
 Stuttgarter Str.3, D-73033 Goeppingen
 Tel. 07161-92 95 94, Fax 07161-92 95 98
 http://www.wa-p.de, mailto:[EMAIL PROTECTED] 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Count function. (Newbie Question)

2001-04-09 Thread Lindsay Adams

Well, in this code, you are going to receive one line from your table that
displays the total number of records. And that is it. Here is a sample from
one of my tables, using the MySQL CLI:

mysql select count(*) from locker;
+--+
| count(*) |
+--+
|   47 |
+--+
1 row in set (1.65 sec)



If you can be a little more specific about what you want, maybe type up what
you expect out, we can fix your query statement.


Also, in this line:
 b?php echo $record_count ? /b/font

You should put a ';' after the variable, just to save yourself the hassle of
a parse error, when you get working code.

On 4/9/01 9:32 AM, "Michael O'Neal" [EMAIL PROTECTED] wrote:

 Hi,
 
 I'm trying to display a record count of some sort on a page I'm working
 on.  For example, "Record 1 of 15".  I can display the 1st number ok, but
 I'm a bit confused on what the count function should look like for the
 2nd number (15, in this case).  Here is my current (not working) code.
 
  ?php
 
   $query = "SELECT count(*) FROM mango_pr";
   $result = mysql_query($query);
   $record_count = mysql_fetch_row($result);
 
 
 ?
 
 
 And then I'm calling the code with an "echo"  later on:
 
 b?php echo $record_count ? /b/font
 
 
 This obviously isn't right...can anyone offer any suggestions?
 
 Thanks,
 
 mto
 
 
 
 Michael O'Neal
 Web Producer/ Autocrosser
 ST 28 '89 Civic Si
 -
 M   A   N   G   O
 B  O  U  L  D  E  R
 -
 http://www.thinkmango.com
 [EMAIL PROTECTED]
 p-303.442.1821
 f-303.938.8507
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] sockets

2001-04-09 Thread Lindsay Adams

No, your problem is most likely that you didn't do anything with the telnet
negotiation phase.

Read the RFC on telnet, and you will find that there is a whole
client-server negotiation phase going on. Kinda like a modem handshake.
It is really quite difficult, and no one has ported a Telnet class to PHP
yet. (big big task)

There is a Net::Telnet class in perl that I ended up using to write a script
to do something similar, and pass results back to the php script that called
it.

Telnet is simply not as easy as opening a socket. If you don't send the
right set of characters as the first block, it won't work.


On 4/9/01 10:16 AM, "Matthias Winkelmann" [EMAIL PROTECTED] wrote:

 Hi!
 
 I'm trying to speed up a big application by splitting it into a codebase
 acting as a server and the actual scripts communicating with the server
 using sockets.
 
 I got the server working, at least it works when I send a request via
 telnet. When I try to let a script act as the client I get no response. I
 think the problem is the length parameter in the read()-function.
 Not all requests and results are 2048 bytes, but I have no idea what to use
 as a delimiter instead.
 Here are the scripts so far:
 
 Server:
 
 // Socket was created, bind  listen executed
 do {
   if (($msgsock = accept_connect($sock))  0) { // wait for request
   echo "accept_connect() failed: reason: " . strerror ($msgsock) .
 "\n";
   break;
   }
   do {
   $buf = '';
   $ret = read ($msgsock, $buf, 2048); // read request
   echo "request: $ret br";
   if ($ret  0) {
   echo "read() failed: reason: " . strerror ($ret) . "\n";
   break 2;
   }
   if ($ret == 0) {
   break 2;
   }
   $buf = trim ($buf);
 
   $talkback = eval($buf);//
 request verabeiten
   write ($msgsock, $talkback, strlen ($talkback)); // write result to
 socket
   echo "$buf\n";
   } while (true);
   close ($msgsock);
 } while (true);
 
 
 
 Client:
 
 
 // Socket was created; submitting request
 
 write ($socket, $in, strlen ($in));
while (read ($socket, $out, 2048))  // reading response. what if
 the response is  2048 bytes?
  {
  echo $out;
  }
 
 
 As I said: The server works perfectly using telnet, but the script-client
 does not give any output, allthough the connection was created successfully.
 
 Thanks in advance for any answers. I hope I was able to describe the problem
 well enough.
 
 Matt
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Count function. (Newbie Question)

2001-04-09 Thread Lindsay Adams

Ya know, you don't even have to go that far.

Now thati know more what you were looking for, after submitting a query
like: SELECT * FROM table

You will get all the data in your table.

In php, you will have a $result to access that array of data
(mysql_fetch_array(), mysql_fetch_row(),mysql_fetch_object() )

Using php, $number_of_records = mysql_num_rows_affected($result);
Will return the number of records retrieved, in this case, the total amount.
Don't need two queries, don't need put the count() function in the query.

There are a lot of pieces of information regarding your query, that can be
returned, without additional queries or extra statements in mysql.

Take aminute to look at the names of ALL the mysql functions in PHP
http://www.php.net/manual/en/ref.mysql.php





On 4/9/01 10:30 AM, "Dell Coleman" [EMAIL PROTECTED] wrote:

 No, this is different - try
 
 $query = "SELECT id,count(*) as result_count FROM mango_pr";
  $result = mysql_query($query);
  $row = mysql_fetch_array($result);
  $id=$row['id'];
  $result_count=$row['result_count'];
 
  echo "$id,$result_count";
 
 
 You might need to make the form action=$PHP_SELF  if you want the form to
 loop
 
 Also you can use a progream structure like
 
 if ($submit) {
 // validate and update  new stuff
 }
 else
 {
 // display the form action=$PHP_SELF
 }
 
 to display and validate the form
 
 -Original Message-
 From: Michael O'Neal [mailto:[EMAIL PROTECTED]]
 Sent: Monday, April 09, 2001 9:53 AM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP] Count function. (Newbie Question)
 
 
 Hi
 
 There are 2 issues:
 
 You need to maintain a page counter
 
 You need to pass the page counter and the total page count from page to
 page
 
 You can do this via url params
 (xxx.html?page=$page_countrecord_count=$record_count), sessions or cookies
 depending
 
 HTH
 
 
 Let me elaborate a little bit more.  I don't think I explained myself
 very well.  Sorry to waste the bandwidth.
 
 I am building a little press-release administration for our sales
 department.  There is a single page that contains form fields where they
 can input thier data.  I want the users/admins to be able to see what
 record number they are editing, and how many total records there are in
 the db.  I have figured out the record number by echoing the "ID" of the
 record.  I can't figure out how to display how many *total* records there
 are in that db.  Does your tip still apply?
 
 Thanks again,
 
 mto
 
 Michael O'Neal
 Web Producer/ Autocrosser
 ST 28 '89 Civic Si
 -
 M   A   N   G   O
 B  O  U  L  D  E  R
 -
 http://www.thinkmango.com
 [EMAIL PROTECTED]
 p-303.442.1821
 f-303.938.8507
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] .htpasswd encryption

2001-04-09 Thread Lindsay Adams

It can really depend on your system.

On mine, for instance, it uses regular crypt() with a 2 character salt
So, you can generate a random 2 character string to pass as the salt
argument in php, and create it that way.
IF that is the method used by your system

Wanna test it?

Peek inside etc/passwd and copy out the encrypted string that represents
your password.

Take the first two characters of that string and use that as the salt on
your test page. (say for instance the salt is xT)

In your test page, use the following code

? Echo crypt("your unencrypted password"."xT"); ?

That's all you need.
Call it from your browser.
Is the encrypted value the same as in etc/passwd?
If so, then crypt is what you use for .htpasswd file

You can also check against an existing .htpqsswd entry, if you exist in an
.htpasswd file on your system.


On 4/9/01 1:39 PM, "Kurth Bemis" [EMAIL PROTECTED] wrote:

 At 04:39 PM 4/9/2001, Brandon Orther wrote:
 
 i believe that the scheme is md5
 
 ~kurth
 
 Hello,
 
 I am trying to make a script that creates .htpasswd files.  Does anyone know
 what encryption is used?
 
 Thanks
 Brandon
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] sockets

2001-04-09 Thread Lindsay Adams

well, if they did, and they made a full telnet class, then great!! give us
all the class!!

BUT, if they wrote their own socket listener, essentially their own
protocol, then it would work.

but if you are using sockets to connect to a real telnet server (as it were)
then you MUST have the negotiation part.

http (port 80) is just raw socket transport. telnet (port 23) is not.
so, communication like you want is possible, just don't count on a real
telnet connection right yet.

On 4/9/01 3:27 PM, "Matthias Winkelmann" [EMAIL PROTECTED] wrote:

 
 
 -Original Message-----
 From: Lindsay Adams [mailto:[EMAIL PROTECTED]]
 
 No, your problem is most likely that you didn't do anything with
 the telnet
 negotiation phase.
 [..]
 
 That doesn't sound very encouraging :-(
 
 Anyway, I got that idea of splitting an application into a codebase
 listening on a port and a frontend connecting with it in the zend tips
 section http://www.zend.com/tips/tips.php?id=169single=1 .
 
 It seems as if somebody got it to work (in 15 min as he writes).
 Unfortunately, I couldn't find his email adress anywhere. Therefore: If
 anybody has done this before, has an idea how it could work or knows this
 author 'npeen', it could really save me a lot of time.
 
 Thanks for all ideas,
 
 Matt
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] putting a list of data into 3 columns?

2001-04-09 Thread Lindsay Adams

okay. your solution is not going to scale well, is it. if you have more than
nine items, you have to rewrite your code.

here is what I did:
I created this table in mysql from the command line as follows:
mysql create table  tabletest (
- id int unsigned primary key not null auto_increment);
Query OK, 0 rows affected (0.47 sec)

mysql desc tabletest;
+---+--+--+-+-++
| Field | Type | Null | Key | Default | Extra  |
+---+--+--+-+-++
| id| int(10) unsigned |  | PRI | 0   | auto_increment |
+---+--+--+-+-++
1 row in set (0.73 sec)

mysql insert into tabletest values  (NULL),(NULL), (NULL), (NULL), (NULL),
(NULL), (NULL),(NULL);
Query OK, 8 rows affected (0.48 sec)
Records: 8  Duplicates: 0  Warnings: 0

mysql select * from tabletest;
++
| id |
++
|  1 |
|  2 |
|  3 |
|  4 |
|  5 |
|  6 |
|  7 |
|  8 |
++
8 rows in set (0.29 sec)

Then, I copy and pasted the script I wrote earlier to the list, made some
changes to match the database and got this:

?


$link=mysql_connect();
mysql_select_db('tester',$link);
$query = 'SELECT* FROM tabletest';
$result = mysql_query($query,$link);

print EOF
html
head
/head
body
table width="400" border=1
EOF;

while(list($id)=mysql_fetch_row($result)) {
$items[]=$id;
}
reset($items);



For($i = 0; $i (count($items)/3); $i +=1){

printf("trtd%s/tdtd%s/tdtd%s/td/tr",$items[$i],$items[$i+3],
$items[$i+6]);
}

?
/table/body/html

I put that into tabletest.php
view results at www.dingos.net/test/tabletest.php

this script will scale to ANY size listing. Here, the 3 stands for number of
columns. it can easily be cleaned up so that the number of columns is
dynamic, and I am sure there is a cleaner way of doing multiple columns,
without putting all the database stuff into an array, BUT, this shows you
how the code works, and what it looks like


On 4/9/01 3:06 PM, "DRN" [EMAIL PROTECTED] wrote:

 
 Lindsay Adams [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 | This is exactly what I sent you.
 | You have to realize that you can't print down one column, and then
 start a
 | new one.
 | You have to print across, left to right before you go down.
 | You have to modify the print statement to put it into a table, but
 that is
 | easy:
 |
 
 I have been playing about with this problem and I have come up with
 the following code. I know it is not right, because it isn't working
 :) but I think it is nearly what I want to do. I only want to have 3
 cells in the table, with a third of the data in each.
 
 Cheers for your help, Donald
 
 ? $db = mysql_connect("localhost", "user","pass");
 mysql_select_db("database",$db);
 
 $query = "SELECT * FROM TYPES";
 $result = mysql_query($query);
 $num_rows = mysql_num_rows($result);
 
 if ($result){
$i=0;
 echo "table border=1\ntr\ntd width='30%'";
 $r = mysql_fetch_array($result);
 $type_name = $r["type_name"];
 
 while ( $i  ($num_rows/3) ){
echo "$type_name[$i] br\n"; $i++;
 }
 echo "/tdtd width='30%'\n";
 while ($i = (2*$num_rows/3) ){
echo "$type_name[$i] br\n"; $i++;
 }
 echo "/tdtd width='30%'\n";
 while ($i = $num_rows ){
echo "$type_name[$i] br\n"; $i++;
 }
 echo "/tr/table\n";
 
 } else {
 echo " sorry no data found ";
 }
 ?
 
 
 --
 Cheers,  Donald  :)
 __
 As well as learning more,
 I learn that there is even more I don't know
 
 http://www.donaldrnoble.f2s.com
 
 
 




Re: [PHP] huge PHP file, hardcore processing

2001-04-09 Thread Lindsay Adams

On 4/9/01 6:38 PM, "Christian Dechery" [EMAIL PROTECTED] wrote:

 At 10:23 10/4/2001 +0900, you wrote:
 IIS ISAPI(PHP4.0.4pl1 and PHP4.0.5RC1) does not work well for me and too many
 problems. So I switched to Apache. However, ob_implicit_flush() seems slows
 things down on W2K/Apache/PHP4.0.4RC1 also. (ob_implicit_flush() may slow
 things
 down, but it's more apparent than my Linux/Apache box)
 
 You may get better result on UNIX/Apache.
 
 Someone mentioned he/she does not have any problem with W2K/IIS
 ISAPI/PHP4.0.3pl1 with more than 250,000 hits/day. You may want to down grade
 your PHP to 4.0.3pl1.
 
 but how can I access an MS SQL database from Apache???
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer
 
with PHP

Apache/PHP combo will run just fine on Windows, and you should be able use
PHP's ODBC functions to access Access databases.

see: http://www.php.net/manual/en/ref.odbc.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] while loop

2001-04-09 Thread Lindsay Adams


On 4/10/01 6:22 AM, "Jacky" [EMAIL PROTECTED] wrote:

 Hi people
 I am more like ASP programmer and new to PHP, In ASP, when we want to take all
 records in dayabase to display. After we did  do the query, we call " Do while
 not RS.EOF ( mean do while not end of record file) , and display record
 accroding to the query.
 Is there anything that do teh same in PHP??
 cheers
 Jack
 [EMAIL PROTECTED]
 "There is nothing more rewarding than reaching the goal you set for yourself"
 


sure, 

while ($row = ODBC_fetch_into($result) {}

will loop through every result record found, putting the contents of each
record into an array, $row.

see the www.php.net/manual

for a general overview of the language


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] [PHP4] mod_php4, not compatible with Apache version?

2001-04-08 Thread Lindsay Adams

Did you install php as a DSO? Or compile it into apache.
I was getting that error too, because I had installed it as an APXS DSO and
had unnecessarily included the line AddModule 'mod_php4.c' (not exact syntax
here)

After removing the AddModule line, and only using LoadModule php4_module
'path/to/libphp4.so', it worked fine.

On 4/8/01 10:39 AM, "Enrique de las Heras" [EMAIL PROTECTED] wrote:

 Yesterday I installed php 4.0.4pl1 with Apache 1.3.19. All the
 installation process was OK, but when I tried to restart the Apache
 Server the apachectl command failed with this error:
 
 httpd: module "mod_php4.c" is not compatible with this version of
 Apache.
 Please contact the vendor for the correct version.
 ./bin/apachectl start: httpd could not be started.
 
 I have reinstalled Apache and php 4.0.4pl1,  but I keep on getting this
 same annoying error.  Can anyone hellp me?
 
 Thanks a lot.
 
 
 
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mail() limit? Use aliases table [typo]

2001-04-08 Thread Lindsay Adams

Sorry, this:

 
 BTW, the format for an alias file is:
 
 addr1, addr2, addr3
 
 OR
 
 should read
... The format for a mailing list file is:
...


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Pop Up Window

2001-04-08 Thread Lindsay Adams

Weird.
My netscape 4.7x does not do this under the same circumstances.
(tried 4.7 4.75, 4.76, 4.77)


On 4/8/01 1:33 PM, "Claudia" [EMAIL PROTECTED] wrote:

 Is there a way to initiate a pop up window containing a form using PHP code?
 
 I am trying to use Javascript to popup a window which contains a form.
 The form is processed via a PHP script. (miniquote.scp.php3)
 The popup window displays OK.  The form processes OK in IE 5.0 however using
 NS 4.7 I receive this error:
 
 "Warning there is a possible security hazard here...opeing
 miniquote.scp.php3 using php.exe"  "When you download a file from the
 network, you should be aware of security considerations" "A file that
 contains malicious programming instructions could damage"You should only
 use files obtained from a site that you trust"
 
 The issue is with Javascript as I can use the same code in a html window
 with no errors.
 
 Any ideas on how to get around this error would be appreciated!
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mail() limit? Use aliases table

2001-04-08 Thread Lindsay Adams

No, I use my manual lists without a problem.
If I ever have to install on a system that does not allow normal use of an
alias table by a normal user, then I might try something else.

But under my resellers account on AIT, I get to do whatever I want with
aliases, and the lists work find =)

I would not be able to install qmail on my ISP, so that is not an option
either.

So, my solution works great for me, I have my own administrative routines in
PHP for adding aliases, writing lists, and storing the master data in mysql
databases. It all works cleanly without a hitch.

If it ain't broke, don't fix it ;)

Cheers!
lindsay


On 4/8/01 2:18 PM, "Manuel Lemos" [EMAIL PROTECTED] wrote:

 Hello Lindsay,
 
 On 08-Apr-01 16:14:00, you wrote:
 
 If you have access to /etc/aliases, this makes your code much easier
 
 It works but it requires that you have root permissions and use the real
 sendmail program and not another wrapped mailing system.
 
 For bulk mailing, like for mailing lists, qmail is better.  You just pass
 the sender and all recipient addresses one per line to qmail-send and it
 will inject a single message into the delivery queue.  You do not need root
 permissions.
 
 As a good mailing list program you can use ezmlm that takes advantage of
 special features of qmail that other mailing systems don't have like the
 VERP extension that lets you figure exactly who is bouncing your messages
 and QMQP server that lets you handle mailing list delivery queues without
 choking your SMTP server.
 
 Maybe you would like to try this PHP application that lets you manage
 ezmlm mailing lists via the Web:
 
 http://phpclasses.UpperDesign.com/browse.html/package/177
 
 
 Regards,
 Manuel Lemos
 
 Web Programming Components using PHP Classes.
 Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
 --
 E-mail: [EMAIL PROTECTED]
 URL: http://www.mlemos.e-na.net/
 PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
 --
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] HTML table to MySQL?

2001-04-08 Thread Lindsay Adams

If you are sucking the scores off someones website, so you can put them into
a database (you should first get permission from site owner ;) )

But the process would be as follows in pseudo code (can't be done with just
SQL commands, btw.)

Get page
Find beginning and end of table, strip off everything before and after.
Find each row
within each row find each set of td/td tags and put information
between into a variable or reference

Repeat for each row, storing your column data into an array or something.

When done,
Loop through result array and build SQL INSERT string
Execute SQL statement

That's the code.
It is going to require heavy use of regualr expressions and backreferences
inside those expressions.

Now, you just have to choose a programming language with powerful regex
capability (see Perl or PHP, PHP easier to learn for novice probably)

On 4/8/01 4:30 PM, "Scott VanCaster" [EMAIL PROTECTED] wrote:

 How would one go about getting each element from an HTML table to a
 database?  The HTML will be the source code from a games site score report
 pasted into a form.  I'm just learning, so don't waste you're valuable time
 explaining every detail of how this can be done, but if someone can point me
 in the right direction or a web site detailing something similar it would be
 appreciated.  I can come back here with more specific questions once I've
 learned enough to know what to ask and understand the answers :)
 
 Thanks.
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] anything wrong with php.net?

2001-04-08 Thread Lindsay Adams

It is up just fine.
Try one of the mirror addresses as a backup
Like:
http://php.he.net

On 4/8/01 5:07 PM, "Kath" [EMAIL PROTECTED] wrote:

 Can you traceroute it?  Maybe that can pinpoint the cause of the problem for
 you.
 
 Works for me.
 
 - Kath
 
 - Original Message -
 From: "Christian Dechery" [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, April 08, 2001 8:02 PM
 Subject: [PHP] anything wrong with php.net?
 
 
 Is there anything wrong with www.php.net?
 
 I can't access it for two days now...
 
 . Christian Dechery (lemming)
 . http://www.tanamesa.com.br
 . Gaita-L Owner / Web Developer
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Inputing data to a relational database

2001-04-08 Thread Lindsay Adams

Not that I am aware of, because all the referential integrity relating to
mysql, is in whatever code you write to access it. So you are going to have
to use C,Perl,PHP,Python, or something to access your data, and control
integrity.

Play with mysql queries in php. As long as you only do selects, you can't
damage the table.

When you understand how to send the query from php - mysql, then you can
build your insert queries and such, and not worry too much.

Php really is easy in this respect, and every PHP book that I have looked at
gets you to the point of using mysql really quickly.

There are also plenty of tutorials on the net.
See the php links page on php.net


On 4/8/01 5:11 PM, "Nathan Roberts" [EMAIL PROTECTED] wrote:

 I am a nebie to Mysql/php and am currently working on an urgent project, a
 on-line catalogue. I have been using phpmyadmin, to create the tables in
 MySQL. However I now want to add data into the tables. I am reluctant to
 program a php page to do this, as I do not (yet) have sufficient php
 knowledge. As far as I can see phpMyadmin doesn't do all I need it to, which
 is:-
 
 The tables reference each other, for example
 
 The categories are stored in a categories table
 The products table includes a field category
 
 to ensure referential integrity, when adding a product to the products
 table, I want to have a combo box that will let me select one of the
 categories from the categories table.
 
 Is there anything like phpmyadmin that will let me do this without me having
 to write code.
 
 Any advice much appreciated
 
 Nathan Roberts
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] putting a list of data into 3 columns?

2001-04-07 Thread Lindsay Adams

Assuming your items are in an array
$items =array() //assume a bunch of items in this array
For($i = 0; $i (count($items)/3); $i +=1){
printf("%s\t%s\t%s",$items[$i],$items[$i+3],$items[$i+6]);
}

Should print 3 columns of tab separated text.
Note: typed this quickly, untested, but the theory is sound. Might have to
twiddle the $i(count... Section.

If you have 8 itesm, as shown and you divide by 3 you get 2.xx
So, the the loop will print out:

$items[0]   $items[3]   $items[6]
$items[1]   $items[4]   $items[7]
$items[2]   $items[5]   $items[8}
// because $items[8] doesn't exist, it won't print.
// if it spits out an error there, put a @in front of printf to turn off
error reporting.


On 4/7/01 11:58 AM, "Jack Dempsey" [EMAIL PROTECTED] wrote:

 You don't need to count...in your loop you can do something like this:
 if($current_pos%3==0){//then you're at a multiple of three
 //code to start new column here
 }
 
 -jack
 
 -Original Message-
 From: DRN [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, April 07, 2001 2:55 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] putting a list of data into 3 columns?
 
 
 Hi,
 I would like to display a list of products from a MySQL database in 3
 columns. as shown below:
 
 Product A  Product D  Product G
 Product B  Product E  Product H
 Product C  Product F
 
 The problem I have is I don't know how many products there will be, so
 I can't just print out the first 3, start new column, print out next
 three, start new column, print out rest, end table.
 
 I presume I will have to count the number of results, then use this to
 wok out how many have to go in the first column etc.
 
 As I have only recently started using PHP / MySQL I am not sure how
 this should be done, has anybody done this (or something similar) so
 that I could look at the relevant code.
 
 Many thanks for your help, Donald
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] AUTO_INCREMENT with MySQL phpmyadmin

2001-04-07 Thread Lindsay Adams

I don't know why your query isn't working, but why aren't you using
phpMyAdmin's add field section?

Browse the tables definition page, and underneath the column descriptsion,
is a line that says Add new fields [textbox: #][popup:At End of
Database][button: Go]

That brings up a fully functional column add page.

Unless your permissions don't allow you to alter tables? Double check that.

On 4/6/01 10:35 PM, "Plutarck" [EMAIL PROTECTED] wrote:

 At first I thought this might be better suited on the mysql list, but since
 I'm using phpmyadmin I thought it better to ask here.
 
 My problem is I can't figure out how to create a column with the
 auto_increment attribute. I want to make one called userid whose value is
 one higher than the highest number in the userid column, which according to
 the manual is exactly what auto_increment should do.
 
 But I flat out can't figure out how to do it.
 
 I'm using the "add new field" attribute in phpmyadmin, and I've tried making
 one with no name and with many different names, and I don't get nuttin'.
 
 Occassionally it will announce that the table was altered with something
 like the message:
 
 SQL-query:
 ALTER TABLE test_kingdoms_userauth ADD useridi TINYINT not null
 AUTO_INCREMENT
 
 But according to the display, no matter how many times I refresh it, there
 is no listing of ANY column other than the two I currently have.
 
 So I'm totally confused, and out of the whole mysql manual I just don't know
 what's wrong.
 
 
 So the question:
 
 What kind of selections do I need to make to create an AUTO_INCREMENT
 column?
 
 
 
 --
 Plutarck
 Should be working on something...
 ...but forgot what it was.
 
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] putting a list of data into 3 columns?

2001-04-07 Thread Lindsay Adams

This is exactly what I sent you.
You have to realize that you can't print down one column, and then start a
new one.
You have to print across, left to right before you go down.
You have to modify the print statement to put it into a table, but that is
easy:

Print should be:
printf("trtd%s/tdtd%s/tdtd%s/td/tr",$items[$i],$items[$i+3],
$items[$i+6]);

That will print your 3 columns in a table.
And it is essentially identical to to what I sent. Just have to modify the
format of the printf statement.

You can also do it in a regular print statement:

Print("trtd$items[$i]/tdtd$items[$i+3]/tdtd$items[$i+6]/td/tr
\n");


Or how about a here doc for php4
Print EOF
trtd$items[$i]/tdtd$items[$i+3]/tdtd$items[$i+6]/td/tr\n
EOF

The for loop stays the same, only the print statement changes.

Lindsay Adams
---



On 4/7/01 4:55 PM, "DRN" [EMAIL PROTECTED] wrote:

 
 Lindsay Adams [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 | Assuming your items are in an array
 | $items =array() //assume a bunch of items in this array
 | For($i = 0; $i (count($items)/3); $i +=1){
 | printf("%s\t%s\t%s",$items[$i],$items[$i+3],$items[$i+6]);
 | }
 |
 | Should print 3 columns of tab separated text.
 | Note: typed this quickly, untested, but the theory is sound. Might
 have to
 | twiddle the $i(count... Section.
 |
 | If you have 8 itesm, as shown and you divide by 3 you get 2.xx
 | So, the the loop will print out:
 |
 | $items[0]   $items[3]   $items[6]
 | $items[1]   $items[4]   $items[7]
 | $items[2]   $items[5]   $items[8}
 | // because $items[8] doesn't exist, it won't print.
 | // if it spits out an error there, put a @in front of printf to turn
 off
 | error reporting.
 |
 |
 | On 4/7/01 11:58 AM, "Jack Dempsey" [EMAIL PROTECTED] wrote:
 |
 |  You don't need to count...in your loop you can do something like
 this:
 |  if($current_pos%3==0){//then you're at a multiple of three
 |  //code to start new column here
 |  }
 | 
 |  -jack
 | 
 
 Neither of these were quite what I was looking for, I was hoping I
 could make a table with 3 td's side by side, each having a third of
 the list of products (with br between them).
 Is this possible? If not I will try to adapt one of these methods.
 
 Cheers for your help, Donald
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] unable to run lynx from exec or passthru

2001-04-07 Thread Lindsay Adams

Most likely, lynx is not in the PATH of the user that the webserver is
running as, and may not have permission, if it was.

Try telneting in and finding the absolute pathname to lynx, and user that in
your exec statement and see what happens. Might also help if you redirected
stderr to a file so you could read the error that it encounters when you try
to exec lynx in a script.




On 4/7/01 10:15 PM, "Junaid MAnsoor" [EMAIL PROTECTED] wrote:

 Hi!
 
 i have php as an apache mod. i want to exec lynx from php. but when i have
 typed the following command
 
 exec("lynx http://mywebsite.com");
 
 OR
 passthru("lynx http://mywebsite.com");
 
 
 
 
 it simply does not show any output, just a blank page. I think its the prb
 of permission. Please help me how can i configure it to work for me.
 
 Junaid Mansoor
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Extension_dir in php.ini?

2001-04-06 Thread Lindsay Adams

Okay, you may call me an idiot all you want,
But if the extension_dir= ./
In php.ini
And PHP is loaded as an apxs module in apache, then just where does ./ point
to?

ServerRoot?
DocumentRoot?
Some other directory?

Having a major brain  in getting my .so into the right place.

Also, how can I compile libpdf.so (version 3) to work with PHP4.0.4pl1?

If I have to go backwards in PHP (say to 4.0.3pl1) to be able to get PDF
support compiled into PHP (because it just isn't working for me on 4.0.4pl1)
then somebody please tell me that.

I have read through all the suggestions in the list archive
I have downloaded the latest versions of files pertaining to pdf and
4.0.4pl1 from cvs.php.net and yet, I still get the problem, during
./configure, of it complaing about my version 3 pdflib, not being version 3
because it can't find pdf_show_boxed().

I _NEED_ pdf support, so any help in choosing the right set of versions
would be greatly helpful!

Thanks gang!

Ps- yes, I also changed ext/crypt.c php_srand... On line 150(or thereabouts)
to make php work at all on my box (Qube2)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Close Window script

2001-04-06 Thread Lindsay Adams

This is offtopic, but easy

User javascript
Make your link =
a href="javascript:window.close();"linked item /a

If you are wanting to do it with PHP, stop.
PHP is server side only
http is connectionless, the server can't tell the client to close it's
window.

On 4/6/01 11:45 AM, "Wee Chua" [EMAIL PROTECTED] wrote:

 Hi all,
 Can anyone tell me how to write a script to close the current opened window
 with hyperlink? Thank you.
 
 Calvin Chua
 Systems Analyst
 InterClean Equipment, Inc.
 734-975-2967
 www.InterClean.com
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] scramble the code-sneaky solution

2001-04-05 Thread Lindsay Adams

If you don't want to rewrite any of your existing code, consider the
behavior of frames.
If you make a frameset with a 0 height for the top frame, and then use the
bottom frame for everything, then the URL in the location/address bar in the
browser will not ever change.

This only requires that you create a frameset as your default page, and
rename your old default page. (don't forget to create a blank page for that
invisible top frame, or you will get a no data present or file not found
error, and your user won't know why)

While this won't prevent people from seeing the code if they open the lower
frame in a new window, but they probably won't think of it.

This is a fast solution, not necessarily ideal, but, you can do some
weird/interesting things by periodically hiding data in that hidden frame.





On 4/5/01 8:36 AM, "maatt" [EMAIL PROTECTED] wrote:

 Save yourself the scramble, use sessions:
 http://www.php.net/manual/en/ref.session.php
 
 --
 Matt Kynaston
 remove the green eggs before replying
 
 ""Scott Fletcher"" [EMAIL PROTECTED] wrote in message
 9ai09g$9d$[EMAIL PROTECTED]">news:9ai09g$9d$[EMAIL PROTECTED]...
   I see it!  The login page when use the html form, the action is the
 $PHP_SELF, allowing hte page to refresh itself and then the following
 script
 elsewhere check for the variable to see if it is true or not.  If true
 then
 the script use the php header();.  The header contain the data, so that
 explain why it display the data in the URL.  The data in the URL doesn't
 include the data from the login page.
 
   Thanks for the clarification! Now I'll give it a shot in scrambling one
 of
 the variable data that come with the header and then unscramble it on the
 next page.
 
 Scott
 
 ""Scott Fletcher"" [EMAIL PROTECTED] wrote in message
 9ahvj6$m67$[EMAIL PROTECTED]">news:9ahvj6$m67$[EMAIL PROTECTED]...
 Um, well, it show up on Internet Explorer and Netscape Navigator and
 Netscape.  Oh well.
 
 Scott
 
 ""Scott Fletcher"" [EMAIL PROTECTED] wrote in message
 9ahuft$612$[EMAIL PROTECTED]">news:9ahuft$612$[EMAIL PROTECTED]...
 Well, mine does!!!
 
 Scott
 
 ""Joe Sheble (Wizaerd)"" [EMAIL PROTECTED] wrote in
 message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 This isn't quite accurate.  WHen a form's method is set to "GET"
 (which
 BTW
 is the form's default method) the variables and their values are
 passed
 along the URL.  If your form's method is set to "POST" then nothing
 should
 get passed along on the URL.  If you see all your data in the URL,
 you're
 not using a POST method or the forms action is specified as a url
 with
 parameters.
 
 At 09:06 AM 4/5/01 -0400, Scott Fletcher wrote:
 For the data in the "post", when the user type in the data and
 press
 the
 submit button, the data is then carry over to the nextpage.html.
 In
 the
 URL
 bar, I can clearly see the data, so is there to scramble hte data
 where
 anyone won't see it in the URL box at the top of the web browser?
 Thanks,
  Scott
 
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] scramble the code -sneaky solution (redux)

2001-04-05 Thread Lindsay Adams

By the way, I use the hidden frame solution, when I want to pass a bunch of
info in an A tag, without building a bunch of different forms on the page.

This was the easiest way for me to do it, in PHP3. PHP3 was all that I could
get installed on a Qube2 at the time of install.

I am working on getting 4.04pl1 on my Qube2, but, the hidden frame trick is
still quite handy ;)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] /etc/shadow

2001-04-05 Thread Lindsay Adams

Yeah, crypt()
Don't forget the salt.

I did the same thing.
Moved all my users into a database table with unix encrypted passwords, and
run a function that dumps them all out to my /etc/passwd file.
It appends the database data onto a passwd.base file that I made, that
includes all the protected system accounts.

Of course, I only run this from a secure server, only one user with a very
long and obscure userid and password can access that database in any way, no
one else can telnet in, and the database can not be accessed of the net, and
I used every other form of page authorization I could manage to put in,
prior to getting to the page that does all this.

Including Alias/ScriptAlias directives to move the files out of the
DocumentRoot.

And again, don't forget to generate a random salt argument.


On 4/5/01 10:36 AM, "Diogo Saad" [EMAIL PROTECTED] wrote:

 Is there a function that encrypts a string the same way the shadow file
 does???
 What I wanna make is a page that changes my unix account password 
 
 Thanx
 
 
 ___
 Diogo Saad
 [EMAIL PROTECTED]
 Inter Business Tecnologia e Servios.
 
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Include / Require

2001-04-05 Thread Lindsay Adams

On 4/5/01 10:56 AM, "Ashley M. Kirchner" [EMAIL PROTECTED] wrote:

 
   I have a DB project going and every time I query the DB for data
 from a particular table, I want to include a set of variables (that get
 set based on the query result).  I was thinking of doing something like
 this:
 
   $sql = "..."
   $result = ;
   include 'variables.php?table=$table';
 
   However, every time I try that, it tells me it can't find
 'variables.php'.  However, if I rename the file to 'variables.inc', it
 does find it (though it doesn't pass any arguments to it then).
 
   The first method tells me it's not in the include path.  Okay,
 easily fixable in php.ini, however, I don't want this extra path info to
 apply to the whole server (which is running several vhosts).  How can I
 adjust the include path just for this particular vhost?
 
   Or, is there a better way to do what I'm trying to accomplish?  Make
 it a function perhaps?  A call that would look kinda like this perhaps:
 variables($table) ?  But then, how do I get to the actual variables?
 
   AMK4
 

Ashley,

You don't really need to pass the values in your include.
All that include does is insert the file inine, as if it was written there.

So, leaving out the table=$table will still result in $table being defined
by the code prior to the include.

Ie.
$table="value or array or whatever"

Include("file that references $table.php");

// $table is still  in the global namespace, and the include file can
reference it as normal.

The only way you would need to pass values to the php file, like you did, is
if you were retrieving data from it through
fopen("http://domain.com/variables.php?table=$table",'r');

Include does not pre parse your file.

Hope that helps.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] How can I make this smaller

2001-04-05 Thread Lindsay Adams

On 4/5/01 3:56 PM, "Matt McClanahan" [EMAIL PROTECTED] wrote:

 On Thu, Apr 05, 2001 at 01:40:54PM -0700, Richard Kurth wrote:
 
 Is there another way to write this I would like to make it smaller
 also How would I write it so it is a function and I would be able to use all
 the data throughout the  whole program every time I try the rest of the
 program does not see the data
 
  $domain=$data[0];
  $tld=$data[1];
   $firstname=$data[2];
  $lastname=$data[3];
  $userid=$data[4];
  $passw=$data[5];this part  would like to make smaller
   $email=$data[6];
  $package=$data[7];
  $frontpage=$data[8];
  $mysql=$data[9];
  $userdatabase=$data[10];
  $newuser =$data[11];
 $newuserpass =$data[12];
 
 Use list()
 
 list($domain,$tld,$firstname,$lastname,$userid,.) = $data;
 
 If you want to put it in a function, declare them all globals beforehand.
 
 function myfunc()
 {
  global $domain,$tld,$firstname,$lastname,$userid...;
 
 Matt

Umm, you can add them to the global space this way.
Inside a function.

$GLOBALS['domain']=data[0];
$GLOBLAS['tld']=data[1];
...


Can't you? Everyone?

Or you can pass as a reference in the last parameter of your function call,
the variable that you want returned as an array

Function get_data($parm,$parm,$array_parm)

And set the values of $array_parm['variablename']=whatever
Inside the function, and return $array_parm at the end of the function call.

So, if you called your function as

get_data("somethinghere","somethingelse",$returned_array);

$returned_array['domain'] will equal whatever $data[0] was

But I think adding the variable to the GLOBAL array will work fine.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] help with parse

2001-04-04 Thread Lindsay Adams

The reason it worked, is that you were setting the value of $HTTP_USER_AGENT
to "Mozilla" by using a single =

That operation was succesful, so the result was true.
Therefore the if() clause was being executed.

On 4/3/01 6:15 PM, "Wade DeWerff" [EMAIL PROTECTED] wrote:

 ugh, ok, I was without php support for a bit, ok the script works, except
 that it doesnt work...it prints even when browser is IE.
 
 
 -Original Message-
 From: Jason Murray [EMAIL PROTECTED]
 To: Jason Murray [EMAIL PROTECTED]; 'WD'
 [EMAIL PROTECTED]; [EMAIL PROTECTED] [EMAIL PROTECTED]
 Date: Tuesday, April 03, 2001 7:54 PM
 Subject: RE: [PHP] help with parse
 
 
 ?php
 if ($HTTP_USER_AGENT = "Mozilla")
 
^ This needs to be "=="
 
 Actually, it needs to be " if(substr($HTTP_USER_AGENT, "Mozilla"))".
 
 *slap.self*
 
 Jason
 
 --
 Jason Murray
 [EMAIL PROTECTED]
 Web Design Team, Melbourne IT
 Fetch the comfy chair!
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shell Programming with PHP, but where is the PHP?

2001-04-03 Thread Lindsay Adams

Yes, download the source and compile it.

Do not turn on the module options in ./configure.

I was able to compile my own standalone cgi version of PHP on my ISP without
issue.

If you download it, unpack it
Do 
./configure
Make

And look in the bin directory of the source directory for your cgi version.
Try it out, move it, whatever, then go back and recompile in other options
you might want. 

If your ISP has development tools available, you should not have a problem.
Since you are not installing it as a module, you won't need root access to
compile it and make it work.



On 4/3/01 9:02 AM, "Brandon Orther" [EMAIL PROTECTED] wrote:

 Hello,
 
 It is installed as a module,  Is there a way I can keep it installed as a
 module but install it so I can use it to shell script also?
 
 Thanks Ahead Of Time
 Brandon
 
 -Original Message-
 From: Renze Munnik [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 03, 2001 8:32 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Shell Programming with PHP, but where is the PHP?
 
 
 Brandon Orther wrote:
 
 Hello,
 
 I am looking for the path to my php so I can put it on the top of
 my php
 script.  Like this: #!/path/to/php
 
 All I can find that looks like this is libphp4.so  Does anyone know where
 to
 look for the binary?
 
 Thanks
 Brandon
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 Try locate and/or whereis.
 And you should make sure PHP isn't installed as module.
 --
 
 * RzE:
 
 ***
 **  Renze Munnik
 **
 **  E: [EMAIL PROTECTED]
 **  M: +31 6 218 111 43
 ***
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mysql

2001-04-03 Thread Lindsay Adams

This is a question that is better directed to the mysql mailing list, not
php. It is also self evident in the manual. But, here is the short answer.

Standard mysql tables are in ISAM format (pre 3.23 versions of mysql) which
is not directly portable between machines. MyISAM tables are.
On linux, in mysql
ALTER TABLE tablename TYPE MYISAM; // do this foreach table in the database
you are moving.

Then try copying the tables over. If that still doesn't work.
Then from the command line:
Mysqldump databasename  mydatabase.sql

Which will dump to text, the database structure and all the data.

Then, on windows, you simply:
Mysqladmin create databasename
Mysql -u user -p password  mydatabase.sql

And database will be recreated.
You should really buy a good book on mysql and learn about backing up your
databases. 


On 4/3/01 9:07 AM, "Glenda Robalino" [EMAIL PROTECTED] wrote:

 Hi
 I have created my database in mysql in linux, but i nedd my aplication,
 including the database in windows, I tryied to copy, but i had problems with
 the database...
 all the tables are copie.. i could see the tables, but i cant make selects,
 inserts
 
 what could i do to copy well the database??
 
 thanks ciao
 _
 Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Shell Programming with PHP, but where is the PHP?

2001-04-03 Thread Lindsay Adams

What happens when you type ./configure?

If the answer is nothing, or it ends with an error, then your ISP does not
provide you with dev tools. And you are sort of out of luck.

If you can find out for certain, what platform your isp is running, you may
be able to install a binary. But a wouldn't count on it.

Might have to find another ISP

On 4/3/01 10:02 AM, "Brandon Orther" [EMAIL PROTECTED] wrote:

 When I type: make it does nothing??? What am I supposed to be typing?
 
 -Original Message-
 From: Nuno Silva [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 03, 2001 9:19 AM
 To: Brandon Orther
 Cc: PHP User Group
 Subject: Re: [PHP] Shell Programming with PHP, but where is the PHP?
 
 
 
 :)
 yes,
 
 just
 ./configure (don't use --with-apache or --with-apxs) [other options]
 make
 cp php /usr/local/bin (or whatever)
 
 regards,
 Nuno Silva
 
 Brandon Orther wrote:
 
 Hello,
 
 It is installed as a module,  Is there a way I can keep it installed as a
 module but install it so I can use it to shell script also?
 
 Thanks Ahead Of Time
 Brandon
 
 -Original Message-
 From: Renze Munnik [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, April 03, 2001 8:32 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Shell Programming with PHP, but where is the PHP?
 
 
 Brandon Orther wrote:
 
 Hello,
 
 I am looking for the path to my php so I can put it on the top of
 
 my php
 
 script.  Like this: #!/path/to/php
 
 All I can find that looks like this is libphp4.so  Does anyone know where
 
 to
 
 look for the binary?
 
 Thanks
 Brandon
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 Try locate and/or whereis.
 And you should make sure PHP isn't installed as module.
 --
 
 * RzE:
 
 ***
 **  Renze Munnik
 **
 **  E: [EMAIL PROTECTED]
 **  M: +31 6 218 111 43
 ***
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can I use a function within an ereg_replace?

2001-04-03 Thread Lindsay Adams

On 4/3/01 11:06 AM, "Dan Wilson" [EMAIL PROTECTED] wrote:

 Hey all,
 
 I'm trying to mangle email addresses to pass to an email sending form and
 want to use a custom hashing function within an eregi_replace.
 
 Example:
 
 $text = eregi_replace("[my big email regex]", "send.php?addr=" .
 hash_func("\\1@\\2.\\3"), $text);
 
 I can't seem to get this to work... it is just hashing the static text
 within the function, not the replaced values.
 
 Can this just not be done?
 
 -Dan
 
If you set the value of a temporary variable to the result of hash_func(),
does it return what you expect? If so, do that before the eregi_replace, add
"send.php?addr=" to the beginning, and pass the temp var to eregi_replace.
I know, it's a whole extra line of code, but at least you can test and make
sure hash_func() is doing the right thing.

Maybe you could try enclosing  "send.php?addr=" . hash_func("\\1@\\2.\\3")

In another set of () to enforce operator precedence?
Ie. ( "send.php?addr=" . hash_func("\\1@\\2.\\3"))
Just a thought.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Can I use a function within an ereg_replace?

2001-04-03 Thread Lindsay Adams


 On 4/3/01 11:06 AM, "Dan Wilson" [EMAIL PROTECTED] wrote:
 
 Hey all,
 
 I'm trying to mangle email addresses to pass to an email sending form and
 want to use a custom hashing function within an eregi_replace.
 
 Example:
 
 $text = eregi_replace("[my big email regex]", "send.php?addr=" .
 hash_func("\\1@\\2.\\3"), $text);
 
 I can't seem to get this to work... it is just hashing the static text
 within the function, not the replaced values.
 
 Can this just not be done?
 
 -Dan
 
And after more carefully reading your code...

I think you are going to have to get your matches before the replace, then
pass the matches to hash_func, then do the replace.

Am I reading that right?
Your  [big email regex] contains 3 groupings that you want \1,\2,\3 to be,
and you want those values passed to hash_func()?

ereg([big email regex],$text,$match)
// $match[1] = \1
// $match[2] = \2
// etc
//
// $match[0] is the entire matched string, not the first sub group in the
regex

// Then
 $text = eregi_replace("[my big email regex]", "send.php?addr=".
hash_func("$match[1]@$match[2].$match[3]"), $text);


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Change the filename sent via html header

2001-04-03 Thread Lindsay Adams

On 4/3/01 12:34 PM, "Spunk S. Spunk III" [EMAIL PROTECTED] wrote:

 I've got a script that returns a smil file in a header but I'd like to
 change the name of the file. The file is sent as blah.php (even though it is
 a smil file) but I'd like to be able to name it something like blah.sml. Is
 there a way to do this?
 
 Spunk
 
If you are using include() to send the file in the header, then it doesn't
matter WHAT the extension is. All files sent through include() are parsed as
if they were PHP, with or without the php extension. So, as long as nothing
in your smil file looks like php, then it will just get passed through (as
if it were html).


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Quick one...

2001-04-03 Thread Lindsay Adams

Do it in your sql SELECT statement.
Mysql uses ORDER BY field_name

I think that is standard SQL.

On 4/3/01 12:54 PM, "Brandon Orther" [EMAIL PROTECTED] wrote:

 Hello,
 
 How do I alphabetize the out put of my data base?
 
 The field would be LastName
 
 Brandon


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Java applet can't read PHP output !!

2001-04-03 Thread Lindsay Adams

Umm, have you tried explicitly outputting the content-type header the way
your shell script does?

See header() in the php docs.

On 4/3/01 1:38 PM, "Peter Choynowski" [EMAIL PROTECTED] wrote:

 
 I am using php4 as an Apache module.  The problem is that when a Java
 applet makes a connection to a CGI script written  in php, it can't read
 the result of php output, but the same applet works fine with Perl or
 plain sh CGI script - since the only difference between the the CGIs is
 the language used ie. php, perl,... I am speculating that the problem is
 somewhere in the Apache-php interface ( the strange thing is that the
 php script works if connected to with a browser :-(  )
 
 Here is some simple code ( working sh code )
 
 in sh
 #! /bin/sh
 echo "Content-type: text/plain"
 echo ""
 echo "some text..."
 
 The following output displays with a browser, but can't be read by a
 Java applet
 ?php
   print "some text ..."
 ?
 
 
 Applet code in question:
 URL u=new URL("http://www/test.php");
 URLConnection uc=u.openConnection();
 DataInputStream d=new DataInputStream(uc.getInputStream());
 while ( (line=d.readLine()) != null ) {
   System.out.println(line);
 }
 
 I tried set_time_limit(0), ignore_user_abort, sending my own header with
 header function, none of them worked - any ideas ?
 
 Thanks,
 Peter
 
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] how do I turn off error checking in foreach() ?

2001-04-02 Thread Lindsay Adams

$database is the object.
Select_array() is the function in the class, so...
Try putting it in front of select_array()
I don't know if this will work, but this is where I would think to put it.

$database-@select_array()

Let me know if it works.


On 4/2/01 8:15 AM, "Chris Lee" [EMAIL PROTECTED] wrote:

 here is my code, If select_array() does not find anything it will not return
 anything, foreach() requires an array. I rtied putting an @ inforn of
 $database- but this didnt work (didnt think it would) and I cant put in fron
 of the foreach() I get a parse error.
 
  foreach($database-select_array('', 'orders, orders_product', $query) as $pos
 = $orders)
  {
   ...
   }
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] FLASH AND PHP

2001-04-02 Thread Lindsay Adams

If you are wanting to use pregenerated FLASH scripts ( and not build them on
the fly with libswf or ming) then what you want to do, without having to buy
Generator for your server is...

In the beginning of you falsh file, do a load variables from a PHP page,
that queries a database or whatever, gets the data, and echoes it out to the
FLASH file in the format expected by load variables. Tack on a variable at
the end called loadDone and set it to 1 (or true)
In flash, you have to put in a loop in the second frame, or after the
loadvariables command, that checks to see if loadDone==1, to make sure that
all the variables have loaded.

You cannot assume that the variables will load within a certain time period.
If they don't, the rest of your scripts will break.

That, is how you can pass a lot of dynamic information into your flash file,
without the use of server side generator install from macromedia.



On 4/2/01 11:14 AM, "Godd" [EMAIL PROTECTED] wrote:

 Now VRML and PHP may be possible but if you can get Flash to get in the mix
 that will be so bad.
 
 What I really want to do is to get a flash file that will use the pictures
 that I send to it via php and let it use that picture to do the animation.
 
 Now what I am looking at is a flash file that displays info on a product.
 now given the picture of the product and the information on the product, I
 want flash to use that info with the events that I will place in the flash
 file and let it do its thing.
 
 now that will be good. I am not sure what macromedia has along this line.
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Warning: 1 is not a valid File-Handle resource

2001-04-02 Thread Lindsay Adams

Don't know. Code looks good, what version of PHP are you using? Module or
cgi? What version  of windows? These are the things the PHP/Zend guys
probably need to know.

On 4/2/01 4:59 PM, "Richard Kurth" [EMAIL PROTECTED] wrote:

 What is causing this error
 
 
 Warning: 1 is not a valid File-Handle resource in
 c:/httpd/htdocs/autosetup/auto/createaccount.php on line 88
 
 This is the cod in question
 
 $tab = chr(9); // define tabulator
 if(file_exists("userdata")) {
 $fp2=fopen ("userdata","r")or die("unable to open file ($userdata)");
 flock($fp2, 2); //unless ($use_flock == 0);
 while ($data = fgetcsv ($fp2, 1000, $tab)) {   ---this is line 88
   $num = count ($data);
 $row++;
 for ($c=0; $c$num; $c++) {
 
   }
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Let the Server do the downloading

2001-04-02 Thread Lindsay Adams

See manual reference on fopen() and fsockopen()

Fopen() can take http://... Or ftp://... As filenames. Therefore, you can do
an ftp login and upload and download files from a remote server, or use
http:// and read files from a server.


On 4/2/01 4:27 PM, "Richard Lynch" [EMAIL PROTECTED] wrote:

 Check out http://php.net/fopen and PHP's FTP support.
 
 --
 Visit the Zend Store at http://www.zend.com/store/
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: [EMAIL PROTECTED]
 Newsgroups: php.general
 Sent: Sunday, March 25, 2001 6:03 AM
 Subject: [PHP] Let the Server do the downloading
 
 
 Is it possible?
 
 Have anyone made a script that allows you to grab a file from another URL
 directly from the server so that you don't need to download the file and
 upload it again?
 
 
 Chua Zhi Hon aka. Zeus
 -
 Founder/CEO, Frozened Network
 "We provide you with the tools needed to setup an online business"
 http://www.frozened.com
 Editorial, paGn.net
 http://www.pagn.net
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] PHP, MYSQL and Multiple Records revisited

2001-04-02 Thread Lindsay Adams

Okay, with all that code, I can answer your question.
The problem here is that you only have  on form field with a date. Therefore
it should not be an array.
You also have only one photono, so it too should not be an array.

When the loop iterates to create the query, there is only a value for the
first item in the photono and photodate arrays. All subsequent iterations
will have null values, therefore, the query will insert the first data set,
and error out on the following ones.

Replace this:
 $result = mysql_query($query);
With this:
Print $query

And the query will output to the browser, and you will see the empty values.
On deeper thinking, do you have a whole lot of empty fields if you manually
do a SELECT * FROM pictures; ? Or is one of the following defined as not
null (photono,photodesc,photodate) . If one of those is not null, I think it
would error out the query after the first insert.

Even though there is an error in a multiple insert like this, it still
inserts up to the point it errors.


On 4/2/01 6:25 PM, "Curtis" [EMAIL PROTECTED] wrote:

 Ok,
 Here is the code I am using to insert values from a form into a mysql
 database...
 (Given to me by Lindsay Adams,, thank you!)
 This is just a phantom form and database, there are several things you
 could look at
 right off the bat and ask "Why is this fool doing this"
 Don't bother I already asked that.
 
 I want to be able to input a picture number, date and up to 5
 descriptions,
 If I enter a PHOTONO, two - DESCRIPTIONS, and a DATE
 the code only shows one entry...
 
 Any ideas where I am going wrong?
 = START CODE 
 html
 head
 titleMy Pictures/title
 /head
 body color="#FF00FF"
 ?
 if(isset($submit)):
 $db = mysql_connect("localhost", "root");
 mysql_select_db("photo", $db);
 
 
 $query = "INSERT INTO pictures (photoid, photono, photodesc, photodate)
 VALUES";
 for($I=0;$I  count($photono); $I++) {
   if(!($I == count($photono) - 1)) {
 $query .="(NULL,'$photono[$I]','$photodesc[$I]','$photodate[$I]'),";
 }
 else {
 $query .="(NULL,'$photono[$I]','$photodesc[$I]','$photodate[$I]')";
 }
 }
 $result = mysql_query($query);
 
 print("h2The data has been entered/h2\n");
 
 endif;
 
 ?
 form action="http://localhost/pic2.phtml" method="post"
 Picture Number:brinput type="text" size="20" name="photono[]"p
 Picture Description:brinput type="text" size="40"
 name="photodesc[]"p
 Picture Description:brinput type="text" size="40"
 name="photodesc[]"p
 Picture Description:brinput type="text" size="40"
 name="photodesc[]"p
 Picture Description:brinput type="text" size="40"
 name="photodesc[]"p
 Picture Date:brinput type="text" size="8" name="photodate[]"p
 input type="submit" name="submit" value="Submit Picture"
 /form
 /body
 /html
 You guessed it End Code=
 
 Thanks in advance
 Curtis
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] updating values in a while statement

2001-04-02 Thread Lindsay Adams

G'Day,
You need to have an auto_incrementing field in your database. Then all lines
that are displayed need to be in the form of fieldname[] so that PHP builds
an array. 

Then you need a hidden field to represent the unique record number to be
updated.

Here is some code that I use to print out a list of products by category,
and allow me to do mass updates on any of the information present, except
the unique id. It then goes through a while loop to UPDATE TABLE for each
record. 

Code follows:
!-- START CODE --

htmlheadtitleProduct Admin Page/title/head
body BGCOLOR="white"

!-- Product Administration page --

?
// FUNCTION DEF

function showitems($prod,$cat) {
// show all items in the product database, optionally sorted
// selected by category or product id including '%' wildcard

$mylink = mysql_connect();
mysql_select_db('printcart',$mylink);

// select * from product where category like 'postcard' and prodid
like '%'

($prod == '') ? $prod = '%' : $prod;
($cat == '') ? $cat = '%' : $cat;

$query = "SELECT * FROM product WHERE category LIKE '$cat' AND
prodid LIKE '$prod' order by category, prodid";
$myresult = mysql_query($query,$mylink);

// build table and show all items in form fields

print '
form name="showitems" action="prodadmin.php?update" method="post"
table bgcolor="#EE" border="1"tr
thProdID/ththProduct Name/ththProduct Description/th
thUnit/ththPrice/ththMinimum
Order/ththPackaged/ththCategory/th/tr
';

while($row = mysql_fetch_array($myresult)) {


print "trtdinput type=\"hidden\" name=\"id[]\"
value=\"$row[prodid]\"  font size=\"2\"$row[prodid]/font/t
d\n";
print "td align=\"center\"font size=\"2\"input
type=\"text\" name=\"name[]\" value=\"$row[prodname]\" /font
/td\n";
print "td align=\"center\"font size=\"2\"input
type=\"text\" name=\"desc[]\" value=\"$row[proddesc]\" /font
/td\n";
print "td align=\"center\"font size=\"2\"input
type=\"text\" name=\"unit[]\" value=\"$row[unit]\" size=\"6\"/
font/td\n";
print "td align=\"center\"font size=\"2\"input
type=\"text\" name=\"price[]\" value=\"$row[price]\" size=\"6\"
/font/td\n";

print "td align=\"center\"font size=\"2\"input
type=\"text\" name=\"minorder[]\" value=\"$row[minorder]\" size=
\"5\"/font/td\n";
print "td align=\"center\"font size=\"2\"input
type=\"text\" name=\"packaged[]\" value=\"$row[packaged]\" size=
\"5\"/font/td\n";


print "tdfont size=\"2\"input type=\"text\"
name=\"category[]\" value=\"$row[category]\" /font/td/tr\n";

}
print '/table';
print 'input type="submit" name="update" value="Update"';
print 'input type="hidden" name="cat" value="' . $cat . '"';
print 'input type="hidden" name="prod" value="' . $prod . '"';
print '/form';

}

// FUNCTION

function updateproducts() {
global $name,$id,$unit,$price,$category,$desc,$minorder,$packaged;


$mylink = mysql_connect();
mysql_select_db('printcart', $mylink);

$numrows = count($id);

for ($i = 0; $i  $numrows; ++$i) {


if($desc[$i] == '' ) { $desc[$i] = $name[$i]; }

$line = "UPDATE product SET prodname='${name[$i]}',";

$line .= "proddesc='${desc[$i]}',";
$line .= "unit='${unit[$i]}',";
$line .= "price='${price[$i]}',";
$line .= "category='${category[$i]}', ";

$line .= "minorder='${minorder[$i]}', ";
$line .= "packaged='${packaged[$i]}' ";

$line .= "WHERE prodid='${id[$i]}'";

$myresult = mysql_query($line,$mylink);
print mysql_error($mylink);


}


}

?

form NAME="filter" ACTION="prodadmin.php"
Product id is: input TYPE="text" NAME="prod" VALUE="? print $prod ?"br

Category is: !-- input type="text" name="cat" value="? print $cat ?"--

select NAME="cat"

?
$catq = "select category,c.name from product,category as c where
category=c.ckey group by c.name order by category";
$link = mysql_connect();
mysql_select_db('printcart',$link);
$catsr = mysql_query($catq,$link);
while(list($catop,$catname) = mysql_fetch_array($catsr)) {

if($catop == $cat) {
$select = "selected";
}
else
{
$select = "";
}
print "option value=\"$catop\" $select$catname/option\n";
}
?
option VALUE="%"%wildcard/option
/select
br
font SIZE="-1"(you may use the '%' as a wildcard for matching a portion of
the code or category)/fontbrbr
Too display all items, enter % into both fields. br
br
input TYPE=submit VALUE="Get Matches"
/form

?
// Begin MAIN

if(isset($update)) {
updateproducts();
showitems($prod,$cat);
}
elseif(isset($prod) OR isset($cat)) {

showitems($prod,$cat);
}


?

/body/html
!-- END CODE --

You should be able to 

Re: [PHP] Php with Frames

2001-04-01 Thread Lindsay Adams

The form tag can tag a TARGET attribute, just like the A tag can.

FORM Action="myscript.php" METHOD="POST" TARGET="Bottom_Frame"

Adjust to match your script and frame names

On 4/1/01 2:30 AM, "Diego Prez Rndez" [EMAIL PROTECTED] wrote:

 
   Hi to all:
 
   I have a page with two frames. In the top frame I have a form where
 I can select some options. When I press the send button a php program
 generate a html page that I want to show in the Botton frame. I don't
 know how I can load the new page generate in the botton frame. I only
 want to change the botton frame not the top.
 
   Probably its easy to do.
 
   Can someone help me?
 
   Thanks.
 
 
   Best regards, Diego
 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Inserting into the middle of an array

2001-04-01 Thread Lindsay Adams

On 4/1/01 11:32 AM, "Yoshi Melrose" [EMAIL PROTECTED] wrote:

 Ok. I must be s blind. Is there a function to insert a value into the
 middle of an array without rewriting it?
 
 
In PHP3, no.
PHP4, see http://www.php.net/manual/en/function.array.php

You could pull it off with combinations of array_slice, array_splice,
array_merge, array_push...

Lots of array functions in php4. 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Inserting into the middle of an array

2001-04-01 Thread Lindsay Adams

On 4/1/01 11:57 AM, "Yoshi Melrose" [EMAIL PROTECTED] wrote:

 - Original Message -
 From: "Lindsay Adams" [EMAIL PROTECTED]
 On 4/1/01 11:32 AM, "Yoshi Melrose" [EMAIL PROTECTED] wrote:
 
 Ok. I must be s blind. Is there a function to insert a value into
 the
 middle of an array without rewriting it?
 
 
 In PHP3, no.
 PHP4, see http://www.php.net/manual/en/function.array.php
 
 You could pull it off with combinations of array_slice, array_splice,
 array_merge, array_push...
 
 Lots of array functions in php4.
 
 
 Okay. that's what I was afraid of. I was kinda hoping for an array_insert()
 function. =)
 
 
 
Hmm, just looked at the phpclasses website that is listed at the bottom of
Manuel Lemos' posts, and found this:
http://phpclasses.UpperDesign.com/browse.html/package/109

It is a php class that allows you to insert data into any position.
That will take some of the work off your shoulders :)


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] PHP4.04pl1/pdflib3.0.3 compile issue

2001-03-31 Thread Lindsay Adams

Firstly, I spent 3 hours searching the archives and trying all the
suggestion that I could find. No go.

The box that I want to put this on is a Cobalt Qube2

The pdflib compiles and installs correctly as a shared library
It is compiled with tiff and zlib support only (png is explicitly off)

Here is the output when I compile php with the following command:

./configure --with-apxs=/usr/sbin/apxs \
--with-ftp \
--enable-calendar\
 --with-zlib-dir \
--with-mysql \
--with-pdflib=/usr/local \
--with-swf=/usr/local/swf \
--with-zlib


OUTPUT:
checking for Oracle-ORACLE support... no
checking for Ovrimos SQL Server support... no
checking whether to include PCRE support... yes
checking for memmove... (cached) yes
checking whether to include Pdflib 3.x support... /usr/local
yes
checking for libz needed by pdflib 3.x... already zlib support
checking for jpeg_read_header in -ljpeg... no
no
checking for png_create_info_struct in -lpng... no
no
checking for TIFFOpen in -ltiff... no
no
checking for PDF_show_boxed in -lpdf... no
configure: error: pdflib extension requires pdflib 3.x.
[php-4.0.4pl1]# 


I do not know the ins and outs of make, ld, yacc, sed...
I am not a developer, just a monkey that can read and explore

In exploring, I grep'd for PDF_show_box in a bunch of .c and .h files, and
found it in a lot of places.
I don't know which file does the actual check for PDF_show_boxed, or which
file it checks, that would be helpful.

I did download the latest and greatest pdf.c for php/ext/pdf directory.

If anyone has any new ideas on things to try to make this work, I would be
hugely grateful.


I downloaded both source tarballs today, from what appeared to be the
newest.

Ack!

Lindsay Adams


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]