[PHP] RE: php code generator

2002-03-20 Thread Jason Bell

you can find a fairly decent PHP extension for ultra dev at the below link.

http://www.interakt.ro




Re: [PHP] Re: Making a simple borderless pop up window with a Close button

2002-03-20 Thread Jason Bell

Actually, it sort of works for other browsers. It just isn't as cool the
window that is opened on netscape is just a normal bordered popup window,
with no toolbars.

- Original Message -
From: Gaylen Fraley [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 20, 2002 6:32 PM
Subject: [PHP] Re: Making a simple borderless pop up window with a Close
button


 As noted before and on their website, it only works in IE.

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

 Qartis [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  If you want a popup window that lacks a border entirely, check out
  chromeless windows at www.microbians.com
 
 
 
  Denis L. Menezes [EMAIL PROTECTED] wrote in message
  000f01c1cf3f$5321d520$c900a8c0@d8d0l7">news:000f01c1cf3f$5321d520$c900a8c0@d8d0l7...
   Hello friends.
  
   I am making a database website where I need to add a small help button
 for
   every field on the form. Whenever the user clicks the small help
button,
 I
   wish to show a titleless popup window containing the help text and a
  close
   button. Can someone  help me with the php script for this.
  
   Thanks
   Denis
  
 
 



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






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




Re: [PHP] Class Function Issue

2002-03-17 Thread Jason Bell

oops... meant to send this to the list

- Original Message -
From: Jason Bell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 17, 2002 10:27 AM
Subject: Re: [PHP] Class Function Issue


 Thanks for the tip. I tried that... I passed $HTTP_SESSION_VARS as a
 parameter, and it didn't work.  :/

 I also built another function inside the class to set session variables:

 function SetSVAR($var,$value) {
 global $HTTP_SESSION_VARS;
 $HTTP_SESSION_VARS[$var] = $value;
 }

 If I call $MyClass-SetSVAR($var,$Value); it works
 but if I put $this-SetSVAR($var,$Value); inside a class function it
doesn't
 work

 is it because these are in the same class? should they be seperated into 2
 seperate classes?

 - Original Message -
 From: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, March 17, 2002 4:38 AM
 Subject: Re: [PHP] Class Function Issue


 At 16.03.2002  22:24, you wrote:
 
 Hi!  I'm building a class, and am trying to include an authorization
 function the code works when used outside of the class, but when I
put
 it inside the class, for some reason my session variables won't get
 set.  Am I attempting the impossible, or am I missing something that I
 need to make this work? Below is the code for the Auth function.
 
 
 function Auth($username,$password) {
  $query = SELECT id,username,sl FROM KAOPA_users where
  username='$username' AND password=PASSWORD('$password');
  $Auth = $this-Query($query);
  if ($this-number_returned($Auth) == '1') {
  $id = mysql_result($Auth,0,id);
  $uname = mysql_result($Auth,0,username);
  $sl = mysql_result($Auth,0,sl);
  global $HTTP_SESSION_VARS;
  $HTTP_SESSION_VARS[id] = $id;
  $HTTP_SESSION_VARS[user] = $uname;
  $HTTP_SESSION_VARS[sl] = $sl;
  }
  }
 some vars make trouble, using inside a class or function inside a class.
 Even
 making them global doesn´t work. Try to set the vars via an explicit
 function,
 so that they´re available inside your class, or just make them parameters
 so your authorisation could look like
 $MyClass - Auth($username,$password,$session_vars);
 HTH Oliver


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







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




[PHP] Class Function Issue

2002-03-16 Thread Jason Bell

Hi!  I'm building a class, and am trying to include an authorization function the 
code works when used outside of the class, but when I put it inside the class, for 
some reason my session variables won't get set.  Am I attempting the impossible, or am 
I missing something that I need to make this work? Below is the code for the Auth 
function.


function Auth($username,$password) {
$query = SELECT id,username,sl FROM KAOPA_users where 
username='$username' AND password=PASSWORD('$password');
$Auth = $this-Query($query);
if ($this-number_returned($Auth) == '1') {
$id = mysql_result($Auth,0,id);
$uname = mysql_result($Auth,0,username);
$sl = mysql_result($Auth,0,sl);
global $HTTP_SESSION_VARS;
$HTTP_SESSION_VARS[id] = $id;
$HTTP_SESSION_VARS[user] = $uname;
$HTTP_SESSION_VARS[sl] = $sl;
}
}



Re: [PHP] Increment help..please

2002-01-24 Thread Jason Bell

In your database, make the ID column AUTO_INCREMENT, and then simply don't
specify a value for it when you insert.

- Original Message -
From: will hives [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 24, 2002 11:43 AM
Subject: [PHP] Increment help..please


 please help I'm a newb and this is really messing with my head. All I want
 to know is what do I need to add to this script to allow it to increment
the
 ID number. pleasee.
 thank you very much for a simple boy

 Will
 ?

 $db_name = altone;

 $table_name = author;



 $connection = @mysql_connect(www.myserver.net, test, will) or die
 (couldn't connect.);

 $db = @mysql_select_db($db_name, $connection) or die (couldn't select
 database.);

 $sql = INSERT INTO $table_name (id, name, email, picture_name)
 VALUES ('$id', '$name', '$email', '$picture_name') ;

 $result = @mysql_query($sql, $connection) or die (couldn't execute
query);





 if ($picture != ) {


 move_uploaded_file($picture, /home/mine/yep/php/$picture_name);


 }




 ?


 html
 head
 titlemy contact management system: add a contact/title
 /head
 body

 table cellspace=3 cellpadding=5
 tr
 thName  email information/th
 th /th
 /tr
 tr
 td valign=top

 pstongfont size=-2 face=Verdana, Arial, Helvetica,
 sans-serifname:/fontbr
 ? echo $table_name; ?br
 ? echo $name; ?br
 ? echo $id; ?
 /p
 pstongfont size=-2 face=Verdana, Arial, Helvetica,
 sans-serifemail:/fontbr? echo $email; ?

 br
 /p
 font size=-2 face=Verdana, Arial, Helvetica, sans-serifFile
 to Upload:/fontbr
 img src=? echo http://www.myserver.net/php/$picture_name;; ?
 pstong/p
 /td
 td valign=top /td
 /tr
 tr
 td align=center colspan=2
 div align=leftbr
 /div
 p align=left
 input type=submit name=submit value=add to contact system
 /p
 div align=left/div
 /td
 /tr
 /table
 /body
 /html


 Cheers
 Will


 --
 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] Confusing Problem

2002-01-20 Thread Jason Bell

Just as DL Neil implied, your variables are outside the scope of the
function. set them global within your function.

See: http://www.php.net/manual/en/language.variables.scope.php


- Original Message -
From: Tj Corley [EMAIL PROTECTED]
To: DL Neil [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, January 20, 2002 3:08 PM
Subject: Re: [PHP] Confusing Problem


 they are in the same script outside the function.

 all the admin functions reside in a admin_func.php
 with the $db_host, etc, etc variables assigned before it.

 - Original Message -
 From: DL Neil [EMAIL PROTECTED]
 To: Tj Corley [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Sunday, January 20, 2002 4:56 PM
 Subject: Re: [PHP] Confusing Problem


  Tj,
 
 
   I am really baffled by this problem.  I have tried so many things to
get
   this working but to no avail.  Here is the
   actual code:
  
   function verify_user($username, $password){
$conn = mysql_connect($db_host, $db_user, $db_pass) or
  ...
   Anyways the problem is I cannot get it to even get to the database.
It
   works when I try to connect in the actual code before I call this
 function.
  ...
   But when I do it that way it won't let me run a query right.  I am so
   baffled.  Any input would be appreciated.  Thanks.
 
 
  Remember the idea of the scope of a variable? (if not, please RTFM)
  Where do the values of $db_host, $db_user, etc come from?
  They are not in the argument list for verify_user().
 
  Regards,
  =dn
 
 


 --
 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] PHP Security - view source code

2002-01-16 Thread Jason Bell

The PHP code is parsed and interpreted at the server level, and then returns
only the output to the browser. It is not possible to view PHP code via
view source.

- Original Message -
From: Phil Schwarzmann [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 16, 2002 1:03 PM
Subject: [PHP] PHP Security - view source code


 How easy/hard is it to view the PHP source code when you're at website?

 I noticed when I was using Internet Explorer, if I pressed view
 source...it would show the HTML but not the PHP.

 -Phil



-- 
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] Re: Image Fields and PHP...

2002-01-16 Thread Jason Bell

It basically comes down to speed. While there is nothing Technicaly wrong
with storing the images in the database, accessing the images will become
slower as the database gets larger, than if the files were stored on the
filesystem. Whether or not this degredation of performance is acceptable or
not is up to you, but... if you still want to pull an image directly from
the database, try the following method. Please note that you must have the
image type stored in the database as well.

Create a seperate PHP script called getimg.php:

/* Begin getpic.php */
?php
if($id) {
$dbhost = ;  /* MySQL Server */
$dbuser = ; /* MySQL UserName */
$dbpass = ;   /* MySQL Password */
$dbname = ; /* MySQL Database */
$db = mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname,$db);
$query = select image,type from images where id=$id;
$result = mysql_query($query);
$data = mysql_result($result,0,image);
$type = mysql_result($result,0,type);
Header( Content-type: $type);
echo $data;
};
?

/* End getpic.php

Now that you have this, when you want to display a picture, call getpic.php
in your img tag like so:

IMG SRC=getpic.php?id=12 (obviously, this gets the picture with ID 12
from the database. )


There are probably more elegant ways of doing this, but it works.  :)

- Original Message -
From: Gonzalez, Zara E [EMAIL PROTECTED]
To: 'Lerp' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 16, 2002 1:52 PM
Subject: RE: [PHP] Re: Image Fields and PHP...


 Joe (And/Or others),

 We are storing the actual images in the DB. We did not want our pictures
to be
 on our webserver. Instead we felt it would be better to keep them on the
 database server. In order to do this, they had to be stored in the
database
 itself since the database server is not accesible by the web. (I.e. the
only way
 to get stuff off of it via the web is to pull it out through the DB
connection)

 Now, You say that it is not recommended that we store our images in our
 database, can you give me a reasons why?

 Thanks,

 Zara



-- 
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] Party/RSVP App?

2002-01-09 Thread Jason Bell

go take a look at some of the script archive pages like
http://www.hotscripts.com

I'm sure someone out there has made this already


- Original Message -
From: Michael O'Neal [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, January 09, 2002 2:56 PM
Subject: [PHP] Party/RSVP App?


 Hi all,

 I'm looking for a PHP Party Invite/RSVP app.  I'd like it to be similar to
 evite.com.  I'm just checking first to see if something exists before I
dig
 into it myself.

 Thanks,


 mto

 --

 Michael O'Neal
 Web Producer
 -
  M   A   N   G   O
 B  O  U  L  D  E  R
 -
 http://www.thinkmango.com
 e- [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] adding users on *nix

2002-01-04 Thread Jason Bell

you might be better off triggering a back-end script to do that. the
script would have to have root privilegf es. I'm not sure if you can become
root within PHP, but if you trigger a shell script or perl script  or
something, it can be set SUID to root or something please note that my
suggestions are merely technical there are no implications of security
using this method.  :)


- Original Message -
From: Chris Hogben [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, January 04, 2002 1:40 PM
Subject: [PHP] adding users on *nix


 Is there a way of adding a user to a *nix box thru php. Like, someone
signs
 up, and they're account is added? 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]






-- 
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] web page visitor simulation

2002-01-03 Thread Jason Bell

Hi!

I would like to simulate a user, browsing to a webpage and logging in via a web 
form. is there a way to do this? I don't have curl installed, although I'm going 
to open a ticket asking if my host will install it

I tried using the Snoopy class, but it doesn't seem to work... I think the webpage 
that I'm trying to get into has it scripted so that there is some variable that is 
created each visit that I can't duplicate

I would like the script to actually browse to the login page, enter my info into the 
form, submit and then grab the info that I want behind the login Im trying to 
create a league management tool so that I can manage my hsx.com league... providing 
stats and stuff to my league members if I can't automate it, I have to do it 
manually each day which can be tedious if there are lots of members.

Can this be done with PHP? is there another way you can recommend to me, or a tool 
already existing that I can try? Would curl enable me to do this easier?

Thanks!

Jason Bell



Re: [PHP] 2 decimal places

2001-09-25 Thread Jason Bell

What if I want to pad a number with zeros in the other direction?  I.E:


524 becomes 00524



- Original Message -
From: Christian Dechery [EMAIL PROTECTED]
To: Kurth Bemis [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, September 25, 2001 9:41 AM
Subject: Re: [PHP] 2 decimal places


 At 22:22 19/09/01 -0400, Kurth Bemis wrote:
 i'm looking for a php function to add 2 decimal place sto a number.  if
 the number already have one decimal place then one more zero should be
 added to make it two decimal placesanyone know of a quick way to do
this?

 $number=32.5;

 echo number_format($number,2);

 outputs:
 32.50


 --
 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] Just for fun:

2001-09-21 Thread Jason Bell

Thanks Mathew, Jason and Joseph for the reply.

I never thought that having a large function could be a bad thing.

I'll keep your tips in mind when writing functions from now on. Fortunatly,
the function I was refering to that was 100 lines is a one time use
function. It's only used to setup the backend for my script, and after that
it's never called during normal use. (the user would have to delete the
configuration file in order for the function to be called again.)
Theoreticly, I could take out a lot of check and balance type of code, and
get it done in half the lines, but realisticly that wouldn't be too good for
the overall setup of the script, since it is defining the core of the
application.



-- 
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] Is anyone else seeing this everytime they mail to the list?

2001-09-21 Thread Jason Bell

Every time I send an email to the list, I get a bounce-back. Below are the details...  
anyone else see this?

who is [EMAIL PROTECTED]?



Reporting-MTA: dns; mail.aaz-netmarketing.com
Arrival-Date: Fri, 21 Sep 2001 19:02:32 +0200 (CEST)

Final-Recipient: rfc822; [EMAIL PROTECTED]
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; can't create user output file. Command output:
procmail: Error while writing to /var/spool/mail/dtt



Re: [PHP] Is anyone else seeing this everytime they mail to the list?

2001-09-21 Thread Jason Bell

Hmmm  Well, the *ONLY* time I get it is when I send email to
php-general


NoWayMan [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey I got that message in trying to remove my address from a spammer's
 list. But I'm not subscribed to the php mailing list.






-- 
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] Is anyone else seeing this everytime they mail to the list?

2001-09-21 Thread Jason Bell

Nope. I get it even if php-general is the only address I'm emailing..


- Original Message -
From: Sheridan Saint-Michel [EMAIL PROTECTED]
To: Jason Bell [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, September 21, 2001 11:24 AM
Subject: Re: [PHP] Is anyone else seeing this everytime they mail to the
list?


 I have also gotten that message when sending to PHP General.  I had
 cc'ed the original author, though, so thought maybe they had a
misconfigured
 reply to addy.

 This is probably not the case, however, as the e-mail addy listed in my
 bounce message was the same as the one you have listed here.
 (Unless you got this message when CC'ing Wee Chua)

 Sheridan Saint-Michel
 Website Administrator
 FoxJet, an ITW Company
 www.foxjet.com


 - Original Message -
 From: Jason Bell [EMAIL PROTECTED]
 To: PHP Users [EMAIL PROTECTED]
 Sent: Friday, September 21, 2001 12:24 PM
 Subject: Re: [PHP] Is anyone else seeing this everytime they mail to the
 list?


  Hmmm  Well, the *ONLY* time I get it is when I send email to
  php-general
 
 
  NoWayMan [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Hey I got that message in trying to remove my address from a spammer's
   list. But I'm not subscribed to the php mailing list.
  
  
 
  
 
 
  --
  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 Connectivity test

2001-09-20 Thread Jason Bell

Thanks lance and David for the reply.  :)

Yes, I suspected as much, *BUT* let me explain what I am trying to do:

I have a script I am writing that uses a MySQL backend. I'm including an
initial configuration interface via the webbrowser. During initial
configuration, the user provides parameters for dbhost, dbname, dbpass etc
etc...

If I simply try and connect, and it fails, I don't want my script to error
out, or even display an error... I just want it to move along and let me
deal with informing the user that his database configuration does not work
correctly.

now, to do this, could I do something as simple as:

$conntest = @mysql_connect($dbhost,$dbuser,$dbpass);
if ($conntest == FALSE) {
// Do my Oops didn't work stuff here
} else {
// Continue with whatever it was I was doing.
}

would that work as I expect it to?

thanks!

Jason

- Original Message, by David Robley - 
 Trying to connect is usually a good indicator :-)

 mysql_connect returns a positive link identifier on success or an error
 message on failure. That should do what you want.




-- 
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 IP Address Storage

2001-09-20 Thread Jason Bell

Felix,

Just to save you the headache that I encountered,  the column that you plan
to store your IP address in needs to be an unsigned integer when using
INET_ATON and INET_NTOA

If it's not, all addresses stored will come out as 127.0.0.0 (I think that
was what it was...).

Also, these are MySQL functions, not PHP functions. Not sure if you knew
that already, but it wasn't specified on the list...


INET_ATON converts from Decimal IP and INET_NTOA converts back to Decimal
IP, so you'd use it like this:

INSERT INTO mytable (ipaddress) VALUES (INET_ATON('192.168.1.1'));

SELECT INET_NTOA(ipaddress) FROM mytable;

Make sense?

- Original Message -
From: Felix [EMAIL PROTECTED]
To: Robert Covell [EMAIL PROTECTED]; PHP list
[EMAIL PROTECTED]
Sent: Thursday, September 20, 2001 11:29 AM
Subject: Re: [PHP] MySQl IP Address Storage


 Thank you Robert.
 Felix
 - Original Message -
 From: Robert Covell [EMAIL PROTECTED]
 To: Felix [EMAIL PROTECTED]; PHP list
[EMAIL PROTECTED]
 Sent: Thursday, September 20, 2001 10:55 AM
 Subject: RE: [PHP] MySQl IP Address Storage


  INET_ATON
 
  and
 
  INET_NTOA
 
  -Original Message-
  From: Felix [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, September 20, 2001 11:49 AM
  To: PHP list
  Subject: [PHP] MySQl IP Address Storage
 
 
  Hello all
 
  Can anyone suggest their best idea for a way to store IP addresses in a
  MySQL Database?
 
  Felix
 
 
  --
  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] Codes in PHP

2001-09-20 Thread Jason Bell

SARCASM hey, maybe if you post this 10 more times, someone will answer
it... /SARCASM

This is a good list, if someone has an answer, you will probably get it. You
don't need to post the same question multiple times. All that does is annoy
the hell out of people.


- Original Message -
From: Wee Chua [EMAIL PROTECTED]
To: PHP (E-mail) [EMAIL PROTECTED]
Sent: Thursday, September 20, 2001 12:49 PM
Subject: [PHP] Codes in PHP


 Hi all,
 I know how to forward a page with PHP, but what if the page I want to
 forward is the previous page or last page. In javascript, the code is like
 javascript:historygo(-1). The reason why I want to go back to previous
page
 is because I don't want to lose any information on previous page. Can
anyone
 help? Thank you.

 Calvin Chua

 --
 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] PHP Boot Camp [Announcement]

2001-09-20 Thread Jason Bell

Not to mention, it's a PHP bootcamp, not an HTML Web Design bootcamp. What
do the aesthetics of the site have to do with the backend?

I've recieved many excellent tips from richard in the past. I'm sure he is
qualified to teach PHP.

- Original Message -
From: Erik H. Mathy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 20, 2001 2:28 PM
Subject: RE: [PHP] PHP Boot Camp [Announcement]


  If HE is the one who did these lame-ass sites:
 
  http://www.PHPBootCamp.com
  http://www.l-i-e.com
 
  I don't want to learn anything from him, that's for sure

 Ay yi yi!

 Listen here, Flame Boi, why don't you just keep your comments to yourself,
 h?

 Unless I'm mistaken, there aren't many people who post more on this list
 than Richard. On top of that, his posts have always included good, solid
 code and exceptionally helpful comments. He's also been posting for years.

 You, on the other hand, do what? Oh! Be a jackass? Why, that's helpful!
Way
 to go!

 Yeesh!
 - Erik


 --
 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] Just for fun:

2001-09-20 Thread Jason Bell

Here is a question, just for fun:

What is the biggest function (In terms of line count) you have ever written?

I just finished one that is 100 lines long. That is by far my biggest It's a 
script initialization function that sets up database connectivity, creates all tables 
necessary for my script, and creates an administrative user.

-Jason



[PHP] MySQL Connectivity test

2001-09-19 Thread Jason Bell

What is the *SIMPLEST* way to test connectivity to a database?  Shouldnt there be a 
mysql_connection_test command or something?  :)

-Jason



Re: [PHP] Re: include question

2001-09-18 Thread Jason Bell

include loads the entire file. I do something similar with my functions
(Keep them in a seperate file, and include them when needed) I will usually
have multiple function files, grouped by function...

for example, I have one file for error reporting functions, one file for
authentication functions, one file for database manipulation functions, etc
etc  then, I just include whatever file holds the needed function where
it is needed. My reason for doing this is to keep everything modular. (I
have multiple domains, and like to reuse my code.. it's easier to have files
for specific function sets, than to maintain a single large file)

BUT, keep in mind: The server loads the entire file into memory, which is
done extremely fast, and the processes it based on your control structures,
etc... The user will only download the output that is sent, not the entire
contents of your include file. The user shouldn't notice any slowdown caused
by your include.

- Original Message -
From: Nikola Veber [EMAIL PROTECTED]
To: Chris Lee [EMAIL PROTECTED]; php forum
[EMAIL PROTECTED]
Sent: Monday, September 17, 2001 10:34 PM
Subject: [PHP] Re: include question


 I'm afraid you have not understood me completely:
 My only concern on this topic is: Will the user be forced to wait for the
whole included php file to load, or the server
 will just take the desired function from that file? My goal here is to
call different fragments of html code depending
 on user selection by using functions that have the echo command. I am only
afraid of all functions from included file
 beeing loaded, and not only the called one. Is this the right way to
approach this problem, or you would suggest smth
 else?

 Thanks
 Nikola
 9/18/01 6:25:49 PM, Chris Lee [EMAIL PROTECTED] wrote:

 include() has two different workings depnding on how it is called.
 
 include('include/test.php');
 php will open the file and litterally take everything in that and paste
into
 where the include() is, just like when you open the file in an editor,
the
 file is un-parsed raw src. functions, comments, whitespaces, html, etc,
etc,
 etc.
 
 include('http://www.e-tankless.com/products.php');
 php will make a http request to that file, just like if you typed it into
 your browser, ie the remote server will parse the file and only send you
the
 parsed data, not the source code, obviously though, how could you get
 someone elses code right?
 
   Chris Lee
   [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] ...::: Vacation on us! :::...

2001-09-18 Thread Jason Bell

All of us?  WoW! Well, if we win, how do we decide who gets to go?


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 18, 2001 8:06 AM
Subject: [PHP] ...::: Vacation on us! :::...


 You have been specially selected to qualify for the following:

 Premium Vacation Package and Pentium PC Giveaway
 To review the details of the please click on the link
 with the confirmation number below:

 http://wintour.my163.com

 Confirmation Number#Lh340
 Please confirm your entry within 24 hours of receipt of this confirmation.

 Wishing you a fun filled vacation!
 If you should have any additional questions or cann't connect to the site
 do not hesitate to contact me direct:
 mailto:[EMAIL PROTECTED]?subject=Help!


 --
 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] PHP Site

2001-09-18 Thread Jason Bell

is it just me, or is php.net down right now?



Re: [PHP] Is there no one who can help me out there.

2001-09-18 Thread Jason Bell

John, someone did reply to you alread. here  let me snip from that
email

oOoOoOoOoOoO   Gerard Samuel Said:  oOoOoOoOoOoO

check to see if the field where the info is going into is long enough.
ie varchar(50).  anything more than 50 get cut off.

 being diplayed on the succeeding web page.  I've tried

what did you name the textfield?  You should be able to echo $string;
if you named the textfield string

oOoOoOoOoOoO   End of Gerard's Words oOoOoOoOoOoO


- Original Message -
From: John Holcomb [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 18, 2001 4:29 PM
Subject: [PHP] Is there no one who can help me out there.


 I have a text input field in my form.  I need the user
 to be able to enter something like:  Hello, I need #
 help. After which they click on a submit button.   The
 succeeding page then takes this text and tries to
 display it and tries to store Hello, I need # help
 in a varchar field in a mysql table column.   The
 mysql database is truncating the # sign and the text
 succeeding the # sign.  Also, absolutly no text is
 being diplayed on the succeeding web page.  I've tried
  using addslashes() and I was warned against using
 htmlentities().  Also, I'm not sure if I'm dealing
 with 2 issues: A mysql issue and a html issue. Or, am
 I dealing with one issue: A mysql issue or an HTML
 issue.

 I know think my problem is that when I pass text to
 another page with the # sign, it's interpreting it as
 a comment.  Is their any way to somehow escape the #
 sign.




   Thank you,

 John

 __
 Terrorist Attacks on U.S. - How can you help?
 Donate cash, emergency relief information
 http://dailynews.yahoo.com/fc/US/Emergency_Information/

 --
 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] PHP Site

2001-09-18 Thread Jason Bell

Thanks.  I suppose really need to download the docs to my machine.  :)


- Original Message -
From: Scott [EMAIL PROTECTED]
To: Jason Bell [EMAIL PROTECTED]; PHP Users
[EMAIL PROTECTED]
Sent: Tuesday, September 18, 2001 4:34 PM
Subject: Re: [PHP] PHP Site


 The net is slow right now as there is another Microsoft IIS worm/virus
floating
 around.  This one is worse than Code Red in the amount of traffic it
 generates, something to effect of 10 requests a second, compared to one
 with Code Red.  While php.net is not running IIS, it is subject to these
 probes and it is bringing traffic to a crawl.  I have two servers here,
one
 runs IIS for my ASP clients and the other runs Mandrake for the real work.
 The IIS box is (while not affected) getting hammered, but  the
 Mandrake box just ignores it, still it is traffic we don't need.

 At 04:28 PM 9/18/2001 -0700, Jason Bell wrote:
 is it just me, or is php.net down right now?


 --
 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] re: array question

2001-09-18 Thread Jason Bell

or, assuming PHP4 is in use,  you can do it a little cleaner, and use a
foreach loop:

foreach ($array as $value) {
print $value;
}

if you wanted the key names, as well as the value, you could use this:

foreach ($array as $key = $value) {
print $key of \$array = $value;
}

- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: Scott [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, September 18, 2001 7:29 PM
Subject: RE: [PHP] re: array question


 perhaps i'm misunderstanding you, but why not use a for loop?

 for($i=0;$icount($array)-1;$i++){
 echo $array[$i];
 }

 jack

 -Original Message-
 From: Scott [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 18, 2001 10:11 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] re: array question


 Oh, that works wonders and for the first time in 24 hours I am
 smiling!  One more
 thing to make it complete.  Is there a way to loop through the display of
 that array?
 In other words, I now have an array called $new_data and can call each
 element in
 the array by doing $new_data[0], etc, but I need to loop through
everything
 in the
 array to display the navigation.

  At 08:54 PM 9/18/2001 -0400, you wrote:
  so then that last line in the loop should be
  $new_data[] = $ln;
  During the loop, everytime it comes to this line, $ln is added to the
 array new_data.  Eventually, you will be able to call on the array
 elements by $new_data[0], $new_data[1], etc


 --
 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] Quick mail function help.... please!!!

2001-09-17 Thread Jason Bell

Here is how I send email, please note the From, and X-Sender line:

$recipient .= $recipient;
$subject = $SubjectLine;
$message .= $YourMessageHere;
$message .= $More MessageHere;
$headers .= From: [EMAIL PROTECTED] [EMAIL PROTECTED]\n;
$headers .= X-Sender: [EMAIL PROTECTED]\n;
$headers .= X-Mailer: PHP\n;
$headers .= X-Priority: 1\n;
$headers .= Return-Path: [EMAIL PROTECTED]\n;
$headers .= bcc:[EMAIL PROTECTED]\n;
mail($recipient, $subject, $message, $headers);



- Original Message -
From: Kyle Smith [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 17, 2001 5:04 PM
Subject: Re: [PHP] Quick mail function help please!!!


 please someone please! ive been through the manual and i dont know
anywhere
 else to look so someone please gimme a kick in the right direction?


 -lk6-
 http://www.StupeedStudios.f2s.com
 Home of the burning lego man!

 ICQ: 115852509
 MSN: [EMAIL PROTECTED]
 AIM: legokiller666


 - Original Message -
 From: Kyle Smith [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 16, 2001 9:09 PM
 Subject: [PHP] Quick mail function help please!!!


 Can someone please show me how to change the reply address in the mail
 function (and the from address) cause i have a script im making for a
 mailing list and the script in the manual doesnt work cause it has loads
of
 different code aswell :(


 -lk6-
 http://www.StupeedStudios.f2s.com
 Home of the burning lego man!

 ICQ: 115852509
 MSN: [EMAIL PROTECTED]
 AIM: legokiller666




 --
 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] Get the beginning array number

2001-09-17 Thread Jason Bell

try this, untested, on the fly type solution.  :)

foreach ($array as $key = $value) {
if (strlen($value)  0) {
$FirstWithValue = $key;
break;
}
}

Now, $FirstWithValue should hold the key of the first element, so you could
then use $array[$FirstWithValue]


if you are using php older than version 4, exchange the foreach loop with a
while loop.


- Original Message -
From: Brandon Orther [EMAIL PROTECTED]
To: PHP User Group [EMAIL PROTECTED]
Sent: Monday, September 17, 2001 4:46 PM
Subject: [PHP] Get the beginning array number


 Hello,

 I have an array sent to my script that starts at different numbers each
 time.  Here is an example


 $array[5] through $array[23]  will have values but [0]-[4] will not.

 Is there a way for me to find the first element of an array with a value?

 Thank you,

 
 Brandon Orther
 WebIntellects Design/Development Manager
 [EMAIL PROTECTED]
 800-994-6364
 www.webintellects.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 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] Re: echo/printing html within a function - best method

2001-09-16 Thread Jason Bell

Out of curiosity, why do you avoid having functions generate HTML?  Is this
just personal preference, or is there some performance or other reason?

-Jason

- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: speedboy [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, September 16, 2001 9:32 PM
Subject: Re: [PHP] Re: echo/printing html within a function - best method


 I try to avoid having my functions generate HTML.  But yes, when they do I
 use the same approach.


-- 
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] Monitoring traffic

2001-09-14 Thread Jason Bell

check out www.mrtg.org for a pre-packaged solution, otherwise check out the
SNMP functions of PHP.

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

in either case, you'll need to install the snmp support from your win2000
installation disk.

/* SED asked: */

 This is kind of off topic but I need to monitor the traffic in
 kilobytes/bits on my net card adapter (in/out) or server (PHP, HTML,
 etc.), do you know of any software? I'm using Win2000.

 Thanks,
 SED



-- 
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] session_unset session_destroy being called outside of logic.

2001-09-13 Thread Jason Bell

Hello all!   I am switching a variable to check if a user is logging in or logging 
out. If the value of the variable is logout, I want the user to logout, i.e:

case logout:
   session_unset();
   session_destroy();
   $AuthErr = FONT SIZE=-1 COLOR=redSession Terminated/FONT;
   break;


What is happening, is after the user authenticates and logs in, everything looks good, 
but whenever the user follows any link, the session gets unset and destroyed. I know 
that the variable that holds the logout value isn't even present, so I'm not sure how 
it's getting called...  has anyone experienced this before?  How did you get around it?

Thanks!

Jason



Re: [PHP] session_unset session_destroy being called outside of logic.

2001-09-13 Thread Jason Bell

I think I found the answer, but please feel free to still add anything to
this:

session_destroy() terminates the session, which cannot be started up again
until the browser is restarted...

sooo... I just removed session_destroy, and settled for using sess_unset()
to log out of a session.

using this method the session is still open, and the session variables are
still registered. since they are still registered, they can still be used on
the chance that I log in again, correct?

seems to be working fine, but if there are caveats, feel free to let me
know.  thanks!

- Original Message -
From: Jason Bell [EMAIL PROTECTED]
To: PHP Users [EMAIL PROTECTED]
Sent: Thursday, September 13, 2001 3:12 PM
Subject: [PHP] session_unset  session_destroy being called outside of
logic.


Hello all!   I am switching a variable to check if a user is logging in or
logging out. If the value of the variable is logout, I want the user to
logout, i.e:

case logout:
   session_unset();
   session_destroy();
   $AuthErr = FONT SIZE=-1 COLOR=redSession Terminated/FONT;
   break;


What is happening, is after the user authenticates and logs in, everything
looks good, but whenever the user follows any link, the session gets unset
and destroyed. I know that the variable that holds the logout value isn't
even present, so I'm not sure how it's getting called...  has anyone
experienced this before?  How did you get around it?

Thanks!

Jason



-- 
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] session_unset session_destroy being called outside of logic.

2001-09-13 Thread Jason Bell

Thanks for the reply Kirk!


  case logout:
 session_unset();
 session_destroy();
 $AuthErr = FONT SIZE=-1 COLOR=redSession Terminated/FONT;
 break;
 
 
  What is happening, is after the user authenticates and logs
  in, everything
  looks good, but whenever the user follows any link, the
  session gets unset
  and destroyed.


 Have you verified that the session file actually disappears? This sounds
 more like the session ID is not getting passed along to the next page, so
 that PHP is not aware that a session already exists (and so starts a new
 one). The session ID is usually passed between pages using a cookie. The
ID
 is what allows PHP to find the correct session file and restore the
session
 variable values.


This is what was happening when I first had the problem. I removed the call
to session_destroy() from my code, and it seems to be working perfectly now.

again, thanks for the response!

-Jason


-- 
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] Re: problem with form values

2001-09-12 Thread Jason Bell

PHP Is server side. The form data, until it is submitted is client side.

If you need to manipulate the form data before processing it (i.e for
validation, etc) you can either build that logic into your processing code,
or have the form call an intermediate set of code that does what you need to
do, and then passes control to the form processing code.

If you really need to work with the data before it is sent back to the
server, you need to look at a javascript solution.

-Jason


- Original Message -
From: Niklas Lampén [EMAIL PROTECTED]
To: James Holloway [EMAIL PROTECTED]; Php-General
[EMAIL PROTECTED]
Sent: Wednesday, September 12, 2001 3:08 AM
Subject: RE: [PHP] Re: problem with form values


 Heh, we seem to have a bit of a problem with communicating with each
other..
 :)

 What I ment with the question is that how can I do something to the string
 before the form sends information to the next page? So can I somehow
modify
 strings after pressing submit but before next page? Something like
 onSubmit=blah().


 Niklas


 -Original Message-
 From: James Holloway [mailto:[EMAIL PROTECTED]]
 Sent: 12. syyskuuta 2001 12:01
 To: Niklas Lampén
 Cc: [EMAIL PROTECTED]
 Subject: [PHP] Re: problem with form values


 Sorry,

 I didn't mean it quite like that.  After the user presses submit


 $string = htmlentities($string);

 // now, do whatever with the string

 J
   - Original Message -
   From: Niklas Lampén
   To: James Holloway ; Php-General
   Sent: Wednesday, September 12, 2001 9:52 AM
   Subject: RE: problem with form values


   How to do anything to the strings in php BEFORE the form is sent?


   Niklas


   -Original Message-
   From: James Holloway [mailto:[EMAIL PROTECTED]]
   Sent: 12. syyskuuta 2001 11:28
   To: Niklas lampén
   Subject: Re: problem with form values


   Hi Niklas,

   use htmlentities() or htmlspecialchars() on the string before the form
is
   sent.  See the manual for more info.

   James

   - Original Message -
   From: Niklas lampén
   Newsgroups: php.general
   To: Php-General
   Sent: Wednesday, September 12, 2001 8:32 AM
   Subject: problem with form values


   If a user enters a quota (  ) to a form field and sends it, the page
 trying
   to process values gets only a backslash ( \ ). No matter if I use GET or
   POST. How to get the right kind of a value?


   Niklas



 --
 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] Re: Hierarchic menus using Javascript and PHP?

2001-09-12 Thread Jason Bell

I believe I do what you are attempting to do, in pure PHP using a switch
statement and variables. It works, (check www.northpointless.org to see it
in action) but keep in mind my site is in early developement, so the menu
options aren't quite fleshed out at this time.:

function menu ($pos, $sub = none, $sub2 = none) {
 global $PHP_SELF;
 global $sess_auth;
 switch($pos) {
  case main:
   print BA HREF=$PHP_SELFHome/A;
   print BRA
HREF=$PHP_SELF?sub=Commaction=CommCommunity/A;
   print BRA HREF=$PHP_SELF?sub=JFFaction=JFFAfter
Hours/A;
   print /B;
   break;
  case secondary:
   switch($sub2) {
case WOS:
 $wos = FONT SIZE=-1BAdd Slander/FONT;
 break;
   }
   switch($sub) {
case Comm:
 print BMessage Boards;
 print BRMailing List;
 print BRJob Listings;
 print BRMember Directory;
 print /B;
 break;
case JFF:
 print BA
HREF=$PHP_SELF?action=wosaction_args=showsub=JFFsub2=WOSWall Of
Slander/B/A;
 if ($wos) { print BR$wos; };
 break;
   }
   break;
 }
}
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: Nelson Goforth [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, September 11, 2001 10:13 PM
Subject: [PHP] Re: Hierarchic menus using Javascript and PHP?


 See my response to Girish' post.
 You can't have JavaScript talking to PHP in real-time for
user-interaction.
 You either need to send your ENTIRE tree to JavaScript, or make the user
 choose on each page from a sub-menu...

 For that, you would just need to have JavaScript set the location to
 something involving the ID of the sub-category so PHP can then generate a
 new menu.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 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: Nelson Goforth [EMAIL PROTECTED]
 Newsgroups: php.general
 To: [EMAIL PROTECTED]
 Sent: Monday, September 10, 2001 3:06 PM
 Subject: Hierarchic menus using Javascript and PHP?


  On my site I have a page that takes input into a MySQL database
  (though this isn't a db question).
 
  Each entry has a category and a subcategory entry, which should come
  from predefined lists and are therefore instituted as pull-down
  lists.  The category list is in a PHP array which feeds a SELECT
  pull-down list.  The subcategory choices should depend upon what
  category is selected.  In order to ease user input, I've used a
  javascript function to cause the subcategory pulldown to depend upon
  the category selection.  Thus if the category is Animals, the
  subcategory SELECT would show dog, cat, fish - but if the
  category were Colors the possible subcategories might be Red,
  Green, Yellow, Puce.
 
  On the initial entry - a blank record - this all works fine.  But if
  I go back in to modify a record I run into trouble, as I can't make
  the page reflect the stored value of the subcategory within the
  pull-down list (i.e. as the SELECTED item).
 
 
  I use the following PHP code to display the $categories array - and
  if there is a stored value ( $formValues[category] ) it displays
  that selection as SELECTED - which is exactly right.
 
 printf(TRTDCategory /TD);
 printf(TDSELECT NAME=category ONCHANGE=\updateCats()\\n);
 printf(OPTION VALUE=0 === Select One === /OPTION\n);
 
 $i=0;
 while ($i  count($categories)) {
   printf(OPTION VALUE=%s %s%s/OPTION\n,
 $categories[$i],
 $categories[$i] == $formValues[category] ? SELECTED : ,
 $categories[$i]);
   $i++;
 }
 
 printf(/SELECT/TD/TR);
 
  But when it comes to the Sub-Category the list that feeds the SELECT
  list is not in an array, but is coming from the JavaScript function
  like:
 
 if(subCategoryIndex == 1)  // Colors
   document.search.subcategory.options[1] = new Option('Red');
   document.search.subcategory.options[1].value = red;
   document.search.subcategory.options[2] = new Option('Blue');
   document.search.subcategory.options[2].value = blue;
   ...etc...
 
  I can't figure a way to make the 'Update' version of the page display
  the value of the Sub-Category in a select list (so that the user CAN
  update it).  I can certainly have the value display, but it no long
  has the other possible members of the list, since it's not coming
  from a display.
 
  I couldn't see a way to do this (updating one form element from
  another) completely in PHP - else I would have.
 
  Does anyone have any ideas?
 
  Could I feed a PHP array FROM JavaScript?  If I could get the
  subcategory selection list into an arry I think I could make this
  work.
 
  Or possibly use another 

[PHP] Ip Address to binary

2001-09-12 Thread Jason Bell

does anyone know of a way to convert an IP address to Binary using PHP? My plan is to 
store the IP address in MySQL so that I can manage a mass amount of IP subnets, and 
easily make sure I'm not assigning duplicate subnets.  the best way I can think of is 
to use binary.

any other ideas, thoughts or comments?


Thanks!

-Jason Bell



Re: [PHP] Ip Address to binary

2001-09-12 Thread Jason Bell

I want to add I have seen bindec() , and I think it's a cruel cruel joke
for it to only work with 31 bits, given that ip4 addresses are 32 bits.  :}

- Original Message -
From: Jason Bell [EMAIL PROTECTED]
To: PHP Users [EMAIL PROTECTED]
Sent: Wednesday, September 12, 2001 2:29 PM
Subject: [PHP] Ip Address to binary


does anyone know of a way to convert an IP address to Binary using PHP? My
plan is to store the IP address in MySQL so that I can manage a mass amount
of IP subnets, and easily make sure I'm not assigning duplicate subnets.
the best way I can think of is to use binary.

any other ideas, thoughts or comments?


Thanks!

-Jason Bell



-- 
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] Dynamic Form

2001-09-12 Thread Jason Bell

PHP does not know what the user has selected in the first drop down.

You can either reload the page with the new value once the user has selected
the value for the first drop down list, and go from there, or use
Javascript.


- Original Message -
From: Jared Mashburn [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 12, 2001 3:45 PM
Subject: [PHP] Dynamic Form


 Hell0,

 I have a MySql database with 3 columns.  The first column is id second
 is name and third is value, I have two drop-down lists, with the
 first filled with an array from the column name.  I would like for the
 second drop-down list be changed according to the value of what has
 been selected in the first drop-down list.
 I have fill that I'm going in the right direction, but have run into a
 wall. Can anyone give me some advice in doing this miraculous feat?

 Thanks,

 Jared


 --
 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] Reprise of dissapearing session variables

2001-09-10 Thread Jason Bell

Yeah, we narrowed it down to the cluster as causing the problem friday
night. My host is working to figure out a solution. They have a few ideas,
but haven't tested them yet.

session files get saved in /tmp by default, correct?  Is there a way to have
them saved somewhere that would propogate to all the servers in the cluster?

Has anyone out there been faced with this before? How did you get around it,
or did you just give up?

Thanks!

Jason

- Original Message -
From: Johnson, Kirk [EMAIL PROTECTED]
To: PHP Users [EMAIL PROTECTED]
Sent: Monday, September 10, 2001 7:17 AM
Subject: RE: [PHP] Reprise of dissapearing session variables


  The session  variables will remain set, but will it looks
  like my session gets lost every now and then  if you want
  to see an example, go to http://northpointless.org/test.php
  and hit refresh several times. I cannot figure out what is happening.

 Did you get this figured out? It looks like you are running on a
 load-balanced web farm. If so, and you are saving session data in files,
 there's your problem. The session file is saved on the server that handles
 the first request. When later requests go to a different machine, the
 session file can't be found, since it is on the first server.

 Kirk

 --
 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] Reprise of dissapearing session variables

2001-09-10 Thread Jason Bell

Thanks for the input Kirk!

Unfortunately, I don't have the ability modify my php.ini (virtual hosting).
Also, if I saved the session data in the database, I'd have to perform a
database query to get it at the beginning of each page.  That's probably not
good for performance.  :/

option #1 interests me  what do you use to achieve this?  I might be
able to suggest it to my host...  they are extremely accommodating.

I think option #3 is the best solution, if it's possible. (I'm not sure if
it is or not without modifying the php.ini file) I've been trying to to
figure it out.  My host is also looking into a fix, so when I find something
out, I'll let you all know.  :)


-Jason
- Original Message -
From: Johnson, Kirk [EMAIL PROTECTED]
To: PHP Users [EMAIL PROTECTED]
Sent: Monday, September 10, 2001 12:24 PM
Subject: RE: [PHP] Reprise of dissapearing session variables


  session files get saved in /tmp by default, correct?  Is
  there a way to have
  them saved somewhere that would propogate to all the servers
  in the cluster?

 Warning! The following is from me, a non-gearhead.

 1. We use a load balancer which is able to set a cookie on the first page
 request. The cookie contains the ID of the server that handles that first
 request. On all subsequent requests, the cookie is used to route the
request
 to the original server.

 2. Haven't done this, but you could also put the session data in a
database.
 See the php.ini file for the session handler setting.

 3. I believe I read that there is a way to save the session files to a
drive
 that is mountable by all the cluster servers. End of my knowledge on this
 one!

 Kirk

 --
 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] updating several lines in a text file while leaving rest of file untouched

2001-09-10 Thread Jason Bell

how much are they paying for their hosting?  I mean seriously you can
get a PHP enabled host that offers MySQL database for next to nothing these
days.


But, apart from that

you could read the file into an array, making each line an element within
the array. Modify what you need to modify, and then write the array back out
to the file, overwriting it with the updated information.


- Original Message -
From: Kurt Lieber [EMAIL PROTECTED]
To: 'Mark' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, September 10, 2001 2:26 PM
Subject: RE: [PHP] updating several lines in a text file while leaving rest
of file untouched


 agreed, except it's for a client who doesn't have database access at
 their ISP and doesn't wish to pay more to get database access.  So, I'm
 stuck using a text file for now.

 --kurt

  -Original Message-
  From: Mark [mailto:[EMAIL PROTECTED]]
  Sent: Monday, September 10, 2001 2:17 PM
  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Subject: Re: [PHP] updating several lines in a text file
  while leaving rest of file untouched
 
 
  On Mon, 10 Sep 2001 14:15:36 -0700, Kurt Lieber wrote:
  I have a configuration file that I use to store several variables
  and
  would like to provide a web-based interface to update this form.
   I'm
  having some trouble replacing part of the file while leaving
  the rest
  of it intact.
  
  An example of the config file is:
  
  $eventInfo[1][1] = First Event Title;
  $eventInfo[1][2] = 145;
  $eventInfo[1][3] = 300;
  
  $eventInfo[2][1] = Second Event Title;
  $eventInfo[2][2] = 50;
  $eventInfo[2][3] = 1500;
  
  
  What I can't figure out is how to selectively update certain lines,
  while leaving all the other lines intact and without changing the
  structure or order of the page. So, if I wanted to change
  $eventInfo[1][2] to 150 and $eventInfo[2][3] to 2000, how
  can I do that
  without mucking up the rest of the page?  I can update any one line
  by
  using something like the following:
  
  $fd = fopen($configFile, r+); file://open the file and truncate it.
  $newContents = eregi_replace(eventInfo\[1\]\[1\] =
  \.*\;,eventInfo[1][1] = \ . $form_eventTitle .
  \;,$contents);
  $newFile = fwrite($fd,$newContents);
  
  but if I try to update more than one line, it causes the rest of my
  file to get truncated or other weird things to happen.
  
  Any help is appreciated.
 
  you should seriously think about using a database for this.
 
 


 --
 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] Stripslashes question.

2001-09-10 Thread Jason Bell

try addslashes instead.  You might have better luck.

- Original Message - 
From: Sean C. McCarthy [EMAIL PROTECTED]
To: PHP General List [EMAIL PROTECTED]
Sent: Monday, September 10, 2001 2:42 PM
Subject: [PHP] Stripslashes question.


 Hi all,
 
 What will be the way to convert binary information into a string which
 will get into an SQL query for MySQL? I tried stripcslashes but I got
 stucked with it. Any help?
 
 Thanks in advance.
 
 Sean C. McCarthy
 SCI, S.L. (www.sci-spain.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 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] execute a script on access to a directory

2001-09-07 Thread Jason Bell

You could always add an include() for every page under the /go directory.

Simplest way that I can think of.


- Original Message - 
From: Enrique Vadillo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 12:09 PM
Subject: [PHP] execute a script on access to a directory


 Hi,
 
 I would like to know how i can force a PHP script to be
 executed everytime a certain directory is accessed, for
 example in http://domain.com/go/getit the presence of the
 /go/ directory would force a PHP script to be executed
 prior to any operation.
 
 Do i need to play with rewriting urls in Apache or is
 there any other cleaner method (that would not require
 rewriting URLs) to achieve this? i'd hate to have to
 rewrite URLs...
 
 thanks.
 
 Enrique-
 
 
 _
 Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
 
 
 -- 
 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] Re: run a script for any HTTP request (was: run a script on access to a directory)

2001-09-07 Thread Jason Bell

Explorer does support 404 documents.  You just have to make sure the
document is bigger than 512 bytes.


- Original Message -
From: Enrique Vadillo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 2:36 PM
Subject: Re: [PHP] Re: run a script for any HTTP request (was: run a script
on access to a directory)


 MSIE does not support 404 ErrorDocument, that only works fine
 with Netscape. Rewriting URLs is nasty when you have to mix
 it with php script writing, this could be so much simpler with
 a php script.

 I know it's a tough question, anyone dares to beat the problem?

 Enrique-

 From: Philip Hallstrom [EMAIL PROTECTED]
 To: Enrique Vadillo [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED]
 Subject: [PHP] Re: run a script for any HTTP request (was: run a script
on
 access to a directory)
 Date: Fri, 7 Sep 2001 14:15:52 -0700 (PDT)
 
 What's wrong with rewriting urls?  The other alternative is to make sure
 that none of the urls you are accessing actually exist and then setup an
 ErrorDocument handler which calls the php script of your choice... which
 can then do whatever you want...
 
 -philip
 
 On Fri, 7 Sep 2001, Enrique Vadillo wrote:
 
   That was a fine idea Doug, but what if we push the subject and
   go a little further?
  
   I am thinking now that i'd like to make it possible that for
   ANY http request received by my Apache i'd like to have a php
   script executed first, i.e.:
  
   http://domain.com/
   http://domain.com/anydir/anyfile
  
   for any of those locations typed, i'd like to be able to
   execute the php script. i know it's kinda weird but this is
   what i'm really looking for. any ideas anyone?
  
   Enrique-


 _
 Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp


 --
 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] Re: run a script for any HTTP request (was: run a script on access to a directory)

2001-09-07 Thread Jason Bell

IE has Friendly Error Messages so on a normal 404 response, IE would show
it's own error message, and not the one from the server. The Documented way
around this is to ensure that your 404 document is larger than 512 bytes.

http://www.zdnet.com/products/stories/reviews/0,4161,2779295-3,00.html


- Original Message -
From: Rasmus Lerdorf [EMAIL PROTECTED]
To: Enrique Vadillo [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, September 07, 2001 2:45 PM
Subject: Re: [PHP] Re: run a script for any HTTP request (was: run a script
on access to a directory)


 What do you mean MSIE does not support 404 ErrorDocument?  That is a
 server-side function.  It has absolutely nothing to do with the browser.
 Try going to: http://php.net/strlen

 That is an ErrorDocument 404 thing that kicks in and takes you to the
 right place in the PHP documentation.  And believe me, it works just fine
 for people using MSIE.

 Right now an ErrorDocument 404 is the only way to do this.  I am currently
 working on the framework to allow PHP scripts to be inserted at any stage
 in the Apache request_rec handler mechanism.  This would allow you to run
 a PHP script to translate uri's to on-disk pathnames for example, write
 Apache authentication modules in PHP and many many other efficient ways to
 shoot yourself in the foot.  Needs another week or two of development
 before it will be ready for serious testing though.

 -Rasmus

  MSIE does not support 404 ErrorDocument, that only works fine
  with Netscape. Rewriting URLs is nasty when you have to mix
  it with php script writing, this could be so much simpler with
  a php script.
 
  I know it's a tough question, anyone dares to beat the problem?
 
  Enrique-
 
  From: Philip Hallstrom [EMAIL PROTECTED]
  To: Enrique Vadillo [EMAIL PROTECTED]
  CC: [EMAIL PROTECTED]
  Subject: [PHP] Re: run a script for any HTTP request (was: run a script
on
  access to a directory)
  Date: Fri, 7 Sep 2001 14:15:52 -0700 (PDT)
  
  What's wrong with rewriting urls?  The other alternative is to make
sure
  that none of the urls you are accessing actually exist and then setup
an
  ErrorDocument handler which calls the php script of your choice...
which
  can then do whatever you want...
  
  -philip
  
  On Fri, 7 Sep 2001, Enrique Vadillo wrote:
  
That was a fine idea Doug, but what if we push the subject and
go a little further?
   
I am thinking now that i'd like to make it possible that for
ANY http request received by my Apache i'd like to have a php
script executed first, i.e.:
   
http://domain.com/
http://domain.com/anydir/anyfile
   
for any of those locations typed, i'd like to be able to
execute the php script. i know it's kinda weird but this is
what i'm really looking for. any ideas anyone?
   
Enrique-
 
 
  _
  Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp
 
 
 


 --
 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] Reprise of dissapearing session variables

2001-09-07 Thread Jason Bell

ok! I've been trying to figure this out, and I'm completely stumped! I've started from 
scratch with a test script, here is my code:

?
session_start();
if (!$PHPSESSID) {
 $sess_name = Jason;
 $sess_auth = 1;
 session_register(sess_name);
 session_register(sess_auth);
};
print CENTERTestingB/CENTER;
print $PHPSESSID;
print BR\$sess_name is: $sess_nameBR\$sess_auth is: $sess_auth;
if ($go) {
 print BRGo was initiated;
 $sess_name = BillyBob;
};
if (session_is_registered(sess_name) != FALSE) {
 print BR\$sess_name is registered with the session!;
} else {
 print BR\$sess_name is BNOT/B registered with the session!;
};
?

The session  variables will remain set, but will it looks like my session gets lost 
every now and then  if you want to see an example, go to 
http://northpointless.org/test.php  and hit refresh several times. I cannot figure out 
what is happening.



[PHP] Dissapearing Session Variables (long post)

2001-09-05 Thread Jason Bell

Hello! I'm trying to figure out why my session variables keep hiding 

Background:

On my site, I have a login box, which allows you to login. This login box works as 
expected. It authenticates the provided credentials against my database, and then sets 
some pre-registered session variables to values pulled from the DB. What I am 
experiencing, is that my session variables will be defined, and then lose their values 
when the first link is followed. I've placed a reference to $PHPSESSID into the title 
of the page, and note that the $PHPSESSID remains constant. Is there something in my 
code that is causing this? Is there a way that I can rewrite my code to help avoid 
this?

Here is my index.php, other relevent code to follow:

?
include(include/user.conf);
if (!$theme) { $theme = default; };
include(include/core_functions.php);
if ($AuthAction) {
 switch($AuthAction) {
  case login:
   include(include/db.conf);
 $sql = SELECT uid,username,password,first,last,acl FROM users WHERE 
username='$username' AND password=PASSWORD('$password');
 $result = mysql_query($sql) or die ('Unable to execute SQL Query.');
 $dberror=mysql_error();
 $dbnum=mysql_errno();
 if ($dberror) {
   $AuthErr = $dberror;
} else {
 $num = mysql_numrows($result);
 if ($num !=0) {
   $sess_uid = mysql_result($result,0,uid);
 $sess_acl = mysql_result($result,0,acl);
 $sess_fname = mysql_result($result,0,first);
 $sess_lname = mysql_result($result,0,last);
 $sess_uname = mysql_result($result,0,username);
 $sess_auth = 1;
  } else { 
   $AuthErr = FONT SIZE=-1 COLOR=REDLogin Incorrect!/FONT;
  };
};
   break;
  case logout:
   break;
 }
};
if (!$action) { $action = tba; };
if (!$title) { $title = $PHPSESSID; };
if (!$headline) { $headline = H2An E-Haven for Displaced NorthpointersH2; };
include(Themes/.$theme./.$theme..theme);
?

Here is user.conf:

?php
if (!$PHPSESSID) {
  $sess_uid = ;
  $sess_acl = ;
  $sess_fname = ;
  $sess_lname = ;
  $sess_uname = ;
  $sess_auth = ;
  session_register('sess_uid');
  session_register('sess_acl');
  session_register('sess_fname');
  session_register('sess_lname');
  session_register('sess_uname');
  session_register('sess_auth');
  };
?


Shouldn't this work?  I reference the session variables within functions, but that 
shouldn't effect anything. I always make sure to call global for each variable before 
I use itany ideas?

Thanks in advance!

Jason Bell



Re: [PHP] Newbie Question: mysqldump via PHP

2001-09-04 Thread Jason Bell

the unix command to see where an executable is, is which. Example: which
mysqldump

- Original Message -
From: Tony Frasketi [EMAIL PROTECTED]
To: Sam Masiello [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, September 04, 2001 11:53 AM
Subject: Re: [PHP] Newbie Question: mysqldump via PHP


 Hi Sam
 No I haven't tried this since I'm on a virtual server and don't know
 where mysqldump is located. I tried doing a phpinfo() to see if I could
 get the mysqldump location from there but I didn't see it in the mysql
 section of the phpinfo listing. Do you know of a unix shell command I
 could use to get the location of mysqldump?

 Tony

 Sam Masiello wrote:
 
  Have you tried putting in the fully qualified pathname to the mysqldump
  executable?
 
  /usr/somepath/mysqldump  rest of your command here
 
  HTH
 
  Sam Masiello
  Software Quality Assurance Engineer
  Synacor
  (716) 853-1362 X289
  [EMAIL PROTECTED]
 
  -Original Message-
  From: Tony Frasketi [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, September 04, 2001 2:28 PM
  To: Sam Masiello
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Newbie Question: mysqldump via PHP
 
  Hi Sam
  Thanks for the reply. I had the permission set for 777 so that should
  allow access to the directory for writing from PHP, should it not?
 
  Also I tried specifying /tmp/db.dump in the command and had the tmp
  directory permission also set for 777 but still get same results. The
  file get written but it's still set to zero bytes.
 
  Any other suggestions would be greatly appreciated.
 
  Sam Masiello wrote:
  
   I would say that you have a permission problem with where PHP is
  trying
   to write the file to.  Try outputting the file to /tmp/db.dump and see
   if you have the same problem.
  
   HTH
  
   Sam Masiello
   Software Quality Assurance Engineer
   Synacor
   (716) 853-1362 X289
   [EMAIL PROTECTED]
  
   -Original Message-
   From: Tony Frasketi [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, September 04, 2001 1:56 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Newbie Question: mysqldump via PHP
  
   Hello listers
  
   I'm trying to implement a mySQL database dump via PHP4 on a unix
  system
   as follows...
  
  --
  $result = exec(mysqldump -umyname --password=mypassword
 tablename db.dump,$xarray,$status);
  echo status[$status]br;
  --
  
   I get the following error PHP error message...
  
  status[127]
  
   and the file 'db.dump' has been created but it has 0 bytes.
  
  -rw-r--r-- 1 nobody nobody 0 Sep 4 13:27 db.dump
  
   Although I can execute the mysqldump program from the unix shell and I
   get...
  
  -rw-r--r-- 1 myname myname 23704 Sep 4 13:18 db.dump
  
   My questions are...
  
1. Can the mysqldump program be executed via PHP or not and if not
   can you please explain why?
  
2. Is there another way of doing this via PHP?
  
   Thanks in advance
   Tony Frasketi
   P.S. Please answer direct, since I'm only subscribed to the digest.
  
   --
   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] Newbie Question: mysqldump via PHP

2001-09-04 Thread Jason Bell

Have you tried storing the mysqldump output to a string and then using PHP
to open a file, dump the string into the file, and then close the file?

Might work that way...

- Original Message -
From: Tony Frasketi [EMAIL PROTECTED]
To: Sam Masiello [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, September 04, 2001 12:39 PM
Subject: Re: [PHP] Newbie Question: mysqldump via PHP


 Hi Sam
 Thanks to suggestions from jason, Alexander, and yourself I tried the
 unix which command and found that mysqldump was located at...

/usr/bin/ directory

 And I changed my exec command to include this directory but alas, the
 results were the same.

 Is it possible that the mysqldump command cannot be run from PHP under
 user nobody?

 Still appreciative of any other ideas I can try!
 Tony F.

 Sam Masiello wrote:
 
  Have you tried putting in the fully qualified pathname to the mysqldump
  executable?
 
  /usr/somepath/mysqldump  rest of your command here
 
  HTH
 
  Sam Masiello
  Software Quality Assurance Engineer
  Synacor
  (716) 853-1362 X289
  [EMAIL PROTECTED]
 
  -Original Message-
  From: Tony Frasketi [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, September 04, 2001 2:28 PM
  To: Sam Masiello
  Cc: [EMAIL PROTECTED]
  Subject: Re: [PHP] Newbie Question: mysqldump via PHP
 
  Hi Sam
  Thanks for the reply. I had the permission set for 777 so that should
  allow access to the directory for writing from PHP, should it not?
 
  Also I tried specifying /tmp/db.dump in the command and had the tmp
  directory permission also set for 777 but still get same results. The
  file get written but it's still set to zero bytes.
 
  Any other suggestions would be greatly appreciated.
 
  Sam Masiello wrote:
  
   I would say that you have a permission problem with where PHP is
  trying
   to write the file to.  Try outputting the file to /tmp/db.dump and see
   if you have the same problem.
  
   HTH
  
   Sam Masiello
   Software Quality Assurance Engineer
   Synacor
   (716) 853-1362 X289
   [EMAIL PROTECTED]
  
   -Original Message-
   From: Tony Frasketi [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, September 04, 2001 1:56 PM
   To: [EMAIL PROTECTED]
   Subject: [PHP] Newbie Question: mysqldump via PHP
  
   Hello listers
  
   I'm trying to implement a mySQL database dump via PHP4 on a unix
  system
   as follows...
  
  --
  $result = exec(mysqldump -umyname --password=mypassword
 tablename db.dump,$xarray,$status);
  echo status[$status]br;
  --
  
   I get the following error PHP error message...
  
  status[127]
  
   and the file 'db.dump' has been created but it has 0 bytes.
  
  -rw-r--r-- 1 nobody nobody 0 Sep 4 13:27 db.dump
  
   Although I can execute the mysqldump program from the unix shell and I
   get...
  
  -rw-r--r-- 1 myname myname 23704 Sep 4 13:18 db.dump
  
   My questions are...
  
1. Can the mysqldump program be executed via PHP or not and if not
   can you please explain why?
  
2. Is there another way of doing this via PHP?
  
   Thanks in advance
   Tony Frasketi
   P.S. Please answer direct, since I'm only subscribed to the digest.
  
   --
   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] GOOD web hosting

2001-09-04 Thread Jason Bell

I recently moved all of my domains to www.prohosters.com and have been
nothing but pleased with them.

They offer unlimited (within reason):
space (their plans list disk quotas but they will be the first to tell
you that they ignore them)
pop3 accounts
MySQL Databases
Domain Names.  (I have 4 domains, under one $15 hosting account)
usernames. (Why is this usefull? Of my 4 domains, I manage 2, and my
wife manages 2... we each have seperate usernames to keep
things seperate. Could also work if you wanted to resell bandwidth)
100 Unique IP Addresses (one time charge of $1 per for every IP after
the initial 100)
PHP3  4
Custom DNS.
Your Choice of UNIX or Windows 2k Hosting.
Global CGI access
No setup fee
And much much more

but the best thing about them is their support... their support is available
24/7 via ICQ/AIM/Yahoo/IRC. They do whatever they can to keep you happy.

Their pricing is based on bandwidth usage, and starts out at $15 a month for
5Gig of data transfer. They run their servers as a cluster for high
performance and availability  the MySQL server is seperated from the
HTTP server, and they have a seperate server for report generation...

if you want a Hey! look! If they can handle *THAT* site, they can handle
mine type of example, they are the people who host www.stileproject.com



- Original Message -
From: Seb Frost [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 04, 2001 3:58 PM
Subject: [PHP] GOOD web hosting


 I thought I had good web hosting, but I don't.  They're often very slow
and
 frequently (I'd say at least an hour every day) my site is inaccessable.
 Today I've barely been able to get on it at all.

 So I'm moving.

 I'm in the UK.  Is it stupid for me to go with a US hoster?  And either
way
 who do you recommend?  Obviously I want php and mysql support, and a few
 hundred megs of space, and NOT paying through the roof.  $20/month tops.

 - seb
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.274 / Virus Database: 144 - Release Date: 23/08/2001


 --
 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] help again

2001-08-31 Thread Jason Bell

All you should need to do is echo H1$beer's taste is great/H1;

don't use the braces.

-Jbell
- Original Message -
From: Nikola Veber [EMAIL PROTECTED]
To: php forum [EMAIL PROTECTED]
Sent: Friday, August 31, 2001 9:38 AM
Subject: [PHP] help again


 I am having big troubles here. I wrote this code just as it said in the
manual, and
 it prints
 {$beer}'s taste is great;?

 html
 head
 titlePHP Test/title
 /head
 body
 ?php
 $beer = 'Heineken';
 echo h1{$beer}'s taste is great/h1;
 ?
 /body
 /html

 and if I don't put  string into h1 it prints nothing !

 I'm kind of confused right now ...

 (win98, opera 5.12, php installed with installShield)


 --
 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] help again

2001-08-31 Thread Jason Bell

do yourself a favor... create a file, call it something like test.php and
add the following to it's contents:
/*  begin test.php */
?php
phpinfo();
?
/* End test.php  */

then, open this page with your browser. if PHP is working, you should see a
lot of configuration  and version information, and the PHP logo etc  if
you don't see that, then your installation is broken.


- Original Message -
From: Nikola Veber [EMAIL PROTECTED]
To: Andrey Hristov [EMAIL PROTECTED]; php forum
[EMAIL PROTECTED]
Sent: Friday, August 31, 2001 11:00 AM
Subject: Re: [PHP] help again


 The code of your's print's the following :

 $beer's taste is great;?

 I'm not sure if there could be a problen in configuring PHP, since the
only thing
 I have done was making html page
 containing this code.

 8/31/01 6:42:02 PM, Andrey Hristov [EMAIL PROTECTED] wrote:

 html
 head
 titlePHP Test/title
 /head
 body
 ?php
 $beer = 'Heineken';
 echo h1$beer's taste is great/h1;
 ?
 /body
 /html
 
 Andrey Hristov
 IcyGEN Corporation
 http://www.icygen.com
 BALANCED SOLUTIONS
 
 
 - Original Message -
 From: Nikola Veber [EMAIL PROTECTED]
 To: php forum [EMAIL PROTECTED]
 Sent: Friday, August 31, 2001 7:38 PM
 Subject: [PHP] help again
 
 
  I am having big troubles here. I wrote this code just as it said in the
manual,
 and
  it prints
  {$beer}'s taste is great;?
 
  html
  head
  titlePHP Test/title
  /head
  body
  ?php
  $beer = 'Heineken';
  echo h1{$beer}'s taste is great/h1;
  ?
  /body
  /html
 
  and if I don't put  string into h1 it prints nothing !
 
  I'm kind of confused right now ...
 
  (win98, opera 5.12, php installed with installShield)
 
 
  --
  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] chmod failed: Operation not permitted

2001-08-31 Thread Jason Bell

at your unix prompt, (assuming you are running apache) enter the command
ps -ef |grep httpd

you should see the httpd (apache) process, and who owns it. Typicly this is
the user nobody. Your file needs to be owned by the user that owns the
httpd process.

- Jason Bell

- Original Message -
From: Police Trainee [EMAIL PROTECTED]
To: PHP [EMAIL PROTECTED]
Sent: Friday, August 31, 2001 11:50 AM
Subject: Re: [PHP] chmod failed: Operation not permitted


 the files are all owned by me, that is, my unix login.
 --- Jason Bell [EMAIL PROTECTED] wrote:
   who owns the file to begin with? your account?  a
  web server typically runs
  as a low access account, such as nobody on Unix.
  So, what is probably
  happening is that you don't have permissions to
  chmod the file. Doesn't have
  anything to do with your PHP configuration.
 
  Jason Bell
 
  - Original Message -
  From: Police Trainee [EMAIL PROTECTED]
  To: PHP [EMAIL PROTECTED]
  Sent: Friday, August 31, 2001 11:43 AM
  Subject: [PHP] chmod failed: Operation not permitted
 
 
   can anyone help?
   safe mode is set to 0, which i believe is off.
  
   i put a chmod command in one of my scripts and got
  the
   following error on running it:
  
   Warning: chmod failed: Operation not permitted in
   /path-here/index.phtml on line 1
  
   why won't chmod work?
  
   the chmod command i used is:
  ?chmod(../index.phtml,
   0646);write data to file that has been made
   world-writable here; chmod(../index.phtml,
  0644);}?
  
   the full error printout is:
  
   Warning: chmod failed: Operation not permitted in
   /path-here/index.phtml on line 1
  
   Warning: fopen(../index.phtml,a) - Permission
   denied in
   /path here/index.phtml on line 1
  
   Warning: Unable to find file identifier 0 in
   /path here/index.phtml on line 2
  
   Warning: chmod failed: Operation not permitted in
   /path-here/index.phtml on line 2
  
   I know the second error is because the file wasn't
   made world-writable so it wasn't able to write to
  it,
   i don't know what the third error is for
  
   __
   Do You Yahoo!?
   Get email alerts  NEW webcam video instant
  messaging with Yahoo!
  Messenger
   http://im.yahoo.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]
  
  
 


 __
 Do You Yahoo!?
 Get email alerts  NEW webcam video instant messaging with Yahoo!
Messenger
 http://im.yahoo.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 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] unset($PHP_AUTH_USER, $PHP_AUTH_PW)

2001-08-29 Thread Jason Bell

anyone know why this isnt working for me?

if (isset($PHP_AUTH_USER)  isset($PHP_AUTH_PW)) {
CheckCredentials($PHP_AUTH_USER,$PHP_AUTH_PW);
unset ($PHP_AUTH_USER, $PHP_AUTH_PW);
} else if ($AuthAction) {
auth($AuthAction);
};

If someone submits false credentials, the page keeps $PHP_AUTH_USER and $PHP_AUTH_PW, 
and won't allow another login attempt until the browser is closed. Is there another 
way to effectively unset the variables?

Thanks,

Jason Bell







Re: [PHP] Posting to oneself

2001-08-29 Thread Jason Bell

if you are within a function, try doing this first:

global $PHP_SELF;

- Original Message -
From: John Meyer [EMAIL PROTECTED]
To: Alexander Skwar [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, August 29, 2001 4:15 PM
Subject: Re: [PHP] Posting to oneself


At 12:07 AM 8/30/01 +0200, you wrote:
So sprach »John Meyer« am 2001-08-29 um 15:57:02 -0700 :
  Two questions:
  1.  Can I tell a form to post to itself without specifying the name of
the
  web page?

form action=?php echo $PHP_SELF;?


I am getting this error:

Undefined variable: PHP_SELF


--
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] HTML file with variable replacement.

2001-08-02 Thread Jason Bell

Ok, I'm trying to seperate my php from my html  the method I've been
trying to use is like so:

$html = fread(fopen(htmlpage.html, r), filesize(htmlpage.html));
print $html;


This works perfectly fine, except if I want to use a variable

lets say that my htmlpage.html includes the following:

CENTERH2Hello! Your variable has a value of: $myvar/H2/CENTER

and my test.php file is as follows:

?php
$myvar = It works!;
$html = fread(fopen(htmlpage.html, r), filesize(htmlpage.html));
print $html;
?

I would expect the output to be:

Hello! Your variable has a value of: It works!

but what I get is:

Hello! Your variable has a value of: $myvar


any hints/tips/suggestions?  Is there another way that I should be doing
this?

thanks!

Jason




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

2001-07-26 Thread Jason Bell

I personally use www.phpwebhosting.com and they are OK. I don't think I
would put anything mission critical on their servers. Why do I say this? I
usually spend all day long with an SSH session open, running VI to edit my
site... several times throughout the day, my session will freeze... if I try
and view my webpage during this moment, I can't get to it, so I have to
assume that their machines freeze for 20-30 seconds several times a day.  My
SSH session usually terminates during this time as well..  it's very
frustrating, but for my personal site, at $9.95 a month for unlimited
bandwidth/space/pop accounts, I will put up with it, until I can find a
better host with comparable features, and comparable price.


- Original Message -
From: Jon Yaggie [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 26, 2001 8:08 AM
Subject: [PHP] hosting


I am aware this is a bit off topic but i need advice.  i have a client that
wants to set up hosting.  we need to get him a control panel for
administrative use.  We have search open source stuff and there is one PHP
that is alpha.  We have no problem paying for it if we could find one.  PHP
would be nice so we could easily integrate it in the rest of the site.  Any
one able to point me in the right direction?

Thank You,

Jon Yaggie
www.design-monster.com

And they were singing . . .

'100 little bugs in the code
100 bugs in the code
fix one bug, compile it again
101 little bugs in the code

101 little bugs in the code . . .'

And it continued until they reached 0





-- 
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] Session Variables

2001-07-25 Thread Jason Bell

Is there anyway to prevent session variables from being overwritten by a get string?

I'm wanting to use sessions for security/login, but I'm finding that I can bypass this 
very easily. For example, I want to hide menu items based on security level, so I use 
something like this:

if ($HTTP_SESSION_VARS[sess_auth]  2) { print BRA HREF=/control/newsed.phpNews 
Editor; };

which works, however, it can be bypassed if someone just enters the value in the url 
like so:

http://secured.site.com/index.php?sess_auth=admin

is there any way around this using sessions?  Is there a far more suitable method?

Thanks!

Jason Bell



Re: [PHP] Session Variables

2001-07-25 Thread Jason Bell

Thanks! I changed my code to the following and it plugged that hole.  :)


if (!$PHPSESSID) {
$sess_auth = ;
session_register('sess_auth');
  }



- Original Message -
From: Sascha Schumann [EMAIL PROTECTED]
To: Johnson, Kirk [EMAIL PROTECTED]
Cc: PHP Users [EMAIL PROTECTED]
Sent: Wednesday, July 25, 2001 2:10 PM
Subject: RE: [PHP] Session Variables


 On Wed, 25 Jul 2001, Johnson, Kirk wrote:

   Is there anyway to prevent session variables from being
   overwritten by a get string?
 
  PHP will do this automatically *if* you initialize your session
variables to
  *anything* as soon as you register them. For example,
 
  session_register(sess_auth);
  $sess_auth = ;

 Note that session_register() will implicitly commence the
 session, and thus will automatically instantiate all session
 variables.  Hence, the above two lines need to be reversed,
 otherwise you might overwrite the session variable.

 - Sascha Experience IRCG
   http://schumann.cx/http://schumann.cx/ircg


 --
 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] String Comparison

2001-07-24 Thread Jason Bell

Hello.  

I'm trying to compare two strings, and performa function if the are the same.  Easy 
right?  I thought so until I tried it...

$query = select type from images where id=$id;
$result = mysql_query($query);
$type = mysql_result($result,0,type);
print $type;
if (image/pjpeg == $type) { print Type is JPG; };

returned:

image/pjpeg
Warning: Division by zero in /home/daelic/www/photo/mkthumb.php on line 8


Any idea on why this won't work?

Thanks!

Jason



Re: [PHP] String Comparison

2001-07-24 Thread Jason Bell

oh wait.. I just realize my goof  it is treating it like I want to
divide image by pjpeg.  LMAO

*sigh*  I guess I should just go home while I'm ahead.  haha

-Jason


- Original Message -
From: Jason Bell [EMAIL PROTECTED]
To: PHP Users [EMAIL PROTECTED]
Sent: Tuesday, July 24, 2001 3:59 PM
Subject: [PHP] String Comparison


Hello.

I'm trying to compare two strings, and performa function if the are the
same.  Easy right?  I thought so until I tried it...

$query = select type from images where id=$id;
$result = mysql_query($query);
$type = mysql_result($result,0,type);
print $type;
if (image/pjpeg == $type) { print Type is JPG; };

returned:

image/pjpeg
Warning: Division by zero in /home/daelic/www/photo/mkthumb.php on line 8


Any idea on why this won't work?

Thanks!

Jason



-- 
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] Fw: Data from SQL to a string in a useable format

2001-07-23 Thread Jason Bell

Just a note about this:   I am starting to play with the base64_encode
function It does indeed create a bigger string than the original, *BUT*,
I've also found that if you use the following:

$img = gzcompress(base64_encode(fread(fopen($userfile, r),
filesize($userfile;

your end result will be even smaller than the original image string, that
you would get from running:

$img = addslashes(fread(fopen($userfile, r), filesize($userfile)));


Original Image, slashes added:  27941
Base64 Encoded: 36256
Base64 Encoded, Compressed:26785


- Original Message -
From: Jason Bell [EMAIL PROTECTED]
To: Sheridan Saint-Michel [EMAIL PROTECTED]; php-general
[EMAIL PROTECTED]
Sent: Wednesday, July 18, 2001 12:02 PM
Subject: Re: [PHP] Fw: Data from SQL to a string in a useable format


 I will certainly give it a try... Thanks!

 - Original Message -
 From: Sheridan Saint-Michel [EMAIL PROTECTED]
 To: php-general [EMAIL PROTECTED]
 Sent: Wednesday, July 18, 2001 11:57 AM
 Subject: Re: [PHP] Fw: Data from SQL to a string in a useable format


  This may be way out in left field... but since no one else seems to be
  answering,
 
  Have you considered using something like base64_encode?
  http://www.php.net/manual/en/function.base64-encode.php
 
  That would change your image to plaintext without any characters that
need
  to be escaped.
 
  The when you retrieve it you would just run it through base64_decode and
  viola!
 
  I have never tried this, and like I said there may very well be a better
  solution.
  (Especially since the DB is usually the bottleneck and base64_encode
  actually makes the file bigger)
 
  Let me know if that helps
  Sheridan
 
  - Original Message -
  From: Jason Bell [EMAIL PROTECTED]
  To: PHP Users [EMAIL PROTECTED]
  Sent: Wednesday, July 18, 2001 11:51 AM
  Subject: [PHP] Fw: Data from SQL to a string in a useable format
 
 
  Ok, never got a reply yesterday, so I figured I'd resend this.  can
 this
  even be done?
  __
 
  How can I pull my data from my SQL db, and store it as a string so that
it
  can be used? Specificly, I'm working with images.
 
  When the images are stored in the database, the only pre-processing that
 is
  done is:
 
  $img = addslashes(fread(fopen($userfile, r), filesize($userfile)));
 
  (* note: $userfile is the file identifier from my upload form.)
 
  I want to pull the data out of the database and store it in a string, so
  that I can use imagecopyresampled to create a thumbnail, but I just
can't
  seem to get it to work
 
  please help!!
 
  Thanks,  Jason
 
 
 
  --
  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] Dynamic Thumbnail From Database Solution!

2001-07-23 Thread Jason Bell

Ok, since I've posted questions about this on a few occasions, I thought I'd be kind, 
and share the solution I have found to creating dynamic thumbnails from images stored 
within a MySQL database. For the sake of brevity, I will only show an example for 
jpeg...

To begin with, add your image to your Database.  I opted to only pretreat my binary 
data with the addslasshes command.

Once your image is in the database, you need to be able to pull it out in a normal 
fashion. The getpic.php script handles this:

?php
if($id) {
mysql_connect($DBHOST,$DBUSER,$DBPASS);
mysql_select_db($DBNAME);
$query = select image,type from images where id=$id;
$result = mysql_query($query);
$data = mysql_result($result,0,image);
$type = mysql_result($result,0,type);
Header( Content-type: $type);
echo $data;
};
?

Using getpic.php in conjuction with the IMG tag can display the fullsize picture.

Now, to the fun part! Dynamicly creating a thumbnail from the fullsize binary within 
your database. To create the thumbnail, I have a script called mkthumb.php:

?php
  $src = 
imagecreatefromjpeg(http://www.barkingrat.com/photo/getpic.php?id=$id;);
  $twidth = imagesx($src)/3;
  $theight = imagesy($src)/3;
  $img = imagecreate($twidth,$theight);
  
imagecopyresized($img,$src,0,0,0,0,$twidth,$theight,imagesx($src),imagesy($src));
  imagejpeg($img);
  imagedestroy($img);
?

You use mkthump.php in the same exact way that you use getpic.php.  Now, obviously, 
mkthumb.php needs to be modified to handle filetypes other than jpeg. That should be a 
simple task, I just haven't done it yet should be as simple as checking the file 
type (I insert the type into a column when I store the original image)


this works.  if anyone can think of a better way to do anything I have done, feel 
free to add your 2 cents  I'm certainly open to it.  :)

Jason Bell



Re: [PHP] PHP MySQL

2001-07-20 Thread Jason Bell

What's wrong with using ORDER BY in your sql statement?

- Original Message - 
From: Erich Kolb [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 20, 2001 9:32 AM
Subject: [PHP] PHP  MySQL


 When you query a MySQL Database, how do you set the order alphabetically?
 
 -- 
 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] PHP MySQL

2001-07-20 Thread Jason Bell

Also, to add to this, it's worth noting that the opposite of DESC is ASC
as in Descending and Ascending order

- Original Message -
From: Steve Werby [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Friday, July 20, 2001 9:55 AM
Subject: Re: [PHP] PHP  MySQL


 [EMAIL PROTECTED] wrote:
  on 7/20/01 12:32 PM, Erich Kolb at [EMAIL PROTECTED] wrote:
 
   When you query a MySQL Database, how do you set the order
 alphabetically?
 
 
  If it's a text field just say DESC

 Anyone that tries would figure out, but I just wanted to clarify that what
 Susan suggested will reverse the sort direction which is not what the
poster
 asked for.

 --
 Steve Werby
 President, Befriend Internet Services LLC
 http://www.befriend.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 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 free-form text with quotes to mysql

2001-07-20 Thread Jason Bell

$newstring = addslashes($oldstring);

then, use $newstring for everything   should work.

- Original Message -
From: garman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 20, 2001 11:57 AM
Subject: [PHP] inserting free-form text with quotes to mysql


 I'm creating a specialized suggestion box type of web application in
PHP.
 I'm using MySQL for data storage.

 Whenever I try to submit text that contains a double quote character (),
the
 submission gets truncated at the first occurance of a double quote and
beyond.
  Single quotes don't seem to be problematic.

 So if the user inputted the following text:

 hello  my suggestion for deals with improving the...

 then only hello would get put in the database, and everything from the
 double quote to the end of the input would be truncated.

 I've tried addslashes() and removeslashes() before the submit, but that
 doesn't seem to help.

 The input data actually gets POST'ed twice: once when the user submits his
 form.  After he submits, I bring up a verification form, where I show
what
 the user submitted so he can check to make sure everything is accurate.
From
 the verification page, I call another php page to actually do the database
 writing.  (Note, when I played with add/removeslashes(), I was doing so on
the
 last php page, i.e., where the database operation actually takes place).

 I've noticed that either PHP, my browser, or the webserver seem to add
slashes
 automatically because any quotes (single or double) or slashes are escaped
 with a slash on the verification page.

 Hopefully this is just something simple I'm overlooking :)

 Thanks,
 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] inserting free-form text with quotes to mysql

2001-07-20 Thread Jason Bell

well, you failed to supply any example of your code, so I have no reason to
assume anything but a syntax issue, therefore I provided an example of
proper syntax that works for me.

- Original Message -
From: garman [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 20, 2001 12:44 PM
Subject: RE: [PHP] inserting free-form text with quotes to mysql


 Dude!  I already said that wasn't working :)

 MG

 = Original Message From Jason Bell [EMAIL PROTECTED] =
 $newstring = addslashes($oldstring);
 
 then, use $newstring for everything   should work.
 
 - Original Message -
 From: garman [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, July 20, 2001 11:57 AM
 Subject: [PHP] inserting free-form text with quotes to mysql
 
  I've tried addslashes() and removeslashes() before the submit, but that
  doesn't seem to help.


 --
 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] Re: Session problems

2001-07-19 Thread Jason Bell

I have a file that I include at the beginning of every .php file it
contains the following code, and works perfectly:

session_start();
if (!$PHPSESSID) {
  session_register('sess_uid');
  session_register('sess_acl');
  session_register('sess_fname');
  session_register('sess_lname');
  session_register('sess_uname');
 };

note that I do not store any value for the variables before registering them
with the session


- Original Message -
From: Rudolf Visagie [EMAIL PROTECTED]
To: Steve Brett [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, July 19, 2001 9:38 AM
Subject: RE: [PHP] Re: Session problems


 I use only sessions and my scripts do not work if I do not register the
 session variables I want in each script. Otherwise they work fine.

 R

 -Original Message-
 From: Steve Brett [mailto:[EMAIL PROTECTED]]
 Sent: 19 July 2001 05:39
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] Re: Session problems


 you only need to register vars with the session once.

 Steve

 Rudolf Visagie [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hi Bernie,
 
  Do a session_register in the second script as well:
  ?php
   session_start();
   session_register(my_session_variable);
   print Value of 'my_session_variable': $my_session_variable;
   ?
 
  Rudolf Visagie
 
  -Original Message-
  From: Bernie Kruger [mailto:[EMAIL PROTECTED]]
  Sent: 19 July 2001 04:55
  To: [EMAIL PROTECTED]
  Subject: [PHP] Re: Session problems
 
 
  Tried everything all of you suggested, still no luck :-(
 
  BK
 
  Bernie Kruger [EMAIL PROTECTED] wrote in message
  [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
   Hi,
  
   I use this simple session script below,  but the session variables are
 not
   carried over from 1.php to 2.php.  What can be wrong?  I can see on
the
   server that the files are created.  When I open 1.php a 1K file is
 created
   on the server and the contents (my_session_variable|s:10:some
value;).
   When I open 2.php afterwards a 0K file is created on the server which
is
   empty.
  
   I use IIS5, Win2k, PHP 4.0.5, IE5.5.
   Session method: files
  
   (1.php)
  
   ?php
   session_start();
   $my_session_variable = some value;
   session_register(my_session_variable);
   ?
  
   and
  
   (2.php)
  
   ?php
   session_start();
   print Value of 'my_session_variable': $my_session_variable;
   ?
  
   Tx
   BK
  
  
 
 
 
  --
  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] Image Submission into a Database Updating

2001-07-19 Thread Jason Bell

the function unlink() will delete your old file...
http://www.php.net/manual/en/function.unlink.php

- Original Message -
From: Brad R. C. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, July 19, 2001 3:01 PM
Subject: [PHP] Image Submission into a Database  Updating


 Ok.. I have created a submission form that works great just like what I
 want..

 but there is one minor detail if possible to figure out. When I let users
 upload a photo to my site, the image will be stored  on the server hdd and
 the name of the image will be stored in the database. Works great!.. but
 lets say they submit another image in the same form.. it will overwrite
the
 image name in the database, and uploads the new image.. but what about the
 old one? It stays dorment unusable and taking up space on my hdd. So... my
 question is.. what line can I add to delete the image before or after
 uploading the new one. I mean you can make the old name value into a temp
 value, and then it will overwrite the original value and you still have
the
 temp value.. I think.. here is what by submit code looks like. Hopefully
 someone can figure this out.

 -code :
 if ($submit) {
 $connection = mysql_pconnect(SQL_SERVER, SQL_UID, SQL_PWD);

 mysql_select_db(SQL_DB, $connection);

 $sql = UPDATE user SET

desc_one='.addslashes($desc_one).',photo_one='.addslashes($picture_name).
 ' WHERE userid='userid';

 mysql_query($sql);

 exec(cp $picture /root/lets/play/folder/tag/images/$picture_name);

 return 0;
 }
 -code end.

 Thanks
 BradC


 --
 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] Fw: Data from SQL to a string in a useable format

2001-07-18 Thread Jason Bell

Ok, never got a reply yesterday, so I figured I'd resend this.  can this even be 
done?
__

How can I pull my data from my SQL db, and store it as a string so that it can be 
used? Specificly, I'm working with images.

When the images are stored in the database, the only pre-processing that is done is:

$img = addslashes(fread(fopen($userfile, r), filesize($userfile)));

(* note: $userfile is the file identifier from my upload form.)

I want to pull the data out of the database and store it in a string, so that I can 
use imagecopyresampled to create a thumbnail, but I just can't seem to get it to 
work

please help!! 

Thanks,  Jason



Re: [PHP] RE: bill

2001-07-18 Thread Jason Bell

oopsie.

- Original Message -
From: Danielle Forestier [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 18, 2001 10:02 AM
Subject: [PHP] RE: bill




 Mr. Tejano:

 Aetna/Box 60578/LA, CA 90060-00578
 457-74-9048/02 Warren Vail
 Group 8--40-010-2

 Thank you for clearing this up.


 -Original Message-
 From: Jonathan Tejano [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, July 17, 2001 7:02 AM
 To: 'Warren Vail'
 Subject: RE: bill


 Thank you for your email. We indeed need your insurance information for
 billing. Alta Bates medical Center failed to forward information to us.
 Please provide us with your insurance carrier, their claims/billing
address
 if under a PPO plan, your member/subscriber number, and group number (if
 listed in your insurance card). If you're under a HMO plan, I would need
the
 name of the medical group. Should you be confused or have questions
 regarding whats noted above, please call the customer service number
listed
 on your insurance card or email back. Thanks again.

 Jon Tejano
 Follow-up Department
 Bay Imaging Consultants Medical Group
 (925)296-7156
 Email:  [EMAIL PROTECTED]


 -Original Message-
 From: Warren Vail [mailto:[EMAIL PROTECTED]]
 Sent: Monday, July 16, 2001 9:52 AM
 To: [EMAIL PROTECTED]
 Subject: bill


 Don't understand why the ins. isn't covering this.  Please clarify.
 00109-727779, 7/11/01, listed as self-pay???Do you need more ins. info?



 --
 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] Fw: Data from SQL to a string in a useable format

2001-07-18 Thread Jason Bell

I will certainly give it a try... Thanks!

- Original Message -
From: Sheridan Saint-Michel [EMAIL PROTECTED]
To: php-general [EMAIL PROTECTED]
Sent: Wednesday, July 18, 2001 11:57 AM
Subject: Re: [PHP] Fw: Data from SQL to a string in a useable format


 This may be way out in left field... but since no one else seems to be
 answering,

 Have you considered using something like base64_encode?
 http://www.php.net/manual/en/function.base64-encode.php

 That would change your image to plaintext without any characters that need
 to be escaped.

 The when you retrieve it you would just run it through base64_decode and
 viola!

 I have never tried this, and like I said there may very well be a better
 solution.
 (Especially since the DB is usually the bottleneck and base64_encode
 actually makes the file bigger)

 Let me know if that helps
 Sheridan

 - Original Message -
 From: Jason Bell [EMAIL PROTECTED]
 To: PHP Users [EMAIL PROTECTED]
 Sent: Wednesday, July 18, 2001 11:51 AM
 Subject: [PHP] Fw: Data from SQL to a string in a useable format


 Ok, never got a reply yesterday, so I figured I'd resend this.  can
this
 even be done?
 __

 How can I pull my data from my SQL db, and store it as a string so that it
 can be used? Specificly, I'm working with images.

 When the images are stored in the database, the only pre-processing that
is
 done is:

 $img = addslashes(fread(fopen($userfile, r), filesize($userfile)));

 (* note: $userfile is the file identifier from my upload form.)

 I want to pull the data out of the database and store it in a string, so
 that I can use imagecopyresampled to create a thumbnail, but I just can't
 seem to get it to work

 please help!!

 Thanks,  Jason



 --
 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] remove me from php list

2001-07-18 Thread Jason Bell

remove yourself.   :)

 To unsubscribe, e-mail: [EMAIL PROTECTED]



- Original Message - 
From: danny brown [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 18, 2001 12:25 PM
Subject: [PHP] remove me from php list 


 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]
 
 


-- 
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] Connexion to MySQL

2001-07-18 Thread Jason Bell

Forget PHP for a second. Can you connect to that server normally, using
a MySQL Client?

- Original Message -
From: Moise Bertrand TACHAGO [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, July 18, 2001 1:55 PM
Subject: [PHP] Connexion to MySQL


 Hi,

 Please can anyone help me to understand and resolve the probleme below

 Warning: MySQL Connection Failed: Host '195.24.202.98' is not allowed to
connect to this MySQL server in
 /usr/local/apache/htdocs/kolosys/Menu.php on line 35
 ERROR:

 Unable to connect to server

 I have this probleme when i'm try to connect to MySQL through a php
program i had wrote.

 This is how i made the connexion:

 $server=getenv(SERVER_NAME);

 $user=root;

 $pass=;

 mysql_connect($server,$user,$pass);

 Thanks in advance

 --
 Moise Bertrand TACHAGO
 Computer scientist
 Intern SDNP Cameroon, 506 Hajal Center Building, Yaounde CAMEROON
 phone   (237)22 24 90
 E_mails [EMAIL PROTECTED]
 [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] Get filename in php command line

2001-07-17 Thread Jason Bell

$PHP_SELF returns the filename with the full path. from there, you can use
split to split the string wherever a / occurs, then call count, to get the
total number of values in the array, decrememnt the count by 1 (Arrays begin
at 0) then, set a variable to store just the filename, like so:

$fullpath = split('/',$PHP_SELF);
$c = count($fullpath);
$c--;
$filename = $fullpath[$c];

There may be a better way to do it, but this works for me, and it's only 4
lines. :)

JB


- Original Message -
From: Reuben D Budiardja [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 7:48 AM
Subject: [PHP] Get filename in php command line



Hello,
How do I get the filename or script name if I run it in php comamnd line?
For
example, if I run this

bash$ php test.php

I want to get something inside test.php that tells me the filename is
test.php, but *without* the actual path.

Thanks
Reuben D. Budiardja

--
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] Data from SQL to a string in a useable format

2001-07-17 Thread Jason Bell

How can I pull my data from my SQL db, and store it as a string so that it can be 
used? Specificly, I'm working with images.

When the images are stored in the database, the only pre-processing that is done is:

$img = addslashes(fread(fopen($userfile, r), filesize($userfile)));

(* note: $userfile is the file identifier from my upload form.)

I want to pull the data out of the database and store it in a string, so that I can 
use imagecopyresampled to create a thumbnail, but I just can't seem to get it to 
work

please help!! 

Thanks,  Jason



Re: [PHP] PHP- something i don't undestand

2001-07-17 Thread Jason Bell

your query needs to be an actual query, such as a select statement...

- Original Message - 
From: Yassel Omar Izquierdo Souchay [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 1:28 PM
Subject: [PHP] PHP- something i don't undestand


 Hi
 I'm having
 trouble with  this part of code
 
 9:   $result = mysql_db_query(users, $query);
 10: $r=mysql_fetch_array($result);
 
 The error message is :
 Warning: Supplied argument is not a valid MySQL result resource in
 c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 9.
 
 Please if somebody knows what it's wrong
 thanks
 Yassel
 
 
 -- 
 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]




Fw: [PHP] php- something that i don't understand

2001-07-17 Thread Jason Bell

Oops.. forgot to CC the group..
- Original Message - 
From: Jason Bell [EMAIL PROTECTED]
To: Yassel Omar Izquierdo Souchay [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 12:42 PM
Subject: Re: [PHP] php- something that i don't understand 


 try this:
 
 mysql_connect(YOUR_DB_HOST,DB_USERNAME,DB_PASSWORD);
 mysql_select_db(DB);
 $query = select * from info where FirstName='$FirstName' and
 LastName='$LastName' and email='$email';
 $result = mysql_query($query);
 
 
 - Original Message -
 From: Yassel Omar Izquierdo Souchay [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, July 17, 2001 1:37 PM
 Subject: [PHP] php- something that i don't understand
 
 
 Hey guys
 here is my code
 
 4: mysql_connect() or die (Problemas conectandose a la base de datos);
 5: $query=select * from info where FirstName='$FirstName' and
 6: LastName='$LastName' and email='$email';
 7: $result = mysql_db_query(users, $query);
 *8: $r=mysql_fetch_array($result); 
 9: $count=$r[count];
 
 and i follow redcieving this message
 
 Warning: Supplied argument is not a valid MySQL result resource in
 c:\inetpub\wwwroot\PhpAndMysqlTest\test2\reg1.php3 on line 8
 
 
 thanks for your answers
 Yassel
 
 
 


-- 
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] Need help with formatting time

2001-07-17 Thread Jason Bell

try looking here:
http://www.php.net/manual/en/function.mktime.php

then here:
http://www.php.net/manual/en/function.date.php

-JB


- Original Message - 
From: John Holcomb [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 12:53 PM
Subject: [PHP] Need help with formatting time


 Hello and thank you.
 
   I'm trying to find a function(method) or existing
 code taht takes the number of minutes that have passed
 in a day and returns the time of the day.  For
 example:
 
  780 minutes == 1pm,
  0 minutes == 12am,
  etc,etc.
 
 so I'm looking for code that when you enter the number
 of minutes, it returns the time of day.
 
 example:   
  
 $some_time = foo(780);
 
 print($some_time);
 
file://prints 1:00pm
 
 
 Thnaks again.
 
 __
 Do You Yahoo!?
 Get personalized email addresses from Yahoo! Mail
 http://personal.mail.yahoo.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 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] displaying icons

2001-07-17 Thread Jason Bell

how are you trying to use PHP to output the html?

AFAIK, there shouldn't be any difference between:

HTML document:  IMG SRC="abduction.ico"
PHP document:  print "IMG SRC='abduction.ico'";

You should note however that within the PHP print statement, you should to
refrain from the use of quotation marks... if you must quote something, use
a single quote, as I did in my example.

-JB


- Original Message -
From: "Petr Jza" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, July 17, 2001 12:47 PM
Subject: [PHP] displaying icons


 Hi everybody!
 Please, have somebody any experience with displaying icons (type files
 *.ico) in web pages?

 When I have a pure html file that contain img src="abduction.ico", all
is
 OK - the icon is shown.
 But when I create a html page with assistance PHP, the icon isn't shown.

 Please, could you help me??
 Thank you!

 Best Regards, 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]




-- 
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 creat a file and write a string to it!

2001-07-16 Thread Jason Bell

You need to open the file before you can actually write to it

try this:

$fp = fopen($file, w);
fwrite($fp, $articletext);
fclose($fp);


- Original Message - 
From: sunny AT wde [EMAIL PROTECTED]
To: php [EMAIL PROTECTED]
Sent: Sunday, July 15, 2001 10:27 AM
Subject: [PHP] how can i creat a file and write a string to it!


 i've been looking for an adequate answer all morning in the archives,
 but can't find one, neithr can i understand the manual.
 
 all i want to do is for php to take the strong sent to it through a
 form, and create a new file with a name 2.html for example, and
 write the string to it.
 
 how can i quickly do this please?
 
 i got this so far but that gives me some filehandler problem. i'm
 running off a unix system btw.
 
   $lastid = mysql_insert_id() ; 
   $root = /home/articles/;
   $file = $root . $lastid . .html;
 
   fwrite($file, $articletext);
 
 tia!!
 
 /sunny
 
 
 Do You Yahoo!?
 Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
 or your free @yahoo.ie address at http://mail.yahoo.ie
 
 -- 
 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] Using an image as a reset button on a PHP script

2001-07-13 Thread Jason Bell

A quick search on the web found that you have to output some javascript to
handle that

take a look at http://www.idocs.com/tags/forms/index_famsupp_142.html

(Caveat: I only found the information by going to google and searching on
html image reset button I have not studied it, or tried it.)

- Original Message -
From: Brandon Orther [EMAIL PROTECTED]
To: PHP User Group [EMAIL PROTECTED]
Sent: Friday, July 13, 2001 2:46 PM
Subject: [PHP] Using an image as a reset button on a PHP script


 Hello,

 I am making a script at the moment and want to use images instead of the
 usual buttons.  Does anyone know how I can use the image as a reset
 button?
 Thank you,

 
 Brandon Orther
 WebIntellects Design/Development Manager
 [EMAIL PROTECTED]
 800-994-6364
 www.webintellects.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] Thumbnail Generation from DB Stored Images.

2001-07-12 Thread Jason Bell

Hello! I have images stored in a MySQL Database. I can retrieve the images and display 
them without a problem, but I'd really like to be able to create thumbnails. The code 
that I've written just doesn't seem to work. Preferably, I'd like to pull the image 
from the database, and create the thumbnail for display, without ever writing an image 
to the disk. If this is not possible, I'd like to know alternate methods. I'm using 
imagemagick's convert utility to create the thumbs. Here is my code:

getpic.php:

?php
if($id) {
@MYSQL_CONNECT(localhost,username,mypassword);
@mysql_select_db(daelic);
$query = select image,type from images where id=$id;
$result = @MYSQL_QUERY($query);
$data = @MYSQL_RESULT($result,0,image);
$type = @MYSQL_RESULT($result,0,type);
Header( Content-type: $type);
echo $data;
};
?

tgen.php:

?php
if ($id) {
  $src = getpic.php?id=$id;
  $thumb = passthru(convert -geometry 40% $src jpeg:-);
  print $thumb;
 };
?


I know that getpic.php works.  I can use it in like this:   echo IMG 
SRC='getpic.php?id=$id'; and it will output the fullsize graphic in place. I'm 
trying to get to a point where I can use tgen.php in the same mannor. I can use the 
same convert command if I use an actual file, like pics/mypic.jpg and it works, so the 
command is good.

any help at all would be very appreciated,

Jason Bell