[PHP] Wikimedia - cookies

2006-05-18 Thread Christopher
I've built a front-end to display information from a wikimedia database  
that uses Text_Wiki and Text_Wiki_Mediawiki, but I can't seem to figure  
out how the wiki keeps track of its cookies and such. I would like to  
expand this to front-end so if it can pick up someone has logged into the  
wiki before, and allow them more options.


Does anyone know how the wikimedia cookies are stored and how I can access  
them?


Sorry if this is something extremely simple, I'm still a bit of a noob :)

--
Using Opera's revolutionary client: http://www.opera.com/

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



[PHP] $DOCUMENT_ROOT

2002-12-06 Thread christopher calicott

>  echo $_SERVER["DOCUMENT_ROOT"];
> ?>


c:/wwwroot

is what I get.  I am convinced the problem I am having is due to some issues
with configuration.  Here is why:


I found the script that is the 'original' one that I had working just as an
image displayer - not as part of a larger html document and it works at the
root of the web server.   I've attached that code.  Here's the thing - the
script is identical, with two exceptions.. a) it is executing from the
server root and b) the is just a regular path without the $DOCUMENT_ROOT in
there.  It looks (and it works) like this:

$strRealPath = "images/random_gen/";
//$DOCUMENT_ROOT.dirname($SCRIPT_NAME)."/";


I cloned this script and renamed it, then changed "images/random_gen/" to:
"$DOCUMENT_ROOT/images/random_gen/"

and guess what?   I guess the EXACT same errors.  It has to be something to
do with where apache or php thinks the root of the server is located...
since the script that is integrated into the site is down a level in the
/includes/ subfolder and it points to images in the
DOCUMENT_ROOT/images/random_gen/ subfolder, I really needed the script to
just say 'okay go to the root of the server then go to this subfolder and
look there.'  It ain't working.

SOo basically I have some sort of configuration issue here. I've
tried modifying httpd.conf - it supposedly wants the documentRoot to be set
to c:/wwwroot instead of the normal c:\wwwroot... I've tried it both ways.
the doc_root= setting in php.ini is set to c:\wwwroot and I've tried it both
ways.

Please help.  I will dance at your wedding. Anybody Buehler?  Buehler?

-=- christopher

-=- christopher


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


[PHP] Re: Objects and Classes?

2002-12-11 Thread Christopher Raymond
allows you to use an html template file which you can paste 
dynamic values/content into. Here's an example of how to use it:

setParameter("PAGE-TITLE", $title);
$template->setParameter("CONTENT", $content);

echo $template->ReturnHTML(); // Sends html to the browser

// It is important to destroy an object once you are finished
// using it so that you can free up the memory space that it uses

unset($template); // Destroys instance of object

?>

HTML TEMPLATE FILE:

  My html template file might look like this:











Christopher Raymond,
Oasis Networks <-- Web Development & Macintosh Systems Consulting

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




[PHP] Re: Forms

2002-12-11 Thread Christopher Raymond

> 
> 
> 
> John
> Mary
> 
> 

TIA:

You are missing the action and method attributes to the form tag. You 
are also missing the closing form tag. I don't know if you accidentally 
omitted these when posting your question or if you are actually missing 
these in your actual HTML code as well.

Your code should look something like this:

  // 
You could also use METHOD="GET"


John
Mary




If you've got all of this in place, but you are still having trouble 
gaining access to the variable, it may be that you are using a newer 
version of PHP which requires you to access the variable a different way. 
Try this:




Hope this helps,
Christopher

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




[PHP] Filter vulger / controversial words - need word source

2002-12-11 Thread Christopher Raymond

Greetings:

I'm wondering if someone has a great source for a master-list of 
controversial and vulger words that I can use on my site. I would like 
to pattern match input text against this master-list in order to prevent 
vulger and controversial words from appearing on my site.

Thanks for any help or suggestions,
Christopher Raymond

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




[PHP] Reading Registry

2003-01-09 Thread Christopher Ditty
Hello all.  I don't think this is possible, but I wanted to ask to be
sure.  Is it possible to read and write to a web user's registry with
php?  I believe this can be done with CF and ASP, but I was not sure
about PHP.  A search turned up nothing usefull.

Thanks

CDitty


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




[PHP] PHP/Oracle Command line Segmentation Fault

2003-01-09 Thread Christopher Ditty
I have successfully installed oracle 8.1.7 w/ php and have it configured
to run from the command line.  When I run a simple script that connects,
and selects records from the database, the last line is a segmentation
fault error.  This does not seem to happen when the same script is run
through the browser.  

Can anyone offer any help or advice?  The code is listed below.

CDitty

#!/usr/bin/php
";
exit ();
 }
 echo "Connected";
 return ($db_conn);
}

$conn = oci8Connect();

$stmt = ociparse($conn,"select * from US_MSTR");
  ociexecute($stmt);

$i=0;
$row = array();

  while(OCIFetchInto($stmt, &$row, OCI_ASSOC)){
# do stuff with $row...
echo $row['US_ID'] . " $i";
$i++;
}

ocifreestatement($stmt);
ocilogoff($conn);
?>


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




Re: [PHP] PHP/Oracle Command line Segmentation Fault

2003-01-10 Thread Christopher Ditty
Anyone?

CDitty

>>> "Christopher Ditty" <[EMAIL PROTECTED]> 01/09/03 04:04PM >>>
I have successfully installed oracle 8.1.7 w/ php and have it
configured
to run from the command line.  When I run a simple script that
connects,
and selects records from the database, the last line is a segmentation
fault error.  This does not seem to happen when the same script is run
through the browser.  

Can anyone offer any help or advice?  The code is listed below.

CDitty

#!/usr/bin/php
";
exit ();
 }
 echo "Connected";
 return ($db_conn);
}

$conn = oci8Connect();

$stmt = ociparse($conn,"select * from US_MSTR");
  ociexecute($stmt);

$i=0;
$row = array();

  while(OCIFetchInto($stmt, &$row, OCI_ASSOC)){
# do stuff with $row...
echo $row['US_ID'] . " $i";
$i++;
}

ocifreestatement($stmt);
ocilogoff($conn);
?>


-- 
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] Source Guardian

2003-01-10 Thread Christopher Ditty
Does anyone here use Source Guardian?  I am about to purchase it and
thought I'd ask before I do.  Any problems using it?

Thanks

CDitty


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




[PHP] Cycle through multiple servers....

2003-01-23 Thread Christopher Ditty
Hello all.  I have a few servers that I need to check during a login process.  If the 
first server fails to connect, then I need to do server #2 and so on.  Below is the 
code that I am using, but I am unable to get it to work like it should.  Can anyone 
offer some advice on how this should be accomplushed?

Thanks

CDitty


function sConnect($serverID){
$ds = ldap_connect($serverID);
return $ds;
}

$i = 0;
do{
ldapConnect($config['ldapServer'][$i]);
$i++;
}while(!$ds && ($i < (count($config['ldapServer']) + 1)));



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




[PHP] PHP FTP a security risk?????

2003-02-11 Thread Christopher Ditty
Hello all.  I have a customer that purchased on of my scripts and
attempted
to install it on their server.  This script, among other things, FTPs a
text file 
from a central server.  When we tried to run my script, it simply
stops.  No
errors, no nothing.  I talked to his host and found out that they do
not allow
PHP FTP because it is a security risk.  ?  U, ok?

I spoke with my customer about this and below is what his web host told
him.
My understanding of PHP FTP is that my script opens an ftp connection
from
the server to another FTP server somewhere else on the internet. 
Basically, 
PHP FTP does nothing more than a program like SmartFTP or WS-FTP.  Even

the first line in the PHP manual about FTP says "The functions in this
extension 
implement client access to file servers speaking the File Transfer
Protocol (FTP)"

Someone please tell me that I am correct and that this webhost is
wrong.  :)

Chris


I have been speaking with our linux techs, and have gained a more
complete understanding of the feature in PHP that you want to use.  We
actually did have it enabled at one point, and it caused the server to
be compromised.  Essentially, it allows people on a machine to be able
to transfer files from anywhere on the internet.  This begs for people
who want to run warez sites, and the like, to hack the server, and use
it for their own illegal software stores.  The level of permission
required to allow this to run allows people to essentially load, and
run
whatever they want.  This is an EXTREME security problem. I understand
that you are moving, and I cannot persuade you differntly, but please
take my advise and do some independant research.  The individual that
is
advising you about this program is downplaying some real problems. It
is
the opinion of our techs, that if you are running this, eventaully,
you
WILL be hacked.  There a plenty of things that can be done to ftp to a
machine without that functionality running. 
 
   We know that you have a number of sites, and we know that you would
likely referr business.  That being the case, it just doesn't make
sense
that we would not do this for you if it were safe, or even a minor
problem.  It is a big problem, not just with us, but with anyone
running
it on the internet.  Please ask someone other than the person that is
trying to sell it to you.  That is all we ask. 





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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Christopher Ditty
Unfortunately, I can only get the file via FTP.  I just want to know
where this other host got it's information.

Chris

>>> "Reuben D. Budiardja" <[EMAIL PROTECTED]> 02/11/03
01:35PM >>>
On Tuesday 11 February 2003 02:11 pm, Jason Wong wrote:

I agree with that. It's only a (potential) problem if you're running an
FTP 
server, not client.

The one thing that makes me curious is as to how webhost ban this ftp
client. 

You said you're only transferring text file. Does the server that
you're 
transferring the file from offer other methods than FTP? how about
HTTP?




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




Re: [PHP] PHP FTP a security risk?????

2003-02-11 Thread Christopher Ditty
Chris, Did you read the rest of the message?  It sounds like the web
host is saying that 
someone can access PHP FTP from an outside server and hack into the
server.  

I am not trying to start a debate on whether or not people should send
passwords and 
userids over plain text.  Yes, that is a security risk.  My concern is
that this webhost is 
telling my customer that PHP FTP itself is a security risk when it does
nothing more than
act like ws-ftp.

>>> "Chris Wesley" <[EMAIL PROTECTED]> 02/11/03 02:22PM >>>
On Tue, 11 Feb 2003, Chris Wesley wrote:

> On Tue, 11 Feb 2003, Christopher Ditty wrote:
>
> > errors, no nothing.  I talked to his host and found out that they
do
> > not allow PHP FTP because it is a security risk.  ?  U,
ok?
>
> That said ... FTP is a protocol;  there's nothing stopping you from
> opening a socket and talking FTP back & forth across it (unless your
host
> has disabled fsockopen() too).  If you know the protocol, you
probably
> know how and why to avoid its security concerns.
>
> Other options:  Move to a less security-minded hosting provider
(looks
> like you've already started that), or ask the FTP server admin to
provide
> download access to your file via HTTP.

You might find this interesting too -- straight from Example 1 for
fopen()
in the PHP manual:  http://www.php.net/manual/en/function.fopen.php 

$handle = fopen ("ftp://user:[EMAIL PROTECTED]/somefile.txt";, "w");

b.careful ... g.luck,
~Chris



-- 
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] Version control, Bug Reporting, Forum, Mailing List

2003-02-26 Thread Christopher Hilling
Hi - I am trying to find an application which has the following creditials

Version control - including extensions
Bug reporting - including email submission
Forum - for multiple projects
Mailing list - for multiple projects
Language - php
Database - mySQL
OS - windows and apachie
UI - skinable

Version contol is for internal developers but would like to final release
version available to the public.

Can anyone point me in the right direction to finding an application which
does all - or at least most of the above

Thanks

Chris



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



[PHP] Testing for installed components....

2003-03-04 Thread Christopher Ditty
I am trying to write a small script that will test and report what PHP
components are available on a given server.  Is there a quick and easy
way to do this?  I know about php info, but I would prefer to have
something that will spit hte information out in my format where the user
can easily understand it.

Chris

--
03/04/2003, 10:09:13 AM
This e-mail and any attachments represent the views and opinions of only the sender 
and are not necessarily those of Memphis Light, Gas & Water Division, and no such 
inference should be made.

==


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



[PHP] response.redirect

2003-03-07 Thread Christopher Myatt
is there any way to do a *response.redirect* call like in asp from a php
script?



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



[PHP] Text>Image

2003-03-08 Thread Christopher Smith
Greetings,

  I've recently searched newsgroup archives on how to convert text into an
image. However, I cannot seem to find a clear example on how to create the
image dimensions based on the size of a textfile and then once I create the
initial image how to paint the text on the image based on how it appears in
the textfile.  Any help with this would be helpful. Thank-you for your time!



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



[PHP] Re: Text>Image

2003-03-08 Thread Christopher Smith
I understand how to place the text on the image etc. Just not exactly sure
how to make the image based on how big the text file I put into an array


"Christopher Smith" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Greetings,
>
>   I've recently searched newsgroup archives on how to convert text into an
> image. However, I cannot seem to find a clear example on how to create the
> image dimensions based on the size of a textfile and then once I create
the
> initial image how to paint the text on the image based on how it appears
in
> the textfile.  Any help with this would be helpful. Thank-you for your
time!
>
>



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



Re: [PHP] Encrypting/Compiling PHP Scripts

2003-03-12 Thread Christopher Ditty
There is also Source Guardian.  If you need a program that will support
an unencrypted configuration file, ie, user definable variables, this
one will do it.  Ioncube wouldn't last I looked and I can't speak for
Zend.

I have used this, but the end result has not been favorable.  So far, I
am running at about 50% success rate for my users being able to run my
encrypted programs.   I support encrypting my scripts, but with all the
problems I am having with this, I am leaning to it not being worth the
hassle right now.

Just my $0.02.

CDitty



>>> "Leif K-Brooks" <[EMAIL PROTECTED]> 03/11/03 11:54PM >>>
http://zend.com/store/products/zend-encoder.php 
http://www.ioncube.com/ 

Davis Tan wrote:

>Hi,
>
>Would like to know whether is there any possibilities to encrypt
or compile the PHP scripts so that it is not human-readable? Thanks!
>  
>

-- 
The above message is encrypted with double rot13 encoding.  Any
unauthorized attempt to decrypt it will be prosecuted to the full extent
of the law.




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



--
03/12/2003, 09:24:53 AM
This e-mail and any attachments represent the views and opinions of only the sender 
and are not necessarily those of Memphis Light, Gas & Water Division, and no such 
inference should be made.

==


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



RE: [PHP] Splitting a string

2003-03-13 Thread Crane, Christopher
This is perfect. I was not sure how to use the brackets with a variable for
position. Thank you very much

Christopher J. Crane 
Network Manager - Infrastructure Services 
IKON The Way Business Gets Communicated 
755 Winding Brook Drive
Glastonbury, CT 06078
Phone - (860) 659-6464
Fax - (860) 652-4379




-Original Message-
From: - Edwin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 13, 2003 9:30 AM
To: Christopher J. Crane; [EMAIL PROTECTED]
Subject: Re: [PHP] Splitting a string


Hi,

"Christopher J. Crane" <[EMAIL PROTECTED]> wrote: 

[snip]
> If that number start with a "S", I want to strip it off.
[/snip]

Why don't you just check whether the first character is an "S" then 
return only the rest of the string if it is? Like:



Of course, there could be some other way...

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


RE: [PHP] Correct Coding

2003-08-14 Thread Crane, Christopher
Well this page will load and not always with that variable set. Is that ok,
or will this code you put output an error.

Christopher J. Crane 
Network Manager - Infrastructure Services 
IKON Document Efficiency at Work 
755 Winding Brook Drive
Glastonbury, CT 06078
Phone - (860) 659-6464
Fax - (860) 682-6847




-Original Message-
From: Juan Nin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 1:17 PM
To: Christopher J. Crane
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Correct Coding


> Is this the best way to do this?
> if(isset($Task) && $Task == "Add") { Do something }
> I want to check if the variable is set and if so, if it is "Add".

why don't just do:

if($Task == "Add") { Do something }

regards,

Juan


[PHP] How to Return 403 Forbidden headers

2003-03-27 Thread Christopher Ditty
I have a customer that wants to return a 403 Forbidden header/page when
certain conditions are met.  I looked through the online manual and all
the examples listed would not work.  

This is what I am using.

header("Location: HTTP/1.0 403");

PHP tried to send the user to a "HTTP/1.0 403" webpage.

Any ideas?

CDitty

--
03/27/2003, 09:42:13 AM
This e-mail and any attachments represent the views and opinions of only the sender 
and are not necessarily those of Memphis Light, Gas & Water Division, and no such 
inference should be made.

==


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



RE: [PHP] How to Return 403 Forbidden headers

2003-03-27 Thread Christopher Ditty
Thanks, but it returns a blank page.

>>> "Matt Schroebel" <[EMAIL PROTECTED]> 03/27/03 09:52AM >>>

> -Original Message-
> From: Christopher Ditty [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, March 27, 2003 10:42 AM
> To: [EMAIL PROTECTED] 
> Subject: [PHP] How to Return 403 Forbidden headers

header('HTTP/1.0 403 Forbidden');


--
03/27/2003, 09:59:06 AM
This e-mail and any attachments represent the views and opinions of only the sender 
and are not necessarily those of Memphis Light, Gas & Water Division, and no such 
inference should be made.

==


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



[PHP] PHP Fusebox - Circuit within another Circuit

2003-05-29 Thread Christopher Ditty
We are using PHP Fusebox to develop one of our applications where I
work.
 I have a descent-grasp on the whole fusebox concept, but I am having
problems getting my head around how sub-circuits work. Can anyone
offer
any advice?  When I go to the main fuseaction, all works fine.  When I
try to go to main.admin, I just get a blank screen.  Even if there is
nothing in the admin directory.

I have copied my switch and circuits file below.

Chris

fbx_Switch.php
switch($Fusebox["fuseaction"]){
case "main":
case "Fusebox.defaultFuseaction":
dsp_page_header($config, $_GET);
dsp_page_main($config, $_GET);
dsp_page_footer($config, $_GET);
break;

case "admin":
$XFA["admin"] = "admin.main";
break;

default:
print "I received a fuseaction called '" .
$Fusebox["fuseaction"] . "' that circuit '" .
$Fusebox["circuit"]
. "' does not have a handler for.";
break;
}

fbx_Circuits.php
$Fusebox["circuits"]["home"] = "home";
$Fusebox["circuits"]["admin"] = "home/admin";
$Fusebox["circuits"]["account"] = "home/account";
$Fusebox["circuits"]["electric"] = "home/electric";
$Fusebox["circuits"]["gas"] = "home/gas";
$Fusebox["circuits"]["registration"] = "home/registration";

--
05/28/2003, 03:51:02 PM
This e-mail and any attachments represent the views and opinions of only the sender 
and are not necessarily those of Memphis Light, Gas & Water Division, and no such 
inference should be made.

==


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



[PHP] php5 and mysql licences

2003-06-30 Thread Christopher Speer
Hello,

i just read the news on php.net and wondered what it says about php5 and
MySQL.
They say that the libs for using a mysql server are not implemented any
more,... so my question is: does that mean i (we) have to buy the licences
to be allowed to use the mysql libs for php?

kind regards
Christopher Speer ( Europe - Germany )



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



[PHP] subtracting 2 time strings

2002-08-11 Thread Christopher Molnar

Help!

I can't find reference to it in the manuals but I need to subtract to 
time strings.

ex:

time_in = 11:00
time_out = 13:45

job_time = 2:45


I have stored these times into mysql as a TIME type column (yeh... I 
know really dumb - but to much data at this point to loose).

Does anyone have any thoughts on how I could do this?

Thanks,
-Chris

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




Re: [PHP] subtracting 2 time strings

2002-08-11 Thread Christopher Molnar

Thanks! Worked perfectly!

-Chris

On Sunday, August 11, 2002, at 09:27 AM, Matt wrote:

>> From: "Christopher Molnar" <[EMAIL PROTECTED]>
>> Sent: Saturday, August 10, 2002 11:37 AM
>> Subject: [PHP] subtracting 2 time strings
>
>
>> Help!
>>
>> I can't find reference to it in the manuals but I need to subtract to
>> time strings.
>>
>> ex:
>>
>> time_in = 11:00
>> time_out = 13:45
>>
>> job_time = 2:45
>
> Something like:
>  $time_in = "11:00";
> $time_out = "13:45" ;
> $start = strtotime($time_in);
> $finish = strtotime($time_out);
> $elapsed = $finish - $start;
> echo 'Elapsed time was ' . gmdate('H:i:s',$elapsed) . "\n";
> ?>
>


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




Re: [PHP] MySQL - Creating The Database

2002-06-04 Thread Christopher Riordan

He'll Be Back, they all come back

Chris

- Original Message -
From: "Jason Teagle" <[EMAIL PROTECTED]>
To: "PHP Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, June 04, 2002 9:45 AM
Subject: Re: [PHP] MySQL - Creating The Database


>
> - Original Message -
> From: "David Freeman" <[EMAIL PROTECTED]>
> To: "'Jason Teagle'" <[EMAIL PROTECTED]>; "'PHP Mailing List'"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, June 04, 2002 1:58 PM
> Subject: RE: [PHP] MySQL - Creating The Database
>
> How very sad. It's not new - I've seen things like this on many lists and
> newsgroups. Apparently it is easier for people to be sarcastic and give a
> flippant RTFM response than to actually help people. The only list I've
ever
> seen that actually treated newcomers with a bit of respect in most cases
is
> WinDev.
>
> Here's an example of what a good answer would have been:
>
> "MySQL databases aren't single files like other types. They're like
> directories with files as tables.
> PHP itself can create a database, take a look at mysql_connect(),
> mysql_query() and the CREATE DATABASE SQL action."
>
> See? It gives the answer, involves no sarcasm or mockery, and above all,
> actually HELPS the OP.
>
> But no... being a smart-ass is easier, right?
>
> The trouble with wise guys like these is that they assume:
>
> 1) That the OP has not bothered to try to find the answer.
> We're not all geniuses, we can't all think laterally all the time, we
can't
> all come up with the right way of finding the answer. For the record, I
> _did_ look online using Google and _did_ look around the PHP manual, but
was
> unlucky enough not to end up on the route that shows mysql_create_db(). My
> misfortune.
>
> 2) That the OP already knows the answer.
> Coming from a number of other programming languages where it is not
possible
> to create a database programmatically, it is natural to assume that the
same
> might be true of PHP. Had I known that PHP could create it from scratch, I
> would not have needed to deal with this pathetic situation. But I didn't
> know, so I stupidly thought that I might get some help from a list
> pretending to help people trying to program in PHP.
>
> Obviously, I was wrong. Also my misfortune.
>
> Don't bother responding, I have left the list. Plenty of places where
people
> are actually willing to help.
>
> 
> _ _
> o oJason Teagle
>  <  [EMAIL PROTECTED]
>  v
> 
>
>
> --
> 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] PHP_AUTH_USER

2002-06-04 Thread Christopher Riordan

Set a Cookie then you can pull it out that way. PHP_Auth is based upon
Cookies from what I was able to figure out.

Chris

- Original Message -
From: "Fifield, Mike" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 04, 2002 9:59 AM
Subject: [PHP] PHP_AUTH_USER


> I have a bunch of pages on my site inside an apache .htaccess protected
> directory. After visitors have logged in I am on part of my site I need to
> find out which user it is that has logged in. I thought this information
was
> stored in the $PHP_AUTH_USER variable, but when I print this variable it
is
> empty. Does anyone know of way to tell on apache 7 how to tell with php
who
> is logged in?
>
>
> Mike Fifield
> Charles Schwab & Co, Inc.
> WARNING: All e-mail sent to or from this address will be received by the
> Charles Schwab corporate e-mail system and is subject to archival and
review
> by someone other than the recipient.
>
>



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




[PHP] phplib, sessions and multiple dirs

2002-06-06 Thread christopher levine


greetings.


i have a website running that has multiple user directories setup as 
HOST/username.  Each  subdirectory has its own subdir named
"admin" where i'm using phplib to do the session/user management and
authentication.

the problem i'm seeing is that when i login to username1/admin, i'm able
to directly access username2/admin, even though the user/pw
for that area is different in the auth_user table. 
obviously, this is not the desired functionality.

each username subdir has its own set of config.php files where 
i have been trying to override the session.cookie_path in the hopes of
at least restriciting the usage of the session cookie to the HOST/username
path.

i'm assuming that this has been encountered and solved before, but i have
been unable to find any help via google or the other associated dev/php
sites.

i'm running php 4.2.1, apache 1.3.24 and mysql 3.23.49 on a rh6.2 system.

any help or pointers to docs would be greatly appreciated.

thanks.

c.


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




[PHP] Reading MSWORD Doc File Comments

2002-07-01 Thread Crane, Christopher

Is there a way to read the comments of a MSWord Doc file. I would like to
get a directory listing of file in a directory that are mostly MSWORD docs.
I would like to list the files with a description after each one. With HTML
files I just read the file into a string and split it just after  and
then again before  and display that. I am not sure if something can
be done with a MSWORD doc. Thanks in advance to anyone that can help me or
chooses to comment.

Christopher J. Crane
Network Operations Manager
IKON Office Solutions
860.659.6464

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




RE: [PHP] Searching for string in text file help?

2002-07-01 Thread Cosby, Christopher

Try it this way.

";
readfile($file);
echo "";
}   
?>

Christopher S. Cosby
SciCare Software Services

> -Original Message-
> From: Tim Loepp [mailto:[EMAIL PROTECTED]] 
> Sent: Friday, June 28, 2002 7:43 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Searching for string in text file help?
> 
> 
> Hello, I'm hoping someone can help me as I' new to this and 
> can't figure it
> out myself.
> 
> PHP4.20 Win32
> 
> I'm trying to seach for a string that would occur about 10 
> lines into a text
> file. I don't want to search the entire file, and I just want 
> to know if the
> string exsists or not, but I don't really know what I'm 
> doing. This is what
> I was trying, it occurs inside a loop that is listing the files in a
> directory.
> 
>  $fp = fopen("$target_filename", "r");
>  $contents = fgets("$fp","4096");
>   if(strstr("$contents", "$search_str"))
>   {
>   echo "";
>   readfile("$target_filename");
>   echo "";
>   }
> 
> Thanks
> Tim Loepp
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


 - - - - - - -  Appended by Scientific-Atlanta, Inc.  - - - - - - -  
This e-mail and any attachments may contain information which is confidential, 
proprietary, privileged or otherwise protected by law. The information is solely 
intended for the named addressee (or a person responsible for delivering it to the 
addressee). If you are not the intended recipient of this message, you are not 
authorized to read, print, retain, copy or disseminate this message or any part of it. 
If you have received this e-mail in error, please notify the sender immediately by 
return e-mail and delete it from your computer. 




[PHP] Undefined Offset Error

2002-07-02 Thread Crane, Christopher

Here is a piece of my code...
Could someone tell me what I did wrong? I get the following errors;

Warning: Undefined offset: 1 in c:/www/htdocs/demos/download/inx_news.php on
line 33
Warning: Undefined offset: 1 in c:/www/htdocs/demos/download/inx_news.php on
line 34 

(obviously, the line numers will not be the same here)

define('SCRIPT_NAME', 'InXNews');
define('SCRIPT_VERSION', 'v1.1');
define('SCRIPT_CREATOR', 'mailto:[EMAIL PROTECTED]";>Chris
Crane');
define('CREATE_DATE', '05/29/02');
define('REVISED_DATE', '06/04/02');

$open = fopen("http://www.yahoo.com/index.html";, "r");
$read = fread($open, 25000);
fclose($open);

list($StringA, $StringB)= split ("In The News", $read);
list($StringC, $StringD)= split ("",
$StringB);
list($StringE, $StringF)= split ("", $StringD);
$StringE = str_replace("s/", "http://yahoo.com/s/";, $StringE);
$StringE = str_replace("In the News";

// Keep this line, everything else can change for the output.
print "$StringE";

// Ok to be suppressed.
print "Script Name: " . SCRIPT_NAME . "Version: " .
SCRIPT_VERSION;
print "Creator: " . SCRIPT_CREATOR . "";


Christopher J. Crane
Network Operations Manager
IKON Office Solutions
860.659.6464

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




[PHP] PHP Script Speed

2002-07-08 Thread Crane, Christopher

I have a question on speed but also dealing with the method of scripting.
I have a few pages where I get things like weather and stocks. I get the
data, which is usually in the form of a Comma delimited string like the
stock quotes from Yahoo.com. In the past, I also wrote a function to get the
data and split into variables like $S_Current, $S_ChangePercent,
$S_ChangeDollar ect  Then I would print out a whole HTML table with the
variables embedded within. This function was called from a PHP type web
page. Lately, I have been making the variables global and using them when I
need them. For instance, I have a page called index.php. At the stock
section of the page, I have a function that is called and returns the major
indices, like NASDAQ, DOW and S&P. I global the variables and then within
the index.php page I called the variables as I need them in tables. This
makes designing the page simple. I can do it in Frontpage or Dreamweaver or
whatever. The old way was to call the function and the function would print
out the HTML table as part of the function.
 
I hope I am explaining this well enough to understand. Doing it the newer
way for me with the global variables makes it easier to design the web page,
but I am wondering if it is at the cost of a slower page loading. The reason
I think this is whenever I would like to display a variable I have to put in
a script tag like . I might have as many as 20 of
these on a page. Every time doesn't PHP have to start again and parse out
this information causing it to be really slow?
 
The old way was for me to call the function like  and
then the function would print out;


Dow
NASDAQ
S & P


$Dow_Current
$Nas_Current
$Snp_Current


 
Which is faster? Which is better? Is there another way?

Christopher J. Crane
Network Operations Manager

IKON Office Solutions
860.659.6464

 



[PHP] using mail() - what is max number of email addresses I can specify in To field?

2003-10-22 Thread John Christopher

I am writing a script that will query a database
table for some statistical information, and then
email it (daily, weekly, and monthly) to a list of
subscribers.  I don't know ahead of time how many
persons will be subscribed to receive the info
(it could be 20 persons or 2000 or more).  Email
addresses can be added to or deleted from the
subscriber list at any time.

If I am not mistaken, MTAs have a limit on how
many recipients can be specified on the To: line
of an email message.  What is the limit, or does
it depend on the MTA you're using (sendmail, qmail,
etc), or other factors?  If there is such a limit,
then what is the best way to send the message to
each recipient?

Thank you.


__
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com

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



[PHP] Installing PHP on HP

2003-11-14 Thread Christopher Weaver
For learning purposes, can I install and run PHP on my XP Home Edition
machine?  If not that, how about an NT 4.0 Workstation?

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



[PHP] php'ed mysql query

2001-01-16 Thread Christopher Allen


Hello,
Can anyone tell me why this query errors out? It works from the  mysql
client command line just fine


$query1 = "select * from zip_base where '$zip1' >= zip  && '$zip1' <= CONCAT
(SUBSTRING(zip , '1' , LENGTH (zip) - LENGTH (range) ), range)";




Christopher C. M. Allen


-- 
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'ed mysql query

2001-01-16 Thread Christopher Allen

> If you are going to do a comparison from one of the fields in your table,
> doesn't the field name need to be on the left hand side of the comparison?
> So instead of "where '$zip1' >= zip", shouldn't it be "zip < '$zip1'" (et
al
> for the other comparisons in your query) .
>
Didn't matter. Is there a trick for using concat or substring or any string
functions in a mysql query that is sent by php??



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




[PHP] decimal point movement...

2001-01-18 Thread Christopher Allen


Greetings!

I am looking for an efficeient way to assign a decimal to a number and store
the new number.
I wanto add a decimal point after the first 2 leading digitis..
while ( query runs)
{

$temp=007170;
$changed_to_deicmal_form;  // would store .7170
}

Furthermore I was using printf to round up numbers...has anyone found a
different or better way?





Christopher C. M. Allen


-- 
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] Help, can't seem to get this write

2001-01-19 Thread Christopher Riordan

I'm trying to make it so I can download the image from a given URL and
rewrite it locally on the server. I can connect to the server and get the
image and display it. but as soon as I write it it doesn't work, I get
either an empty image or a string holder. The code is bleow. the hard coding
is just for testing purposes

Chris



function downloadfile($url, $imageDir)
 {
  if(!$file = fopen($url , "r"))
   {
echo ("couldn't open $url\n");
   }
  else
   {
#fpassthru($file);
if($file2 = fopen("/www/sinead/images/Full/Sinead200.jpg", "w"))
 {
  $content=fread($file, filesize("$file"));
  fwrite($file2, $content, filesize("$file"));
  echo ("$file2 created");
 }
   }
 }
?>




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




Re: [PHP] warning 1 is not mysql result index

2001-01-24 Thread Christopher Allen



I want to get the result from first row (the one next from ID field) of the
table using
$HotelName = mysql_result($resultHotel,0,1) or die(mysql_error());

A suggestion:
Why don't you use mysql_fetch_row or any other function that reaches
beyond just getting 1 field?
this would be easier perhaps for you visualize the data you are trying to
get.

http://www.php.net/manual/en/function.mysql-fetch-row.php






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




Re: [PHP] warning 1 is not mysql result index

2001-01-25 Thread Christopher Allen



> still did not work. Keep returning the same error when I do this:
> $HotelName = mysql_fetch_row($resultHotel,1) or die(mysql_error());

what was your connection statement and query to the db? I would look to
these ass the culprit

heres an example :
mysql_connect("localhost", "$username", "$pass" );
mysql_select_db( "$db_name") or die( print  "Unable to select database");
$query1 =" SELECT *  FROM $table WHERE ID=$last_id";
$result = MYSQL_QUERY($query1);
$row = mysql_fetch_object ($result)

$fname = $row->firstname;
 $dog_tag  = $row->ID;

Ofcourse you need to check for errors etc..

Good Luck!


-- 
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] SQL Server DB to mySQL DB

2001-01-25 Thread Christopher Allen

Just did this to a 65mb fixed width file.
What I did was get it into a csv file via perl :)

Then I created the db table.
Then I used:
load data infile "/file.csv" into table blah fields terminated by ',' ;
then go ahead and create any indexes etc...

!works slick!

> Is there an easy way to do this? I know that SQL Server can export a comma
> delimited file, can mySQL import this? I imagine the PHP will be easy to
> modify as long as the field names are the same.



-- 
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] Zend hit (Encoder price)

2001-01-26 Thread Christopher Allen


> Unfortunately, it's not that simple.
>
> You haven't factored in Support costs nor administrative overhead nor...
> Well, I don't know what else the Marketing folks do when they figure these
> things out, but that's why I'm not in Marketing, eh?


Right it's not my game either (marketing), but perhaps Zend would be willing
to supply why the price is at $6,000.
As you said above , it doesn't just stop when I buy the encoder. Whose going
to do the encoding and continue doing the encoding
with continued releases etc? A graphic designer? A consultant? I  have
listened to the arguments, 6000 is steep when you compare it with a download
from freshmeat. Writing  a c-module is not *that* far away from writing some
of the more complicated php/perl/python scripts.
Indeed this is what furthers php. I would rather see Zend charging for
support contracts, rather than the actual product



-- 
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] Best browser

2001-02-27 Thread Christopher Allen

J-,

I have tested  netscape communicator 4.76 with ssl extensively. no problems
what so ever.

Take a look at www.modssl.org for some of the common problems that are
associated with Internet Explorer
and ssl.

>The users all have MS Win 95, 98, or NT.  The
> quality (ie. the 'bug-free-ness") of the browser's SSL code
> is very important.  What browser should I choose?



-- 
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] Best browser

2001-02-27 Thread Christopher Allen


- Original Message -
From: Kurth Bemis <[EMAIL PROTECTED]>
To: Jason Jacobs <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 27, 2001 9:43 AM
Subject: Re: [PHP] Best browser


> At 10:39 AM 2/27/2001, Jason Jacobs wrote:
>
> he's probably referring to the SSL code that the browser uses.  In that
> aspect - it doesn't matter

Actually it does. On the mod_ssl user list countless messages go by with IE
not working with ssl. Various work arounds have been implemented but IE is a
pain.  Here are common probs

http://marc.theaimsgroup.com/?l=apache-modssl&w=2&r=1&s=Internet+Explorer&q=
b

http://www.modssl.org/docs/2.8/ssl_faq.html#ToC48


-- 
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] oohform validation help

2001-03-08 Thread Christopher Cheng

What should I put in for the parameter jvs_name of the oohform->start? Is
that a name of another javascript file? Where can I get a sample script?

I would like to make sure the clients put in something in the textbox.





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

2001-03-09 Thread Christopher Allen





> The chicken did.
> 
> as the Chicken is an actual chicken
> and the egg is a potential chicken.
> Actuality precedes potentiality


amen brotha.


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

2001-03-15 Thread Christopher Allen

This is _and_ was _and_ ever shall be the state of mailing lists that help
people.
In the years that I have been on mailing lists, I have never seen a high
volume list that wasnt
filled with request after request for common knowledge.

The problem is not stopping people from asking the same manual Q's over and
over , it's actually taking/assisting the burden
off of the people that answer the Q's.

Thus we get a moderated list

> The problem is that people are lazy or just to stupid to look for stuff.
> Sometimes yes, we just miss something small or it is under another
section.
> I have done it as recently as tuesday with implode.  But this is getting
nuts.
> I guess I am frustrated because all the lists I am on are filled with lazy
> people
> who whine and want someone else to do all their work for them.  PHP is not

take it easy,

christopher


-- 
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] SOMEONE SHOOT ME!!!

2001-04-20 Thread Christopher Riordan

First off get php4.04p1 second you will need to hack the module code in
apache before running configure. in src/modules/php4. edit the
libphp4.modules file. and change c-client4 to c-client then rebuild apache.
you should be all set then. for some reason c-client4 doesn't work. I just
figured it out myself :)


Chris




""Rick Kukiela"" <[EMAIL PROTECTED]> wrote in message
000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]">news:000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]...
> Ok,
>
> I cant comprehend why php/apache is so freakin impossible to compile with
> IMAP support?!? what is going on?
>
> Ok, I am running OpenBSD 2.7, I downloaded the c-client stuff and complied
> it and put the includes in the appropriate places, then i followed the php
> installation instructions so i go into my apache src directory and do a
>
> ./configure
>
> then I go into my php src directory and do a
>
./configure --with-mysql --with-imap --with-apache=../apache_1.3.19 --enable
> -track-vars
>
> this works fine.
>
> I do the make; make install
>
> works fine,
>
> cd ../apache_1.3.19
>
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/li
> bphp4.a
>
> This is what happens. Can some one please tell me why this is happening
and
> what I can do to work arround it?
>
> Configuring for Apache, Version 1.3.19
>  + using installation path layout: Apache (config.layout)
>  + activated php4 module (modules/php4/libphp4.a)
> Creating Makefile
> Creating Configuration.apaci in src
> Creating Makefile in src
>  + configured for OpenBSD platform
>  + setting C compiler to gcc
>  + setting C pre-processor to gcc -E
>  + checking for system header files
>  + adding selected modules
> o php4_module uses ConfigStart/End
>  + checking sizeof various data types
>  + doing sanity check on compiler and options
> ** A test compilation with your Makefile configuration
> ** failed.  The below error output from the compilation
> ** test will give you an idea what is failing. Note that
> ** Apache requires an ANSI C Compiler, such as gcc.
>
> cd ..;
>
gcc  -I/usr/local/src/php-4.0.3pl1 -I/usr/local/src/php-4.0.3pl1/main -I/usr
>
/local/src/php-4.0.3pl1/main -I/usr/local/src/php-4.0.3pl1/Zend -I/usr/local
>
/src/php-4.0.3pl1/Zend -I/usr/local/src/php-4.0.3pl1/TSRM -I/usr/local/src/p
>
hp-4.0.3pl1/TSRM -I/usr/local/src/php-4.0.3pl1 -DUSE_EXPAT -I./lib/expat-lit
> e -DNO_DL_NEEDED `./apaci` -o helpers/dummy
>
helpers/dummy.c   -rdynamic -Lmodules/php4 -L../modules/php4 -L../../modules
> /php4 -lmodphp4  -lc-client  -lresolv -lm  -lresolv
> ftl_unix.c:29: Undefined symbol `_mm_fatal' referenced from text segment
> auth_md5.c:101: Undefined symbol `_mm_login' referenced from text segment
> auth_pla.c:59: Undefined symbol `_mm_log' referenced from text segment
> auth_pla.c:69: Undefined symbol `_mm_login' referenced from text segment
> auth_log.c:63: Undefined symbol `_mm_login' referenced from text segment
> env_unix.c:976: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:993: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:999: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1048: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1054: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1149: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1161: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:1206: Undefined symbol `_mm_log' referenced from text segment
> env_unix.c:0: More undefined symbol _mm_log refs follow
> unix.c:306: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:328: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:346: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:433: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:574: Undefined symbol `_mm_flags' referenced from text segment
> unix.c:690: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:715: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:747: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:791: Undefined symbol `_mm_notify' referenced from text segment
> unix.c:807: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:810: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:847: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:896: Undefined symbol `_mm_notify' referenced from text segment
> unix.c:953: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:957: Undefined symbol `_mm_nocritical' referenced from text segment
> unix.c:0: More undefined symbol _mm_nocritical refs follow
> unix.c:1165: Undefined symbol `_mm_critical' referenced from text segment
> unix.c:1930: Undefined symbol `_mm_diskerror' referenced from text segment
> unix.c:2050: Undefined symbol `_mm_diskerror' referenced from te

Re: [PHP] SOMEONE SHOOT ME!!!

2001-04-20 Thread Christopher Riordan

Just a quick addemdum. run the configure normaly on php4, then edit the
config.status and config_var.mk file. then you won't need to edit the files
anywhere else. make the same change as I mentioned before the c-client4 to
c-client. then run make make install then compile apache and you should be
all set :)


Chris

""Christopher Riordan"" <[EMAIL PROTECTED]> wrote in message
9bqfn3$onp$[EMAIL PROTECTED]">news:9bqfn3$onp$[EMAIL PROTECTED]...
> First off get php4.04p1 second you will need to hack the module code in
> apache before running configure. in src/modules/php4. edit the
> libphp4.modules file. and change c-client4 to c-client then rebuild
apache.
> you should be all set then. for some reason c-client4 doesn't work. I just
> figured it out myself :)
>
>
> Chris
>
>
>
>
> ""Rick Kukiela"" <[EMAIL PROTECTED]> wrote in message
> 000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]">news:000c01c0c76f$61ed1ac0$[EMAIL PROTECTED]...
> > Ok,
> >
> > I cant comprehend why php/apache is so freakin impossible to compile
with
> > IMAP support?!? what is going on?
> >
> > Ok, I am running OpenBSD 2.7, I downloaded the c-client stuff and
complied
> > it and put the includes in the appropriate places, then i followed the
php
> > installation instructions so i go into my apache src directory and do a
> >
> > ./configure
> >
> > then I go into my php src directory and do a
> >
>
./configure --with-mysql --with-imap --with-apache=../apache_1.3.19 --enable
> > -track-vars
> >
> > this works fine.
> >
> > I do the make; make install
> >
> > works fine,
> >
> > cd ../apache_1.3.19
> >
>
./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/li
> > bphp4.a
> >
> > This is what happens. Can some one please tell me why this is happening
> and
> > what I can do to work arround it?
> >
> > Configuring for Apache, Version 1.3.19
> >  + using installation path layout: Apache (config.layout)
> >  + activated php4 module (modules/php4/libphp4.a)
> > Creating Makefile
> > Creating Configuration.apaci in src
> > Creating Makefile in src
> >  + configured for OpenBSD platform
> >  + setting C compiler to gcc
> >  + setting C pre-processor to gcc -E
> >  + checking for system header files
> >  + adding selected modules
> > o php4_module uses ConfigStart/End
> >  + checking sizeof various data types
> >  + doing sanity check on compiler and options
> > ** A test compilation with your Makefile configuration
> > ** failed.  The below error output from the compilation
> > ** test will give you an idea what is failing. Note that
> > ** Apache requires an ANSI C Compiler, such as gcc.
> >
> > cd ..;
> >
>
gcc  -I/usr/local/src/php-4.0.3pl1 -I/usr/local/src/php-4.0.3pl1/main -I/usr
> >
>
/local/src/php-4.0.3pl1/main -I/usr/local/src/php-4.0.3pl1/Zend -I/usr/local
> >
>
/src/php-4.0.3pl1/Zend -I/usr/local/src/php-4.0.3pl1/TSRM -I/usr/local/src/p
> >
>
hp-4.0.3pl1/TSRM -I/usr/local/src/php-4.0.3pl1 -DUSE_EXPAT -I./lib/expat-lit
> > e -DNO_DL_NEEDED `./apaci` -o helpers/dummy
> >
>
helpers/dummy.c   -rdynamic -Lmodules/php4 -L../modules/php4 -L../../modules
> > /php4 -lmodphp4  -lc-client  -lresolv -lm  -lresolv
> > ftl_unix.c:29: Undefined symbol `_mm_fatal' referenced from text segment
> > auth_md5.c:101: Undefined symbol `_mm_login' referenced from text
segment
> > auth_pla.c:59: Undefined symbol `_mm_log' referenced from text segment
> > auth_pla.c:69: Undefined symbol `_mm_login' referenced from text segment
> > auth_log.c:63: Undefined symbol `_mm_login' referenced from text segment
> > env_unix.c:976: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:993: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:999: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1048: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1054: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1149: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1161: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:1206: Undefined symbol `_mm_log' referenced from text segment
> > env_unix.c:0: More undefined symbol _mm_log refs follow
> > unix.c:306: Undefined symbol `_mm_critical' referenced from text segment
> > unix.c:328: Undefined symbol `_mm_nocritical' referenced from tex

[PHP] Icq Message

2001-04-23 Thread Christopher Allen

Greetings:

Anyone have a clue as how to send an icq message to a given ICQ number via a
php-web-page?

TIA.

Christopher C. M. Allen


-- 
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] checking if e-mail address and syntax are valid

2001-04-24 Thread christopher hamilton


I'd like to add to that, before someone spends a lifetime searching for an
answer ...

"Solution: There isn't one. You cannot do real-time validation of mail
addresses. You must pick from a number of compromises."

The section goes on describing how many RFC-valid addresses are
undeliverable and on the opposite side of the coin, some RFC-invalid
addresses are perfectly deliverable.

"Our best advice for verifying a person's mail address is to have them enter
their address twice, just as you would when changing a password."

- Chris

> > I would like to know if anyone has or know any PHP code to verify if a
> > form entered e-mail address is valid?
> >
> > I would like that things like 4$%^%$@@.com.br could not be sent. I only
> > has to verify the syntax of it, the existance I believe should be harder
> > to verify but if it is possible I would be glad if anyone could point me
> > the way.
>
> This is taken from PHP Developers Cookbook. Don't ask me exactly what it
> does, because I don't know. I think I can grasp the basics of it though.
> It isn't fool proof tho.
>
>
> if (!eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$",
> $users)) die ("Invalid email");


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

2001-05-14 Thread Christopher Ostmo

Tyrone Mills pressed the little lettered thingies in this order...

> How about using something like puTTY or SecureCRT?
> 

Just a side note.  I also like SecureCRT, but it isn't "free" (which was 
the original request) unless you install an "alternative license."  It's 
worth the $99 to me, but the requestor was looking for free.

> I use puTTY to connect Windoze boxes to my linux servers all the time, it
> works great and actually passes the function keys to remote server instead
> of interpreting them itself.
> 

puTTY's the best freebie I've seen.  With the recent release of the SSH2 
patents, I wouldn't be surprised to see some REALLY good SSH clients 
in the freeware community soon.

Have fun...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] Is there a better way to do this

2001-05-16 Thread Christopher Heschong

on 5/16/01 5:10 PM, Richard Kurth at [EMAIL PROTECTED] wrote:

> Is there a better way to do thisI want it to look and see if the
> userdata file is there and if true the bypass everything else run rest
> of code. If is not then check to see if userdat1 is and if it is
> change it's name to userdata the run rest of code. If none of the are
> there then gust shut down.
> 
> 
> if(file_exists("userdata")) {
> end;
> } elseif(file_exists("userdata1")) {
> copy('userdata1','userdata') ;
> system("rm userdata1");
> end;
> } else {
> exit;
> }
> 
> 
> < rest of code>

if (!file_exists("userfile")) {
 if (file_exists("userdata1") {
  unlink("userfile1");
 }
 else {
  exit;
 }
}

is a bit cleaner.  I'd use unlink("userfile1") rather than system("rm
userfile1") just to be pretty.

-- 
/chris/


-- 
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] - Hard return in readfile

2001-05-16 Thread Christopher Heschong

on 5/16/01 8:38 PM, Ray Iftikhar at [EMAIL PROTECTED] wrote:

> I have many text files stored on my server. I call them use using the
> "readfile" function. While that works great, it seems to over-write the hard
> returns. This has hurt the format and readability of my information.
> 
> ie.
> text file:
> This is
> a
> 
> test
> 
> output:
> This is a test
> 
> is there someway to get "readfile" to recognize returns in the file?
> Thanks in Advance..
> Ray

Sounds like you are displaying the text as HTML.  You can either surround
the data with  tags, or use the nl2br() function to convert each new
line to a  tag.

-- 
/chris/


-- 
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] Escaping from "<"

2001-05-16 Thread Christopher Heschong

on 5/16/01 9:12 PM, Augusto Cesar Castoldi at [EMAIL PROTECTED] wrote:

> I'm tring to print the variable "tmp", but the echo is just printing "abcd",
> the rest he can't print.
> 
> Why?
> 
> regards,
> 
> Augusto
> 
> $tmp="abcd echo $tmp."";
> echo "";
> $tmp=addslashes($tmp);
> echo $tmp."";
> echo "";
> $tmp=stripslashes($tmp);
> echo $tmp."";
> 

Try htmlspecialchars() instead of addslashes();

$tmp="abcdhttp://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] Uptime script?

2001-05-16 Thread Christopher Heschong


On Wednesday, May 16, 2001, at 09:47 PM, Ryan Christensen wrote:

> No.. as I said in my original post, this is on Linux.. so I was actually
> wondering how it would be a risk in Linux.. not win..

If you want to get the current uptime in Linux without a system() call, 
you should be able to fopen() the /proc/uptime file.  The first number 
is the number of seconds the machine has been up, the second is the 
number of seconds the machine's processes have been idle.

--
/chris/


-- 
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 mod_php4 faster than mod_perl?

2001-05-19 Thread Christopher Leigh

i'm wondering if mod_php4 is faster than mod_perl.

thank you,



christopher


-- 
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] ok, are servlets/jsp faster than php4?

2001-05-20 Thread Christopher Leigh

ok, are servlets/jsp faster than php4?



since zend cache isn't free... :(



-- 
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] Discussion board

2001-05-22 Thread Christopher Schreiber

I'd recommend taking a look at vBulletin... version 2 was just release
and it is the most powerful PHP based discussion board available:

http://www.vbulletin.com/

Hope this helps,

-Original Message-
From: Thomas Deliduka [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 22, 2001 3:10 PM
To: PHP List
Subject: [PHP] Discussion board


Is there a good PHP alternative for a discussion board or something else
that allows for moderators and other good features that will run on Linux?

-- 

Thomas Deliduka
IT Manager
 -
New Eve Media
The Solution To Your Internet Angst
http://www.neweve.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] writing to file quick and easy.

2001-05-23 Thread Christopher Allen

Hello:

Lookin for a little advice here.

I have a series of scripts that dynamically create web pages. The last page
in the series I wish to be able to write out to a file.
Is there a simple/quick way in which I can take the process(ing) script and
write it to a file at the same time that it is displaying?
I need it to both display and be able to be downloaded such that the last
thing that this script would do is create a link to itself in html format.
Something to the effect that whatever was being passed to the browser could
also be passed thru an open file handle thus written to a file


Thanks,
Christopher C. M. Allen


-- 
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] Page Refresh

2002-04-23 Thread Crane, Christopher

I use a template page and then split out the middle of the page to do my PHP
stuff depending on a variable I pass to it.
I have a problem I hope someone can help me on.
The template page has a meta refresh in the header set for 60 secs. One of
the things this page does is insert data into a MySQL database. The problem
is once it is finished it displays the same form used to enter the data in
the MySql database for another record to be added if you wish...here comes
the problem. After the first insert, the data form is redisplayed, but after
the 60 secs and the refresh takes place it runs the last insert again. If
the user just leaves that page up, every 60 secs it will insert another
record every 60 secs. 
 
I was thinking there may be a mechanism to redirect to a different URL after
the database insert, but I do not know how to do that. I want to keep the
meta refresh because there is a lot of dynamic data displayed on the
template page that changes. Which is the reason for the Meta Refresh to
begin with...
 
 

Christopher J. Crane
Network Operations Manager

IKON Office Solutions
860.659.6464

 



RE: [PHP] Page Refresh

2002-04-23 Thread Crane, Christopher

That is my goal to only use only file and I do use a lot of IF statements.
I will try this. I have not used the Header() function. I will take a look
at it. If you have an example, that would be great.

-Original Message-
From: Justin French [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 23, 2002 10:06 AM
To: Crane, Christopher
Subject: Re: [PHP] Page Refresh
Importance: High


i don't undertand why you have the meta refresh in there, but the porblem
you have is simular to any one who clicks refresh on their browser...

essentialy, what you want to do is after the DB insert, use a header()
redirect to a blank form -- steps might look like:

1. form.php (blank) [click submit]
2. validate.php
   a) if not ok redirect to form.php (with entered data)
   b) if ok, insert into DB & redirect to form.php (blank)

In other words, form.php doesn't actually print any data to the screen, it
just evaluates the entered data, and acts upon it.

The value of this is that if the user never sees validate.php, they can't
refresh it (or have a meta refresh), so the data can't be inserted more than
once via a refresh.

if they refresh the form.php, the DB will not be affected.


If you're cleaver with if() statements and other control structures, you can
actually achieve this effect with only one file (form.php)... but that's
another story :)


Have fun,

Justin French

Creative Director
http://Indent.com.au





on 23/04/02 11:47 PM, Crane, Christopher ([EMAIL PROTECTED]) wrote:

> I use a template page and then split out the middle of the page to do my
PHP
> stuff depending on a variable I pass to it.
> I have a problem I hope someone can help me on.
> The template page has a meta refresh in the header set for 60 secs. One of
> the things this page does is insert data into a MySQL database. The
problem
> is once it is finished it displays the same form used to enter the data in
> the MySql database for another record to be added if you wish...here comes
> the problem. After the first insert, the data form is redisplayed, but
after
> the 60 secs and the refresh takes place it runs the last insert again. If
> the user just leaves that page up, every 60 secs it will insert another
> record every 60 secs.
> 
> I was thinking there may be a mechanism to redirect to a different URL
after
> the database insert, but I do not know how to do that. I want to keep the
> meta refresh because there is a lot of dynamic data displayed on the
> template page that changes. Which is the reason for the Meta Refresh to
> begin with...
> 
> 
> 
> Christopher J. Crane
> Network Operations Manager
> 
> IKON Office Solutions
> 860.659.6464
> 
> 
> 

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




Re: [PHP] compiling on freebsd

2002-04-24 Thread Christopher Riordan

what are you using for your flags when you do ./configure

normal should be ./configure --with-apxs=/usr/local/apache/bin/apxs

Things like that. if you ran ./configure nothing will compile the libphp4
for you. there is a Install file which will walk you thru the setup also on
the manual on php.net under installation there is a freebsd section.

Christopher Riordan
http://www.hal-9000.net

- Original Message -
From: "Larry Brown" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Thursday, April 25, 2002 1:30 AM
Subject: RE: [PHP] compiling on freebsd


> I don't mean to be rude but as I mentioned in my post "After running
> ./configure make and make install...".  Please review my post for the
actual
> problem.
>
> Larry S. Brown MCSE
> Dimension Networks, Inc.
> Member ICCA
> (727) 723-8388
>
> -Original Message-
> From: Evan Nemerson [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 25, 2002 1:25 AM
> To: Larry Brown; [EMAIL PROTECTED]
> Subject: Re: [PHP] compiling on freebsd
>
> ./configure
> make
> make install
>
>
>
> On Wednesday 24 April 2002 22:08 pm, you wrote:
> > I am trying to get php installed and working on a freebsd server and I'm
> > used to using linux where it hasn't failed me before.  After running
> > ./configure make and make install there is no libphp4.so anywhere on the
> > server.  I ran just ./configure and make and then checked the current
> > directories for the file with no positive results.
> >
> > Larry S. Brown MCSE
> > Dimension Networks, Inc.
> > Member ICCA
> > (727) 723-8388
>
> --
> Common sense is not so common.
>
> Voltaire
>
>
>
> --
> 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] timezone problem

2002-05-21 Thread Christopher Riordan

I had a similar issue, for a thing I'm doing for a Messageboard I am writing
I need the timezones and offsets, so I compiled the best I could off
different sites and info, and created a Mysql Table with all the timezones
and offsets. there are duplicate offsets but since people know their TZ as
different things depending where they live. I can do a dump if people would
like


Chris Riordan
http://www.hal-9000.net


- Original Message -
From: "SP" <[EMAIL PROTECTED]>
To: "Baba Buehler" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, May 21, 2002 12:47 PM
Subject: RE: [PHP] timezone problem


> Hi Baba
>
> I've been trying to get as much info on this as
> possible and you are right it is quite messy.
> Thanks for that link, I'm going to take a look at
> your code.
>
>
>
> -Original Message-
> From: Baba Buehler [mailto:[EMAIL PROTECTED]]
> Sent: May 21, 2002 5:37 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] timezone problem
>
>
> Miguel Cruz wrote:
> >
> > In short, I believe it's an OS rather than a PHP
> thing.
> >
>
> time zones can be a messy and tricky beast.  all
> the PHP functions rely on
> the underlying OS implementation of time zone
> information.  sometimes this
> is controlled by the TZ environment variable,
> sometimes it is not.
>
> my solution was to extract as much info as
> reasonable from the zoneinfo
> database and manipulate it in PHP directly.  the
> solution is not perfect,
> but is probably the best that can be done without
> more PHP access to the
> underlying zoneinfo implementation.
>
> my code (with all the time zone data & zone IDs)
> is in PEAR:
> http://pear.php.net/package-info.php?pacid=57
>
>
> thanks,
> baba
>
>
> --
> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Undefined variables

2002-05-30 Thread Crane, Christopher

I have an annoying problem, that I know is my own ignorance to PHP. I came
from PERL and this was not a problem there but is with PHP.
 
Here's the issue.
I have a number of scripts that use a "index.php?Task='some sort of task
name'", for example, http://www.foo.com/index.php?Task=ShowVersion
<http://www.foo.com/index.php?Task=ShowVersion> .  Then I use an if/else
statement to tell the script what to do if it sees the ShowVersion variable.
In the ShowVersion example, I would call a function that displays the
version information I defined in the script. As a back up, I always provide
an else statement to catch variables I have no functions for.
 
If I have a ShowVersion function, GetData function and a CreateImage
function and the Task variable is empty or a variable that does not exists
comes in like http://www.foo.com/index.php?Task=SomethingDumb
<http://www.foo.com/index.php?Task=SomethingDumb>  it would go to the
default function of something by using the ELSE part of the if/else
statements. 
 
I hope I am describing this correctly.now here is the problem. If I have
warnings turned on, or if I have a log written for warnings, the log fills
up if someone goes to http://www.foo.com/index.php
<http://www.foo.com/index.php>  or http://www.foo.com <http://www.foo.com>
will error messages like undefine variable TASK on line 255. I understand
the reason, that PHP was expecting the variable Task when it got to the
if/else statements. So I put in something like if(!($Task)) { function
Something(); } but it still is looking for the variable so it still errors.
 
In Perl, it would simply be ignored. What do I do here.
 
Here is a simple example of the code.
 
if ($Task == "ShowVersion") { function ShowVersion(); }
elseif ($Task == "GetData") { function GetData(); print "$DataOutput"; }
elseif ($Task == "CreateImage") { function CreateImage(); }
else { print "Incorrect Variable or no Variable Supplies"; }
 
 
 
 

Christopher J. Crane
Network Operations Manager

IKON Office Solutions
860.659.6464

 



[PHP] Is PHP used by U.S. Government? By U.S. DoD?

2002-05-31 Thread John Christopher


I would like to use PHP in a project for a United States
Government client.  The client is skeptical because PHP
is not a Microsoft product.  I'm looking for statistics and
links that show that PHP *is* currently in use by the
US Government.

Is PHP used by the U.S. Department of Defense?  Examples?

Is PHP a U.S. Military Standard?

Any stats or links would be most helpful.  Thank you.


__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

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




[PHP]

2002-05-31 Thread Crane, Christopher

Here is a piece of code, that is close to doing what I want it to.
The end result I would like to have is an array that is simple to work with.
If the XML tag was RED HAT, I would like something
like the following:
 
$Tags['issue-name']. So I could print it out. Something like, print
"$Tags['issue-name']\n";
 
I was able to get a numerical representation of the array like, $Tags[5] and
the value of that tag was "RED HAT", but then I would have to know what the
position of the data I am looking for in the array. I would prefer to know
the tag name and the array and get to the data that way. I know there is a
way to do this, but I just can't figure it out. There is a lot of
information on Parsing the XML file but not getting into a useful array, or
at least that I have found easily to understand.
 
 
if(!isset($Sym)) { $Sym = 'IKN'; }
$URI = 'http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
$simple = implode( '', file("$URI$Sym"));
 
$p = xml_parser_create();
xml_parse_into_struct($p,$simple,$vals,$index);
xml_parser_free($p);
//echo "Index array\n";
//print_r($index);
//echo "\nVals array\n";
//print_r($vals);

Christopher J. Crane
Network Operations Manager

IKON Office Solutions
860.659.6464

 



RE: [PHP] XML HELP

2002-04-09 Thread Crane, Christopher

I got it to work with the following code. Thank you so much for your help.
The problem is now back to the beginning, I can not get the $Line value,
which is the data I want to be pushed into an array. I did not get an error
with the code below, but I did not get any information when printing the
array.


http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
 
 
function StartHandler($Parser, $ElementName, $Attr='') { print
"$ElementName: "; }

function CharacterHandler($Parser, $Line) { array_push($StockStuff, $Line);
print "$Line\n"; }
 
function EndHandler($Parser, $ElementName, $Attr='') { }
 
 
while ( list(,$Sym) = each($Symbols) ) {
   $Contents = implode( '', file("$URI$Sym") );
 
   $Parser = xml_parser_create('ISO-8859-1');
   xml_set_element_handler($Parser, 'StartHandler', 'EndHandler');
   xml_set_character_data_handler($Parser, 'CharacterHandler');
 
   if ( xml_parse($Parser, $Contents) ) { echo 'YES!'; }
   else { echo 'NO!'; }
 
   xml_parser_free($Parser);
 
 }

print "1st Position in the array = $StockStuff[0]\n";
 
?>

-Original Message-
From: Christopher J. Crane [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 09, 2002 7:21 AM
To: Crane, Christopher
Subject: Fw: [PHP] XML HELP



- Original Message - 
From: "Analysis & Solutions" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, April 08, 2002 10:33 PM
Subject: Re: [PHP] XML HELP


> Hey Christopher:
> 
> On Mon, Apr 08, 2002 at 09:14:08PM -0400, Christopher J. Crane wrote:
> > ok I tried this at your suggestion
> 
> Not exactly.  As mentioned, you've got all sorts of unneded stuff going 
> on.  To make sure you're on the right track, start with a new script 
> with just the basics:
> 
> 
>  
> $Symbols[] = 'ek';
> $Symbols[] = 'et';
> 
> $URI = 'http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
> 
> 
> function StartHandler($Parser, $ElementName, $Attr='') {
> }
> 
> function CharacterHandler($Parser, $Line) {
> }
> 
> function EndHandler($Parser, $ElementName, $Attr='') {
> }
> 
> 
> while ( list(,$Sym) = each($Symbols) ) {
>$Contents = implode( '', file("$URI$Sym") );
> 
>$Parser = xml_parser_create('ISO-8859-1');
>xml_set_element_handler($Parser, 'StartHandler', 'EndHandler');
>xml_set_character_data_handler($Parser, 'CharacterHandler');
> 
>if ( xml_parse($Parser, $Contents) ) {
>   echo 'YES!';
>} else {
>   echo 'NO!';
>}
> 
>xml_parser_free($Parser);
> 
> }
> 
> ?>
> 
> 
> Now, if that works, start flushing out the element/character handlers.  
> Do it little by little to make sure each of your steps are correct.
> 
> Enjoy,
> 
> --Dan
> 
> -- 
>PHP classes that make web design easier
> SQL Solution  |   Layout Solution   |  Form Solution
> sqlsolution.info  | layoutsolution.info |  formsolution.info
>  T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
>  4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] XML HELP

2002-04-10 Thread Crane, Christopher

ok I tried this code and the array is still empty.
By the way, my code looked the way it did because the browser or my mail
client cut it off. I had each of the functions on one line for easy reading
but because of the wrap I changed it to how you had it, which is how I would
normally do it if each function had more than one line to it.
 
http://quotes.nasdaq.com/quote.dll?page=xml&mode=stock&symbol=';
 
 
function StartHandler($Parser, $ElementName, $Attr='') {
 print "$ElementName: ";
 }
 
function CharacterHandler($Parser, $Line, $StockStuff) {
 array_push($StockStuff, $Line);
 print "$Line\n";
 }
 
function EndHandler($Parser, $ElementName, $Attr='') {
 }
 
 
while ( list(,$Sym) = each($Symbols) ) {
 global $StockStuff;
 $StockStuff = array();

 $Contents = implode( '', file("$URI$Sym") );
 
 $Parser = xml_parser_create('ISO-8859-1');
 xml_set_element_handler($Parser, 'StartHandler', 'EndHandler');
 xml_set_character_data_handler($Parser, 'CharacterHandler');
 
 if ( xml_parse($Parser, $Contents) ) { echo 'YES!'; }
 else { echo 'NO!'; }
 
 xml_parser_free($Parser);
 print "1st Position in the array = $StockStuff[1]\n";
  }
 
?>

Christopher J. Crane
Network Operations Manager

IKON Office Solutions
860.659.6464

 



[PHP] Eval()??? A variables contents?

2001-11-09 Thread Christopher Raymond




PHP Gurus:

I have one for you. I'm sure there is a simple solution, but I'm having
difficulty finding it.


Let's say I have:

$content = "";


If I use , it doesn't evaluate that content. What am
I doing wrong here?


Is there an equivalent to JavaScript's eval($commands) function?


TIA,

Christopher Raymond


-- 
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] Eval()??? A variables contents?

2001-11-09 Thread Christopher Raymond

on 11/9/01 2:01 PM, Kurt Lieber at [EMAIL PROTECTED] wrote:

> What you're doing doesn't make any sense.  If it were to work, it would look
> like the following:
> 
>  ; ?>,
> 
> or something similar.  I think what you want to do is:
>  $content = query_database($category);
> echo $content;
> ?>
> 
> that's using psuedo-code, of course.  You'll want to substitute correct php
> syntax for returning database results.




Kurt:

I understand where you are coming from, and I appreciate your answer.
However, I'm trying to get PHP to parse commands that are stored in a
variable because I'm passing those commands to a function. Inside the
function, it needs to evaluate the commands stored in the variable.

Does you solution solve that or does my description clarify my problem
better?


Thanks,

Christopher


-- 
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] MORE INFO > Eval()??? A variables contents?

2001-11-09 Thread Christopher Raymond



Okay there are two files involved here. First is my index.php file:

$params = array('class' => 'text10', 'content' => 'Query_Database( $category
)');

switch ( $mode ) {

case "list":

Make_TR( $params ); // This is executing the included function.
break;

default:
Display_Default();

}



Then there's the function that's located elsewhere in an include file:





  >

  
  
  

  






Christopher  <-- Still has no solution :-(


-- 
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] Newsgroup?

2001-11-15 Thread Christopher Raymond




Does anyone know:

What's the deal with the newsgroup version of this list? I'm using
news.php.net as the news server address, but all I get are error messages.

Is this newsgroup still functional?


Christopher Raymond







--
O  A  S  I  S N  E  T  W  O  R  K  S
--

INTERACTIVE FLASH MEDIA PRODUCTION
HTML, JAVASCRIPT, PHP & E-COMMERCE DEVELOPMENT
MACINTOSH TROUBLESHOOTING, REPAIR & NETWORKING

--
WEB:  http://www.oasisnetworks.com PHONE:  612.706.0767






-- 
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] Newsgroup?

2001-11-15 Thread Christopher Raymond




Hmm:

It must be my client then.


Christopher Raymond







--
O  A  S  I  S N  E  T  W  O  R  K  S
--

INTERACTIVE FLASH MEDIA PRODUCTION
HTML, JAVASCRIPT, PHP & E-COMMERCE DEVELOPMENT
MACINTOSH TROUBLESHOOTING, REPAIR & NETWORKING

--
WEB:  http://www.oasisnetworks.com PHONE:  612.706.0767






-- 
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] select as

2001-04-08 Thread Christopher Allen

Greets:

I have a bit of php code that looks for a matching user/pass in a mysql
table. There are three user/pass phrases in the table along with a an email
that corresponds to each user/pass pair.  Is there any way to construct a
query that will do both the matching of the user/passes and also then give
the corresponding email that matches the user/pass?


table roughly  looks like this:
username
pass
email
user_name2
pass2
email2

select * from customer where user_name='$username' && pass='$password'
|| user_name2='$username' && pass2='$pass'";

so if it matches on user_name2/pass2 I would then want to get email2...

Thanks for any help!

ccma




-- 
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] URL Encode >

2001-04-09 Thread Christopher Allen

In one page from a series of pages where I am building arrays for future
use:

$item4_array = urlencode (serialize ($item4_array));
echo "";
---
On my last page I send an email so I need the info that was stored:



$item4_array = unserialize(urldecode($item4_array));
$message .=" DIMS: L $item4_array[2] W $item4_array[3] H $item4_array[4]
\n";
$message .="Item Weight $item4_array[1] \n";


> Hey there,
>
> does anybody have any info regarding urlencode and rawurlencode


HTH--

ccma


-- 
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] Multipe Tables, Single Query Problem

2001-06-19 Thread Christopher Ostmo

Simon Kimber pressed the little lettered thingies in this order...

> Hi all,
> 
> I have three tables in my (mysql) database:
> 
> videos - ID, title, description, etc..
> links - ID, videoID, actorID
> actors - ID, name, dateofbirth, gender, etc...
> 

You need to be able to tie at least one field from each table to one other 
field in another table, and then you can have a query like:

SELECT videos.*, links.*, actors.*
FROM videos, links, actors
WHERE videos.VideoID = '$VideoID' AND
links.VideoID = videos.VideoID
actors.ActorID = links.ActorID

You should consider picking up the book called "MySQL." It covers this 
sort of thing rather well.

Good luck...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/



RE: [PHP] Multipe Tables, Single Query Problem

2001-06-19 Thread Christopher Ostmo

Simon Kimber pressed the little lettered thingies in this order...

> 
> Christopher Wrote...
> > You need to be able to tie at least one field from each table to
> > one other
> > field in another table, and then you can have a query like:
> >
> > SELECT videos.*, links.*, actors.*
> > FROM videos, links, actors
> > WHERE videos.VideoID = '$VideoID' AND
> > links.VideoID = videos.VideoID
> > actors.ActorID = links.ActorID
> >
> 
> Thanks Christopher,
> 
> but wouldn't this return a separate row for each actor?  I'm pretty sure i
> need something more than a simple join :o(
> 
> Here's my original question again: "what i need to do is return a
> particular video and all it's staring actors with just one query returning
> just one row, ie. with all the actor names in one field"
> 
> 

Hello,

I had your thought backwards in my mind.  I haven't ever seen a query 
that needed a sub-select that couldn't be written using joins.  It's true 
that in many cases sub-selects would be much simpler, but it's usually 
possible to rewrite sub-select queries using joins.  You can do this 
query with a simple join, but need to start with the table that will give 
multiple results first and load those results into an array.

For example:
$result=mysql("DBName","SELECT actors.*, links.*, videos.*
WHERE actors.VideoID = '$VideoID' AND
links.VideoID = actors.VideoID AND
videos.VideoID = actors.VideoID
ORDER BY whatever");
$i=0;
while ($row = mysql_fetch_row($result)) {
$actorsField1[$i] = $row[0];
$actorsField1[$i] = $row[1];
...
$linksField1 = $row[10];
$linksField1 = $row[11];
...
$videosField1 = $row[20];
$videosField1 = $row[21];
...
$i++;
}

If the results of the links and videos tables are going to be the same for 
each query, then there's no need to save those values in an array.  If 
there are going to be multiple results for any other table, you will also 
want those to be saved as an array.  What you are attempting could 
also be done a little differently by using a LEFT JOIN, but I think that the 
above statement will do what you want (If I am in fact understanding 
what you want).  You may also want to change the above SELECT to 
have "links.ActorID = actors.ActorID" if your links table is tied to the 
actors and not the videos. You can then show your results like:
echo "$videosField1
$videosField2
$linksField1
$linksField2";
for ($i = 0; $actorsField1[$i]; $i++) {
echo "$actorsField1[$i]
$actorsField2[$i]";
}

Or however you want it to be formatted.  The end result is that you have 
a single SQL query.

Have fun...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/



Re: [PHP] mailform loop

2001-06-20 Thread Christopher Ostmo

Wilbert Enserink pressed the little lettered thingies in this order...

> Hi all,
> 
> 
> does anybody know if it is possible to loop through all  the fields in a
> mailform. I want to perform the addslashes function  and htmlspecialchars
> function to each entered value so i can put it in my db.
> 
> Or should I make use of a standard good mailform script? and if so, does
> anyone know such a good script?
> 
> 
> wilbert
> 

http://open.appideas.com/phpMailForm/

If you need to use addslashes or htmlspecialchars, you'll need to add:
$val = addslashes($val);
$val = htmlspecialchars($val);

You may also need to perform these functions on $key, depending on 
your needs.

If you want to put the entire message into the DB, you can insert 
$Message at the end of the script or individual values can be inerted 
using the $key = $val pairs.

Have fun...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/



Re: [PHP] Parse PHP inside a variable

2001-06-21 Thread Christopher Ostmo

Claus Heiko Niesen pressed the little lettered thingies in this order...

> Hello
> 
> I'm having a variable that contains HTML with embedded PHP code.  When I
> echo it then the PHP code does not get executed.  Is there a way I can
> parse/print the content of my variable?
> 
>

Checkout eval()
http://www.php.net/manual/en/function.eval.php

The second user contributed note contains an example of how to do this.

Good luck...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] mcrypt_cbc()

2001-06-22 Thread Christopher Ostmo

Tyler Longren pressed the little lettered thingies in this order...

> Hello list,
> 
> Is there a special tirgger to enable the mcrypt_cbc() function when you
> ./configure PHP?  Or how do I get that function to work?  I get the error:
> call to undefined function.
> 
> Thanks,
> Tyler
> 

--with-mcrypt = [DIR]

You must have libmcrypt installed on your system (not the entire 
mcrypt program, just the libraries) prior to compiling PHP.

Get it here:
http://mcrypt.hellug.gr/

Good luck...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] Sessions vs Cookies?

2001-06-22 Thread Christopher Ostmo

Chris Anderson pressed the little lettered thingies in this order...

> I am about to write a new admin system for a website I do and it will have
> many different logins. I was wondering overall which most of you thought
> would be better for such a thing? Wants really a pro about sessions over
> cookies?
> 

PHP sessions actually are cookies in most cases, but will revert to 
sending an ID tag in the URL if the user has cookies disabled (the ID 
tag does not need to be programmed into the URL, the PHP engine 
inserts it automatically).

Use sessions. Period.

If you design your own cookie solution, it won't work for people who have 
disabled cookies.  If you design your own "ID tag in the URL" system, 
you will have A LOT of extra typing to get the ID tag in every URL. If you 
design one that works for both, you've wasted a lot of time.

If you use PHP's sessions, you let PHP do the work for you.

Check out:
http://www.php.net/manual/en/ref.session.php

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




RE: [PHP] Sessions vs Cookies?

2001-06-22 Thread Christopher Ostmo

Jason Murray pressed the little lettered thingies in this order...

> > I am about to write a new admin system for a website I do and 
> > it will have many different logins. I was wondering overall which 
> > most of you thought would be better for such a thing? Wants really 
> > a pro about sessions over cookies?
> 
> If it's for an admin section, then you may as well use cookies. If
> the client doesn't want to use cookies they can't use their admin
> interface. :) I doubt they would have privacy issues with themselves
> anyway.
> 
> If you're going to use cookies, hopefully you'll have a database 
> system available (you said you'd have lots of different logins).
> 
> So, create a session table:
> 
>  ID int
>  username text
>  password text (if required, maybe you won't need it again)
>  logintime int
>  expirytime int
>  magickey text
> 
> Generate a magic key as such:
> 
> $randomseed = intval(ereg_replace("[^0-9]", "",
> substr(Date("U").microtime(), 4, 10)));
>srand($randomseed);
>$newid = rand(1, 9);
> 
>$magickey = md5($newid.$REMOTE_ADDR.time());
> ?> 
> 

That's really a lot of coding to do when you consider that PHP does this 
(or something very similar) for you when it initializes your user session.

It really would be foolish to attempt to create new session tracking code 
if you use PHP4.

Allow PHP to initialize the session, assign the variable, attempt to set 
the cookie and place the session ID onto the URL tag if it can't read the 
cookie.  All that you have to do as the programmer is insert the session 
ID (which PHP has generated) into a database and possibly match it up 
with a valid login in that database entry.

Doing the session coding yourself is a waste of time. You're not likely to 
find a more reliable session tracking solution than what's built into 
PHP4 as long as HTTP connections remain stateless.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] Safe_mode in certain directories

2001-06-22 Thread Christopher Ostmo

Egan pressed the little lettered thingies in this order...

> On Thu, 21 Jun 2001 14:35:50 -0700 (PDT), Rasmus Lerdorf
> <[EMAIL PROTECTED]> wrote:
> 
> >If you are using Apache you can set any PHP directive in 
> >or  block by doing something like:
> >
> >  php_admin_flag safe_mode On
> 
> Do those directives work in .htaccess files too?
> 

According to:
http://www.php.net/manual/en/configuration.php

""Admin" configuration settings can only be set from within the main 
Apache configuration files, and not from .htaccess files."


Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] PHP authenticating and session management

2001-06-22 Thread Christopher Ostmo

Bass??? pressed the little lettered thingies in this order...

> I have a Q.
> will the Session ID be stolen by hacker when the ID tranfer bewteen client
> and server ? Then can the hacker send the ID to server and veiw the user's
> page ?
> 

Yes.  That *can* happen to any non-encrypted transmission that 
passes over an untrusted network.  It would be difficult to do, so it's 
unlikely, but it *can* happen. It would require a packet sniffer on your 
network, on the target network or somewhere between.

If you want to prevent this, you should match session ID with requesting 
IP addresss, log both into a database and check both for each page 
request.

If the data being accessed is *that* important that a hacker would go 
through that much trouble to hijack a session, you probably should 
consider using SSL.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] variables / reading files

2001-06-23 Thread Christopher Ostmo

Michael Hall pressed the little lettered thingies in this order...

> 
> I'm stuck on a piece of code for a shopping cart.
> 
> I'm on the final page where the buyer clicks BUY and several things
> happen. I want to loop through the table that stores the session info and
> extract details such as item, price, quantity, subtotal and assign all this
> info to one variable:
> 
> $var = the output of a while($row = mysql_fetch_array($query)) statement
> 
> Why I'm trying to do this is I'd like to store all the purchase details in
> one variable for inclusion in an email:
> 
> $message = $var;   // (from above)
> mail($address,$subject,$message);
> 
> I'd also like to put the info in that same variable into a table that
> records actual sales data:
> 
> $details = $var;
> insert into table ('details') values ('$details');
> 
> I know there must be a (probably very easy) way, but just can't crack it.
> 

$result = mysql("DBName","QUERY");
while ($row = mysql_fetch_row($result)) {
$var = $row[0];

$message .= $var;
}
$details = $message

The period and equal sign cause $message to prepend itself to $var.  
This is the same thing as writing:
$message = $message."$var";

In either case, $message is preserved and added to on each loop. That 
being the case, if you are puting this into an e-mail message, you 
probably want to add line breaks after each line:
$message .= $var."\n";

Check out string operators:
http://www.php.net/manual/en/language.operators.string.php
and assignement operators:
http://www.php.net/manual/en/language.operators.assignment.php

Good luck...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] Filtering out \ when a ' is user entered?

2001-06-28 Thread Christopher Ostmo

Marcus James Christian pressed the little lettered thingies in this order...

> Hello,
> 
> I'm pretty new to PHP but all I've seen of it so far I pretty much love!
> 
> I've built a web log but when the user enters their data and they use ' or
> "  (and you know they will)   php always shows it from the included web log
> as
> 
> \'  How can I filter out these backslashes so they don't appear on the
> final public viewable page?
> 

$var = stripslashes($var);
echo $var;
or
echo stripslashes($var);

http://www.php.net/manual/en/function.stripslashes.php

Have fun...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] How to get PHP to do a POST??

2001-06-28 Thread Christopher Ostmo

Patrick Calkins pressed the little lettered thingies in this order...

> Hello all!
> Here is an interesting problem that I can not solve, maybe one of you
> know?? Here is what I'm trying to do. I sell a lot of items on eBay, and
> lots of people ask me for a quote on shipping. We ship via UPS and I go to
> their site a lot to lookup rates. I decided to make my own web page that
> links into UPS' with most of the fields already pre-set, and all I want to
> do is give the user back a total for shipping. I need to manipulate what
> comes back from UPS first, so I can add to the shipping price to cover
> materials, etc, then give the final numbers back to the end user. This is
> where I have a problem. I was able to have my page act as a user-agent, and
> do the submit itself, however on UPS's site, their submit button is not a
> button, but rather an image. Since a button is easy to know what values are
> getting set (ie name="Submit" value="getinfo"), I did not know what vars
> the image-submit was setting, since there was no 'value' variable, only a
> 'name' variable. I tried it on my own server and found that php assigns the
> values 'name_x' and 'name_y' giving us the x&y values of where the user
> clicked, but UPS does not use PHP, so I don't know what their software sets
> the submit values to hence it does not work correctly. Their form just
> thinks something went wrong and displays the beginning again. If I just
> include their submit button on my form, then all works fine, except for the
> fact that I can't intercept the data comming back from UPS so that I can
> adjust the prices. Any idea on how to do this???
> 

You can (and should) sign up for a developer's account with UPS so 
that you can get access to their online tools.  With their documentation 
about their online tools and a basic knowledge of PHP's sockets (i.e. 
fsockopen()), you will be able to connect directly to the page on their 
web site that processes shipping costs and have a PHP socket bring 
the results back to your web browser.  This elimnates the need to 
simulate a button click.  I have done this, but I am not yet at liberty to 
release the code to the public domain.

It isn't difficult if you know how to use sockets.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] Stopping stolen / spoofed / linked sessions

2001-07-02 Thread Christopher Ostmo

Bill Rausch pressed the little lettered thingies in this order...

> Rasmus, et.al.,
> 
> OK, I'm still confused. What does SSL have to do with any of this?
> 

SSL makes it impossible (well, improbable anyway) to sniff the session 
ID from the network. Without SSL, anyone on the network between the 
origin (client) and the destination (server) can get the session ID in plain 
text by installing a packet sniffer on the network.

If you're relying on the URL to send session IDs, you'll never conquer 
the "person looking over the shoulder" problem (assuming that you 
believe that it's reasonable that someone can look over another's 
shoulder and write down a 20 character string without the first person 
noticing).

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] mySQL reset auto_increment

2001-07-02 Thread Christopher Ostmo

Jon Shoberg pressed the little lettered thingies in this order...

> 
> Is there an SQL query for resetting the autoincrement field of a table ?  I
> know myisamchk will do this but the system I am on will not let me us it. 
> I can get console level access but that is all.  I simply want to reindex
> my data back to the start of 1.
> 

Drop the column and re-add it. From the command line MySQL client 
tool:
ALTER TABLE table,
DROP increment_column,
ADD increment_column INT UNSIGNED AUTO_INCREMENT NOT 
NULL PRIMARY KEY;

If you have other tables referencing the auto_increment field in this 
table, you're really going to mess things up regardless of how you 
resequence these values. If no other tables interact with this one (or if 
you can easily and manually recreate the interactivity), you shouldn't 
have any problems.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.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] Deleting a string from a text file

2001-07-03 Thread Stevenson, Christopher

Hello, folks. I'm relatively new to this.

Would anyone be willing to give me some code that will delete the first
occurrence of a string from a text file?

Thanks,
Chris.

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

2001-07-04 Thread Christopher Ostmo

Adrian Ciutureanu pressed the little lettered thingies in this order...

> Here is something that happend to me: I forgot to tell Apache that .inc
> files must be parsed by PHP. All works fine if you include a .inc file, but
> if somebody guess .inc file name, he can see the content of that file!
> 

If this is a concern, either name your include files with a valid PHP 
extension (i.e. ".php") or add the following line to an .htaccess file:
AddType application/x-httpd-php .inc
This will make the web server treat your .inc files as though they were 
PHP files and the source would be parsed rather than shown when 
accessed through a web browser.

> > -Original Message-
> > From: David A Dickson [mailto:[EMAIL PROTECTED]]
> > Sent: 4 iulie 2001 16:43
> > To: php-general
> > Subject: [PHP] Security of PHP code
> > 
> > 
> > Is it possible for others to view the php code for pages I 
> > have written? I thought I heard someone say before that they 
> > could write a simple script to accomplish this. If anyone 
> > knows of any tacticts people might use to attack my code 
> > please post them hee.
> > 
> > : David A. Dickson
> > : [EMAIL PROTECTED]

Anyone who has access to the server on which your server is hosted 
can view the source of your site by using the show_source() or 
highlight_file() functions unless your hosting provider disables those 
commands.

It doesn't really take a "simple script," just a simple function:


To make matters worse, most hosting providers fail to chroot jail logins 
(a chroot jailed login cannot traverse the directory structure UP from its 
own home directory). This common, but poor policy allows anyone with 
access to the same server as yours to view your files through the shell 
or even download them by FTP.  They may not overwrite your files, but 
they CAN view them.

There are two solutions if this is an important issue to you:
1) Get a dedicated server.  This is kind of spendy, but accomplishes the 
goal.
2) Only do business with providers that will (even if you have to request 
it) disable these commands AND chroot jail all logins.

Have fun...

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] Security of PHP code

2001-07-04 Thread Christopher Ostmo

Delbono pressed the little lettered thingies in this order...

> 
> maybe one could be
> 
>  $allowed_path  = "/www/sites/mysite/teaching";
> 
> if (substr($file, 0, str_len($allowed_path)) <> $allowed_path )
> {
> die("not allowed!");
> }
> else
> {
> show_source($file);
> }
> ?>
> 

The only foolproof method for restricting access is to strip forward 
slashes.  In the above example, I can change the file to:
/www/sites/mysite/teaching/../../../../etc/passwd
And it will be allowed
If you were to do this, however:
$allowed_path = "/www/sites/mysite/teaching";
$file = ereg_replace("/","",$file);
show_source($allowed_path."/".$file);
That would block any attempt to trick the server into going into another 
directory.

You would have to create separate show_source() calls or separate 
scripts for each directory that you wish to allow, but nobody will ever get 
your /etc/passwd file.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




Re: [PHP] RE: Protecting from session hijacking

2001-07-04 Thread Christopher Ostmo

Ian Bagley pressed the little lettered thingies in this order...

> One thing which would prevent hijacks from simply guessing SIDS would be to
> add an md5 hash to the end of a url 
> 
> e.g.
> 
> If a page was:- doit.php?item=4&SID=237478
> 
> then append the url with the md5 of the url PLUS a secret key generated at
> the begining of each session:- i.e. add
> MD5("doit.php?item=4&SID=237478"."R4WED4TTE3") results in the new url
> like
> 
> doit.php?item=4&SID=237478&EXTRA=GTW4YGSE52FD234WERW634DG5WE653WEF
> 
> ...then the browsed to page could easily verify if ANY details of the query
> string have been changed! This also pretects other info being changed such
> at in this example 'item'.
> 
> If a user changed the SID to anything else, even a perfectly valid active
> session it would result in the EXTRA key no longer being valid! and as they
> don't have access to the secret key they wouldn't be able to generate a new
> one! :) 
> 
> Obviously if someone copied the entire url including the extra bit then
> they would have access! but this solution does have the added benefit of
> preventing the valid owner of a valid session from changing other bits of
> the query string!
> 
> Ian

This thread isn't about "guessing" a session ID, it's about "stealing" a 
session ID.  The same asnwer applies to your response as to the 
original question.

There was a thread about this just a few days ago, but the answer for 
*most* applications is an astounding, "NO."  Unless you are running the 
entire transaction through SSL, any packet sniffer on the network can 
view, steal and use ANYTHING you send over the netowrk (including the 
value of a session ID that is being sent as a cookie value, the username 
and password for a telnet session, the username and password for an 
FTP session, etc). Packet sniffers are incredibly easy to find, get and 
use (even for "script kiddies"). If your session data is *that* vital, you 
should consider using SSL.

This is likely to be true as long as HTTP transmissions are stateless.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Meeting cutting edge dynamic
web site needs

For a good time,
http://www.AppIdeas.com/

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




RE: [PHP] Security of PHP code

2001-07-05 Thread Christopher Ostmo

Adrian Ciutureanu pressed the little lettered thingies in this order...

> $allowed_path = '/www/sites/mysite/teaching';
> $file = realpath($file);
> if(ereg("^$allowed_path", $file)) {
>  // it's OK
> } else {
>  // possible attack!
> }
> 

This is not good code.

A user could replace the $file in the URL with this:
/www/sites/mysite/teaching/../../../../etc/passwd
Since it starts with $allowed_path, your code has just been fooled.

The basic problem that I have seen with posts to this thread is the fact 
that many people do not understand how Unix servers address and/or 
secure files. If what I have written above doesn't make any sense, 
please go and pick up a book that covers Unix/Linux security. If you 
don't, you are inviting a security breach.  You may or may not be aware 
of this, but many hackers know Unix, it's security and it's common 
vulnerabilities VERY well and they WILL exploit your code if it is 
exploitable.

Simply checking to see if a particular path exists in the URL will 
NEVER secure this issue.

Here's the script that I use:









I explicitly declare the path and I delete all forward slashes. This means 
that if someone tries to send:
$f=calendar/../../../.../../../../etc/passwd
They instead send:
$f=calendar...etcpasswd
And the server interprets this as:
./calendar/calendar...etcpasswd

The bottom line is that no files outside of the intended directory will ever 
be viewable through this script, regardless of how clever, smart or 
devious the user might be.

I could have gotten a little more fancy and given warnings if there were 
forward slashes, but the point is this: If you are allowing real file names 
to be passed as the parameter, you HAVE to do one of two things:
1) Strip or otherwise block forward slashes and/or consecutive periods.
2) Declare the file path before the show_source() call and disallow 
consecutive periods (".."), forward slashes or both.  This is the method 
used at slashdot.

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

For a good time,
http://www.AppIdeas.com/

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




RE: [PHP] Security of PHP code

2001-07-05 Thread Christopher Ostmo

Adrian Ciutureanu pressed the little lettered thingies in this order...

> This is a good code. Read http://php.net/realpath
> 

You are correct. I was unaware of the addition of the realpath() function 
to PHP. According to the description of realpath(), using it should close 
this hole also.

> > -Original Message-
> > From: Christopher Ostmo [mailto:[EMAIL PROTECTED]]
> > Sent: 5 iulie 2001 19:57
> > To: Adrian Ciutureanu
> > Cc: [EMAIL PROTECTED]
> > Subject: RE: [PHP] Security of PHP code 
> > 
> > 
> > Adrian Ciutureanu pressed the little lettered thingies in 
> > this order...
> > 
> > > $allowed_path = '/www/sites/mysite/teaching';
> > > $file = realpath($file);
> > > if(ereg("^$allowed_path", $file)) {
> > >  // it's OK
> > > } else {
> > >  // possible attack!
> > > }
> > > 
> > 
> > This is not good code.
> > 
> > A user could replace the $file in the URL with this:
> > /www/sites/mysite/teaching/../../../../etc/passwd
> > Since it starts with $allowed_path, your code has just been fooled.
> > 
> > The basic problem that I have seen with posts to this thread 
> > is the fact 
> > that many people do not understand how Unix servers address and/or 
> > secure files. If what I have written above doesn't make any sense, 
> > please go and pick up a book that covers Unix/Linux security. If you
> > don't, you are inviting a security breach.  You may or may not be aware
> > of this, but many hackers know Unix, it's security and it's common
> > vulnerabilities VERY well and they WILL exploit your code if it is
> > exploitable.
> > 
> > Simply checking to see if a particular path exists in the URL will 
> > NEVER secure this issue.
> > 
> > Here's the script that I use:
> > 
> >  > require("common.php");
> > $f = ereg_replace("/","",$f);
> > commonHeader("$f Source Code");
> > ?>
> > 
> >  > commonFooter(); ?>
> > 
> > I explicitly declare the path and I delete all forward 
> > slashes. This means 
> > that if someone tries to send:
> > $f=calendar/../../../.../../../../etc/passwd
> > They instead send:
> > $f=calendar...etcpasswd
> > And the server interprets this as:
> > ./calendar/calendar...etcpasswd
> > 
> > The bottom line is that no files outside of the intended 
> > directory will ever 
> > be viewable through this script, regardless of how clever, smart or
> > devious the user might be.
> > 
> > I could have gotten a little more fancy and given warnings if 
> > there were 
> > forward slashes, but the point is this: If you are allowing 
> > real file names 
> > to be passed as the parameter, you HAVE to do one of two things:
> > 1) Strip or otherwise block forward slashes and/or 
> > consecutive periods.
> > 2) Declare the file path before the show_source() call and disallow
> > consecutive periods (".."), forward slashes or both.  This is the method
> > used at slashdot.
> > 

Christopher Ostmo
a.k.a. [EMAIL PROTECTED]
AppIdeas.com
Innovative Application Ideas
Meeting cutting edge dynamic
web site needs since the 
dawn of Internet time (1995)

Business Applications:
http://www.AppIdeas.com/

Open Source Applications:
http://open.AppIdeas.com/

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




Re: [PHP] Redirect

2001-07-06 Thread Christopher Allen

look in manual for HEADER and LOCATION
- Original Message -
From: "Vicor SpÄng Arthursson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 11:43 AM
Subject: [PHP] Redirect


> Hi!
>
> Still new on PHP, converting from vb$cript, I wonder how I do a
> redirect...
>
> In vbscript:
>
> <%
> response.redirect("page.extension")
> %>
>
> In PHP???
>
> Sincerely
>
> Victor
>
> --
> 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] hey, got a question....

2001-07-06 Thread Christopher Allen

what's the OS?


- Original Message -
From: "ReDucTor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 06, 2001 11:34 AM
Subject: [PHP] hey, got a question


i can't seem to access certain ports, through a nat program i have setup on
the computer here with the net, but i was thinking i could use something
like socks, because i want to setup some fsockopen() stuff...but i can't use
it on the ports i want, just frezzez...works over the lan fine, and over the
net on ports i can access...



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




  1   2   3   4   5   6   >