Re: [PHP] Form Name Attribute Help!

2001-11-10 Thread Chris Hobbs

It doesn't appear that the name attribute is passed (ref: 
http://www.blooberry.com/indexdot/html/tagpages/f/form.htm). Instead, 
try including the following in each of your forms:



Then you can check $formname in file.php for the value.

Hope this helps!

Kal Amry wrote:

> I have posted this question before so I'm giving another try in case new
> people are looking at the news list!!
> 
> If I have a form in  named formName1 such as:
> 
> 
> 
> How can I get the name "formName1" from within file.php
> 
> My original question was:
> 
> Hi guys, If I have a code in file1.php such as:
> 
> 
> code..
> code..
> 
> 
> And
> 
> 
> code..
> code..
> 
> 
> Now in file2.php, I need to check which form I am receiving!! How do I
> check!!
> 
> In other words, let's assume we only have the form names "formName1" and
> "formName1" - What code I can use in file2.php to get the name of the
> calling form. I just want to know how can I get the name of the form (in the
> above case, formName1 or formName2)
> 
> Thanx
> 
> 
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Eval()??? A variables contents?

2001-11-09 Thread Chris Hobbs

I just asked a similar question yesterday. The answer is, conveniently
enough, eval().

One trick from the php.net page on the function is to do somehting like
this:

$content = "";
echo eval ("?>$content");


Christopher Raymond wrote:
> 
> 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]

-- 
Chris Hobbs   Silver Valley Unified School District
Head geek:  Technology Services Coordinator
webmaster:   http://www.silvervalley.k12.ca.us/~chobbs/
postmaster:   [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] MORE INFO > Eval()??? A variables contents?

2001-11-09 Thread Chris Hobbs

OK, maybe I'm missing something, but why not just replace:

>   

with:

   

Assuming your Query_Database() function returns a string, this should
work fine.

Christopher Raymond wrote:
> 
> 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:
> 
>  
> function Make_TR ( $params ) {
> 
>   ( $params["class"] ) ? $class = "class=" . $params["class"] : $class = "";
>   ( $params["content"] ) ? $content = $params["content"] : $content = "";
> 
> ?>
> 
> 
>   >
> 
>   
>   
>   
> 
>   
> 
> 
>  
> }
> 
> ?>
> 
> 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]

-- 
Chris Hobbs   Silver Valley Unified School District
Head geek:  Technology Services Coordinator
webmaster:   http://www.silvervalley.k12.ca.us/~chobbs/
postmaster:   [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] rules for headers?

2001-11-10 Thread Chris Hobbs

Just for kicks, try this instead:

if (!isset($newimage))
{...

jtjohnston wrote:


> However it crashes if $newimage=1
> My image doesn't display.


>  
> if(!$newimage)
> {
> header("Content-type: text/html");
> echo "hi";
> echo "rendu: $rendu";
> }else{
> 
> header("Content-type: image/png");
> $image = imagecreate(500, 350);
> //etc...
> }
> ?>
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Apache User Groups?

2001-11-10 Thread Chris Hobbs

http://www.apache.org/foundation/mailinglists.html

Eric wrote:

> Does anyone know of a usergroup for Apache? I am having difficulties
> finding one and am having some troubles with Apache.
> 
> 
> Thanks
> Eric
> 
> 


-- 
___  ___    _    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] User Authentication

2001-11-13 Thread Chris Hobbs

http://www.google.com/search?q=php+mysql+user+authentication&btnG=Google+Search

First hit's a winner :)

Damien Burke wrote:

> Hi,
> 
> Can anyone recommend a good place on the web to learn about user
> authentication.
> I want users of my site to login with a username & password - once they are
> logged in they can see information customised to each separate user.
> Without being logged in the won't see any valuable information.
> Especially issues dealing with hackers.
> 
> Thanks,
> Damien
> 
> 
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Variable definitions...

2001-11-13 Thread Chris Hobbs

Hi Stephan,

IMHO, I think the answer requested is the only one that really makes 
sense - as soon as I read it, _my_ first thought went to scope.

If a variable changes values, the other value is no longer usable, and 
thus there aren't really two variables with the same name in that case. 
When comparing global to local scope, however, you can definitely have 
the same name in use in two places.

Of course, I wasn't a CS major, so someone else might be able to give 
you an answer that will help you justify yours - but prima facie, you 
got it wrong :(

Now, if you're talking about the compiler level, then no two variables 
(which are actually memory registers at this point, iirc) can share the 
same memory space with different values - this is just logically 
impossible. But the question is certainly referring to source code, and 
so scope is the only reasonable answer.

HTH!

Stephan wrote:

> Hello,
> 
> first of all I didn't exactely know where the right place is to ask this
> question.
> 
> Well, my problem is that I just had some exams and am very unhappy on
> how certain things were rated.
> 
> There's especially one question and I try to translate it as exact as
> possible:
> 
> When is it possible that two variables have the same name but display
> different variables?
> 
> The official solution was when in a script a global variable is declared
> and then in a local part this variable is destroyed and declared again
> with the same name (maybe even using different data type).
> 
> As for me, I'm of the opinion that this definition according to the
> question is too narrow minded. I think that a variable is already
> different if the the value within the variable is changed due to script
> OR if you appoint a new value to the variable OR if the variable is an
> array and some elements are accessed / elements are added / elements are
> removed.
> The reason why I think variables with different values can be considered
> as different variable according to the question asked in the exam is
> that when you declare a variable it also has a value even if this value
> is NULL.
> 
> Now I'd like very much to hear your opinion on this issue since for me
> very much depends on that (3 years of studying at college).
> 
> Stephan
> 
> P.S.: If you agree with me or not can you also send me an email to me?
> [EMAIL PROTECTED]
> 
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] url exist?

2001-11-15 Thread Chris Hobbs

Looks like you might be able to use the cURL extensions 
 - there's a function called 
curl_getinfo which returns an array which includes http_code - you could 
check the value of that to see whether the file was available (http_code 
== 200), not found (http_code == 404), or whatever 
().

Have fun!

jtjohnston wrote:

>Any way of finding out if this exists?
>
>http://www.somewhere.com/image.jpg
>
>if yes {} else {};
>
>



-- 
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] Very interesting and challenging question

2001-11-28 Thread Chris Hobbs

A fellow wannabe Winston Cup driver :)
 
I'm thinking about setting a switch on $mode, which will change what it 
does based on the value of $mode. Something like this:

$mode = 1; // 1 for stripping text, 2 for adding driver results, 3 for 
adding race results
$file = file('/path/to/filename');
foreach ($file as $line) {
switch ($mode)  {
case 1: if (preg_match("/^ *[0-9][0-9]*  */", $line)) {
   $mode = 2;
   // split line up with explode() and enter it into db  
  }
break;
case 2: if (!preg_match("/^ *[0-9]* */", $line)) {
   $mode = 3;
} else {
// split line up with explode() and enter it into db
}
break;
case 3: if (preg_match("^[a-zA-Z#]*") { // avoid matching blank 
lines
// do whatever to put these into a INSERT query...
}
}
}

So in mode 1, it merely loops through lines until it finds one with zero 
or more spaces followed by one or more numbers followed by one or more 
spaces. When it hits one of those, it breaks that line apart and enters 
it into the db, then sets $mode to 2.

In mode 2, it continues to loop through looking for the same lines until 
it doesn't get a match, then sets mode 3.

Mode 3 looks for lines starting with text (skipping blank lines). It's 
left as an exercise for the reader to figure out how to get those values 
into the db :)

Hope this helps!

Chris Hobbs
#42 NNASCAR league :)


Dan McCullough wrote:

>I need to take a file, similar to this and strip it of everything but this, and write 
>it to a
>database.  Are there any thoughts on how to get the information out, all the files 
>are consistent.
>
>Race Final   Watkins Glen International
> 2.450 miles31 laps
>
>Fin Str  Driver Laps  Led   Pts Qual   Reason Out
>
>
>
> 1   2   18  Dynamike18   31   24   185  118.007  Running
> 2   7   68  jcordeiro310   170  116.078  Running
> 3   5   80  MattyJ140310   165  116.881  Running
> 4   1   28  RUDD#28  316   165  118.219  Running
> 5  13   57  1SpeedDemon  310   155   Running
> 6   9   84  legends3 311   155  115.131  Running
> 7   3   56  RobertFx3D   310   146  117.854  Running
> 8  12   55  24skids  310   142   98.644  Running
> 9   4   53  Mark_O_10310   138  117.323  Running
>10   8   91  JJinsane 310   134  116.061  Running
>11  108  beertipper   310   130  114.154  Running
>12  11   44  Wis>OutLaw   100   127  111.022  DNF
>13   6   51  BdgrOtlw  30   124  116.702  DNF
>
>
>
>
>
>Race time - 72:52.030
>
>Average speed - 62.538mph
>
>Margin of victory - 1.944sec
>
>Caution flags - 7
>
># of lead changes - 3
>
>Weather - Clear 70^ E 0mph
>
>
>thanks for any help
>
>
>=
>Dan McCullough
>---
>"Theres no such thing as a problem unless the servers are on fire!"
>h: 603.444.9808
>w: McCullough Family
>w: At Work
>
>__
>Do You Yahoo!?
>Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
>http://geocities.yahoo.com/ps/info1
>
> -- 
> 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]
>

-- 
   ___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
  \/\/\/ \/|_/
  http://www.silvervalley.k12.ca.us
  [EMAIL PROTECTED]




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




Re: [PHP] MySQL: copying entire columns

2001-11-30 Thread Chris Hobbs



Tom Churm wrote:

>$sql = "Insert into $table_name(Address, Phone, Name)
>values('$Address','$Phone','$Name')";
>
>if this is true, it'll save me a lot of useless time trying to reorder
>my tables.
>
That be it :)

-- 
   ___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
  \/\/\/ \/|_/
  http://www.silvervalley.k12.ca.us
  [EMAIL PROTECTED]




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




Re: [PHP] php's future

2001-09-02 Thread Chris Hobbs

nick wrote:

> Haha I tried its code and it only takes 1~2 secs to run it .
> 
> Wellgod damn lies


Intersting. I tried the following code (which gives much more detailed 
time info, check it out - stolen from Andrey Hristov on php-db), and my 
times, on our P2-266 webserver, are just above 9 seconds. That's at 
2000x2000 iterations, or 4M iterations.

Of course, I'm trying to figure out when I would have a script that 
really needed to go through 4M iterations, and thus (like most 
benchmarks) this probably has no real bearing on the (or at least my) 
real world.


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


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




Re: [PHP] php's future

2001-09-02 Thread Chris Hobbs

So, we can say that on scripts that accomplish absolutely nothing, jsp 
is faster than php - I can live with that :) Most of my scripts do 
accomplish something (intended or not!) ;)

Tim wrote:

> Actually, an optimizing Java compiler would have detected it was a "dead
> loop" (i.e. didn't actually do anything) and just skipped it, meaning it
> took four seconds just to load the JSP page and invoke the bean. :) :)
> 
> The only benchmarks that mean anything are your actual web applications
> running on your actual servers...anything else is only speculation.
> 
> - Tim
>   http://www.phptemplates.org
> 
> 
> On Sun, 2001-09-02 at 15:08, Mark Charette wrote:
> 
>>And, of course, the JSP was running 2 x 2 iterations, or 400,000,000
>>iterations, in a few seconds.
>>
>>Yeah, right.
>>
> 
> 
> 


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] probs with exec, pls pls help

2001-09-03 Thread Chris Hobbs

David Robley wrote:

> On Mon,  3 Sep 2001 17:00, taz wrote:
>>


> Probably the user that your webserver, and hence your php script, runs as 
> does not have permissions to execute mysqlimport.


Or, mysqlimport is not in the path - try using the complete path and see 
if that solves it.

-- 
___  ____  ____  _____
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] replacing a carriage return with an html break

2001-09-03 Thread Chris Hobbs

[EMAIL PROTECTED] wrote:

> I am filling out a form , and submitting it to the next page which just 
>prints what I submitted, but it doesnt print any returns, i used when i filled out 
>the previous 
> 
> I found on php.net there is a ereg_replace funtion and a trim function but I am 
>unsure if either one will work and im not sure how to use them.


Try: http://www.php.net/manual/en/function.nl2br.php


-- 
___  ___    _    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] 304 Not Modified

2001-09-05 Thread Chris Hobbs

Ouster wrote:

>header("304 Not Modified);
>

Looking at the docs (I know, silly, eh?), the correct form of this 
appears to be:

header ("HTTP/1.0 304 Not Modified");

In addition to the missing " as was already pointed out...

Chris Hobbs
Silver Valley Unified School District




-- 
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] threaded forum to display replies

2001-09-13 Thread Chris Hobbs

How about something like this:

\n";
if ($r) {
while ($row=mysql_fetch_array($r)) {
// output your message here - it'll appear 
// in a nested list structure with the existing 
// html code.
showmessage($row['ID']);
}
}
echo "";
}

showmessage($parent);
?>

hassan xaaji wrote:

> I cannot show all the replies in a threaded way. I
> tried a recursive method which takes the messageid and
> I do like
> $messageID = $p_id +1;
> showMessages($messageID);
> 
> This only works if the messageids are 1 2 3 4 5 6. but
> if two consecutive messages have messages ids like 13
> and 15 or 14 and 20 for example, this does not work.
> Please help me here.

-- 
Chris Hobbs   Silver Valley Unified School District
Head geek:  Technology Services Coordinator
webmaster:   http://www.silvervalley.k12.ca.us/~chobbs/
postmaster:   [EMAIL PROTECTED]

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




Re: [PHP] Re: Terms used in search engine.

2001-09-13 Thread Chris Hobbs

Eddie Shipman wrote (quoting Kunal Jhunjhunwala):

>>Two brothers torn apart by Chaos, while the fortress
>>endures, the great leader will succumb , The third
>>big war will begin when the big city is burning" -
>>- Nostradamus 1654
>>
> 
> This is not a true quote from Nostradamus. Actually he died many
> years ealier.


That's what makes this so amazing! How many people do you know that 
write accurate predictions almost 100 years after they've died! Huh?

> Better research it before using it as a sig...

You're expecting _far_ too much from most of the population on the 
Internet :)

-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] another easy cookie question

2001-09-14 Thread Chris Hobbs

George Pitcher wrote:


>  header("Location:index.php");
> setcookie("Cookievalue", "abcdefghijklmnopqrstuvwxyz0123456789",
> time()+3600);

A couple of things:

First, I believe Location: must have a space after it, as well as a 
fully qualified URL (ie. http://wherver.com/index.php).

Second, once you've sent the Location header to the browser, I would 
expect it to immediately request the new page, and therefore not get the 
cookie you send afterwards. Why not just set the cookie in index.php?

My $0.02...

-- 
        ___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Choices for root privilege

2001-09-15 Thread Chris Hobbs

Brad Hubbard wrote:

> I'm in the planning stages of a smallish app that will need to run some shell 
> commands that generally require root privileges to run (eg: route, ifconfig, 
> ifup). I know this is a security nightmare but I don't really have a choice, 
> I have to provide this functionality through a web based interface. What is 
> the accepted way of accomplishing this? I've considered assigning nobody to a 
> privileged group, sudo, changing exec permissions (last resort).
> 
> Opinions???


If you can live without realtime, one way of handling this is to have 
the httpd user write out a file with commands to be run, and a root cron 
job (set to run as frequently as every minute) watch for that file and 
act upon it when it exists. Obviously, there would be some lag, but it 
would be one way to handle the security side of this issue.

-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Compiling php like C

2001-09-15 Thread Chris Hobbs

Kunal Jhunjhunwala wrote:

>>Two brothers torn apart by Chaos, while the fortress
>>endures, the great leader will succumb , The third
>>big war will begin when the big city is burning" -
>>- Nostradamus 1654


Would you _please_ stop posting this nonsense/hoax?
http://www.snopes2.com/inboxer/hoaxes/predict.htm

-- 
___  ___    _    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] The Salty Marine's eMail eMuster Subscription

2001-09-19 Thread Chris Hobbs

[EMAIL PROTECTED] wrote:

> Thank you for subscribing to the Salty Marine's eMail eMuster newsletter, 


This can't be good... ;)


-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


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




Re: [PHP] Can someone explain this????

2001-09-21 Thread Chris Hobbs

Dallas K. wrote:

>  try this when u get a sec. 


You want to see something really weird? Try using 'MORON' instead of 
'NYC'. It doesn't actually mean anything, but at least you'll have a 
signature you can start using if you're going to keep posting this tripe...

My $0.02.


-- 
    ___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Problem recursively building array

2001-09-26 Thread Chris Hobbs

I'm attempting to build an array of filenames in a sub-directory with 
sub-directories. I'm using a modified version of code found on php.net - 
the function I wrote is here:

function getDirList ($dirName) {
 $dirList=array();
 $d = dir($dirName);
 while ($entry = $d->read()) {
 if ($entry != "." && $entry != "..") {
 if (is_dir($dirName."/".$entry)) {
 echo "Directory found: $entry\n";
 $dirList = $dirList + getDirList($dirName."/".$entry);
 } else {
 $temp = $dirName."/".$entry;
 $temp = str_replace("/var/www/html/boarddocs/", "", $temp);
 echo $temp."\n";
 $dirList[] = $temp;
 }
 }
 }
 return $dirList;
}

It's called with: $bplist = getDirList($bppath);
$bppath is correct.

The problem is that although my testing of the function shows all of the 
entries correctly (note the 'echo $temp' line), not all of these entries 
are ending up in the array - in fact, large chunks of some directories, 
and all of other directories, are missing.

Sample output is here: http://www.silvervalley.k12.ca.us/boarddocs/bpar.php

Complete code is here: http://www.silvervalley.k12.ca.us/boarddocs/bpar.phps

I'm gonna be real annoyed if I missed something stupid. I built as much 
debugging output into this as I thought I should, but your help will be 
appreciated.

-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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] Problem recursively building array

2001-09-26 Thread Chris Hobbs

Chris Hobbs wrote:

> $dirList = $dirList + getDirList($dirName."/".$entry);


OK, on a lark I changed the above to use array_merge, and the problem 
went away - that'll teach me to use a shortcut :)

-- 
___  ___    _    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [EMAIL PROTECTED]


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




Re: [PHP] Re: Submitting variables via /'s

2001-10-05 Thread Chris Hobbs

Joao Prado Maia wrote:

>>"Ashley M. Kirchner" <[EMAIL PROTECTED]> wrote in message
>>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>>>I want to move away from
>>>file.php?var1=1&var2=2&var3=3
>>>...and go to
>>>file.php/1/2/3
> 
> That is actually a good idea to build dynamic web sites and be still
> search engine friendly. You can take http://faqts.com as an example. Go
> over Google.com and search for 'faqts' and you will see that Google
> crawled the whole site structure because of how carefully the links were
> laid out.
> 
> The same thing wouldn't happen (in most cases I guess) with a site of the
> '?var=2&var2=4' method of doing links.


Exactly why I switched our site from '/index.php?page=1' to 
'index.php/1' - google and other search engines love following my links 
now :)

-- 
___  ____    _
Chris Hobbs   / \ \/ / |  | |/ ___\|  __ \
Head Geek| (___  \ \  / /| |  | | (___ | |  | |
WebMaster \___ \  \ \/ / | |  | |\___ \| |  | |
PostMaster) |  \  /  | |__| |) | |__| |
   \/\/\/ \/|_/
   http://www.silvervalley.k12.ca.us
   [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]