[PHP] Getting the domain from an url?

2001-05-12 Thread John Vanderbeck

Hey all,

I am quite horrible when it comes to regexps, but I have a string that
contains a complete url, like:
http://www.domain.com/this/is/it.html

And I need to strip everything but the domain so that I am left with:
www.domain.com

Can anyone help me out?

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues



-- 
PHP General Mailing List (http://www.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 URGENT

2001-05-08 Thread John Vanderbeck

Spam thats been going around lately.  Good old money laundering apparently.
Friends have reported seeing it as well.

It better stop hitting the list over and over again though or i'm gonna
scream :)

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Christian Dechery [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 08, 2001 9:53 PM
> To: SOLOMON BALOGUN; [EMAIL PROTECTED]
> Subject: Re: [PHP] VERY URGENT
>
>
> what in Gods name is that?
>
> At 02:51 9/5/2001 +0100, SOLOMON BALOGUN wrote:
> >VERY URGENT BUSINESS,
> >#20 LOUIS BOTHA CRESCENT,
> >SADTON.SOUTH AFRICA,
> >Tel:874-762-727947,
> >Fax:87-4762-727949.
> >
> >Dear sir,
> >
> >In order to transfer out (USD 126 M) One hundred and
> >twenty six million United States Dollars) from African
> >Development Bank. I have the courage to ask you to
> >look for a reliable and honest person who will be
> >capable for
> >this important business believing that you will never
> >let me down either now or in future.
> >
> >I am SOLOMON BALOGUN, the Chief auditor of African
> >Development Bank (ADB). There is an account opened in
> >this bank in 1980 and since 1990 nobody has operated
> >on this account again. after going through some old
> >files in the records I discovered that if I do not
> >remit this money out urgently it will be forfeited for
> >nothing. the owner of this account is Mr. Smith B.
> >Andreas, a foreigner, and a miner at kruger gold co.,
> >a geologist by profession and  he died since 1990. no
> >other person knows about this account or any thing
> >concerning it, the account has no other beneficiary
> >and my investigation proved to me as well that this
> >company does not know anything about this account and
> >the amount involved is (USD 126M) One hundred and
> >twenty six million United States Dollars million
> >dollars. I want to first transfer USDM twenty six
> >million United States Dollars from this money into a
> >safe foreigners account abroad before the rest, but I
> >don't know any foreigner, I am only contacting you as
> >a foreigner because this money can not be approved to
> >a local bank here, but can only be approved to any
> >foreign account because the money is in us dollars and
> >the former owner of the account is Mr. Smith B.
> >Andreas is  a foreigner too.  I know that this message
> >will come to you as a surprise as we  don't know our
> >selves before, we will sign agreement, but be sure
> >that it is real and a genuine business. I
> >only got your contact address my from my secretary who
> >operates computer,
> >with believe in god that you will never let me down in
> >this business you are the only person that I have
> >contacted in this business, so please reply urgently
> >so that I will inform you the next step to take
> >urgently. Send also your private telephone and fax
> >number including the full details of the account to be
> >used for the deposit.
> >
> >I want us to meet face to face or sign a binding
> >agreement to bind us together so that you can receive
> >this money into a foreign account or any account of
> >your choice where the fund will be safe. and I will
> >fly to your country for withdrawal and sharing and
> >other investments.
> >
> >I am contacting you because of the need to involve a
> >foreigner with foreign account and foreign
> >beneficiary. I need your full co-operation to make
> >this work fine. because the management is ready to
> >approve this payment to any foreigner who has correct
> >information of this account, which Iwill give to you
> >later immediately, if you are able and with capability
> >to handle such amount in strict confidence and trust
> >according to my instructions and advice for our mutual
> >benefit because this opportunity will never come again
> >in my life. I need truthful person in this business
> >because I don't want to make mistake I need your
> >strong assurance and trust.
> >
> >With my position now in the office I can transfer this
> >money to any foreigner's reliable account which you
> >can provide with assurance that this money will be
> >intact pending my physical arrival in your country for
> >sharing. I will destroy all documents of transaction
> >immediately we receive this money leaving no trace to
> >any place. you can also come to discuss with me face
> >to face after which I will

RE: [PHP] RE: Undelivered Mail Returned to Sender

2001-05-08 Thread John Vanderbeck

I have been getting this as well, and it is _really_ starting to annoy me.
Why is this not filtered out anyways? I am the owner and admin of the
GameDesign mailing list, and our software automaticly filters these things
from the general list.

Please fix this :(

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Jack Dempsey [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 08, 2001 2:22 PM
> To: PHP General List
> Subject: [PHP] RE: Undelivered Mail Returned to Sender
>
>
> every reply i send to the list gives this back...could someone take that
> address off the list?
> thanks
>
> jack
>
> -Original Message-
> From: Mail Delivery System [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 08, 2001 2:16 PM
> To: [EMAIL PROTECTED]
> Subject: Undelivered Mail Returned to Sender
>
>
> This is the Postfix program at host mail-in.namezero.com.
>
> I'm sorry to have to inform you that the message returned
> below could not be delivered to one or more destinations.
>
> For further assistance, please send mail to 
>
> If you do so, please include this problem report. You can
> delete your own text from the message returned below.
>
>   The Postfix program
>
> <[EMAIL PROTECTED]>: host
> inbound.namezero.com.criticalpath.net[209.228.14.51] said: 550 User
> unknown
>
>
> --
> PHP General Mailing List (http://www.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] session question

2001-05-08 Thread John Vanderbeck

Are you opening a session on each of the pages you want to use the
variables?

Calling session_register() I believe causes an implicit opening of the
session, but on the other pages you have to explicity open the session, or
you won't have access to those vars.

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Rodrigo Reis da Rocha [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 08, 2001 2:58 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] session question
>
>
> I have a question about session variables.
> In my page the session variables are not seen by the pages where
> tem are not declared.
> I´ve used "session_register($variable)" and so after at another
> page I´ve called "echo $variable;" and it generate a message that
> the variable does not exists.
> The session variables are not suposed to be seen at any time, at
> any page when the param globals is set on while session stands up?
>
>
> Tkx.
> R3.
>


-- 
PHP General Mailing List (http://www.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] mySQL access denied with correct account/pw?

2001-05-08 Thread John Vanderbeck

Working on getting mySQL setup on a new server.  I mainly do the PHP work
while another guy does the server work.  He has given me the account and
password for the mySQL server, and I have quadruple checked it with him.  We
both swear it is correct in the script.  However, mySQL reports an access
denied message whenever I try to connect.

Could something ELSE be causing this error?

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues



-- 
PHP General Mailing List (http://www.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 with PHP 4.0.5

2001-05-07 Thread John Vanderbeck

Try,

\n";
?>

Some systems are configured to not allow the shorthand "http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Alvaro Collado [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 8:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Problem with PHP 4.0.5
>
>
> I have installed PHP4.0.5 in a Red Hat Linux 6.0 with Apache.
> When I run the test no problem, all is OK, but when I run a html
> index file in Netscape ( LocalHost )
> whith a single code like this
>
> 
>
> nothing was display, nothing.
>
> When I change the code for an know error for example 
> Netscape prints the full text of the tag
> "" .
>
> Please help me.
>
> Thanks
>
>


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




RE: [PHP] PHPmyadmin

2001-05-07 Thread John Vanderbeck

I'm curious,

Where can I get a copy of PHPmyadmin?
Up till now, I have done all my database work strictly through php code and
sql statements, which as you can imagine is cumbersome.  Sounds like this
might be easier?  I'm starting up another project right now, and will have
to be creating a bunch of new databases, and tables.

Thanks!

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Ryan W. Zajicek [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 5:19 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [PHP] PHPmyadmin
>
>
> Theo,
>
> Make sure the database exists, then click on the database name on the left
> hand side of the screen.  Now on the right hand side of the
> screen it should
> say something like no tables exist and below that you'll see some form
> fields.  Look for the one that says "Run SQL query/queries on
> database" and
> you should see a "browse" button just below that.  Click the browse button
> and select the location of the sql file and click "go".  (Just a side note
> here, the file has to be on your local hard drive).
>
> Thank You
>
> Ryan W. Zajicek
> mailto:[EMAIL PROTECTED]
>
>
> -Original Message-
> From: Theo Richel [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 4:08 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHPmyadmin
>
>
>
>
> Can anyone please tell me how to load a structure and
> datadumpfile  (*.sql)
> into an empty database by means of PHPMyadmin? (I know there is a separate
> forum for this, but either this is a stupid question or there is no one
> there who knows an answer, it stays silent).
> I know how to do it through Telnet, but I have no Telnet access right now.
>
> Thanks in advance,
>
> Theo Richel
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




RE: [PHP] Variable question

2001-05-07 Thread John Vanderbeck

How about manually parsing the string out to give you chunks, that can then
be eval'd easy.

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: King, Justin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 4:18 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Variable question
>
>
> A simple eval($mysqldata) isn't going to do it though since the string
> is "Your username is $userdata["username"]"; it'll just spit a parse
> error.  I've already tried that
>
> -Justin
>
> -Original Message-
> From: "Jack Dempsey" <[EMAIL PROTECTED]>
> Sent: Monday, May 07, 2001 1:13 PM
> To: King, Justin; [EMAIL PROTECTED]
> Subject: RE: [PHP] Variable question
>
> ok, look into eval()
>
> -Original Message-
> From: King, Justin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 4:07 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Variable question
>
>
> Here let me flesh this out a bit more
>
> Consider the query "SELECT datafield FROM myTable WHERE id=1";
>
> This would return "My username is $userdata["username"]";
>
> I want to then output what the database returns, and have php evaluate
> my variables.
>
> -Justin
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] Variable question

2001-05-07 Thread John Vanderbeck

I'm not sure what you mean...

[code]
$query = "SELECT username FROM Users WHERE userid=1";
$result = mysql_query($query, $link);
$user_data = mysql_fetch_assoc($result);
echo "my user name is ".$user_data["username"];
[/code]

Is that _not_ what you mean?

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues
 

> -Original Message-
> From: King, Justin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 3:58 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Variable question
> 
> 
> I think you're misunderstanding my question.  I'm pulling
> $user_data["username"] from a databse so the string my user name is
> $user_data["username"]" is exactly as the database hands it to me.  I
> know how to simply concat information.
> 
> -Justin
> 
> -Original Message-
> From: "Jack Dempsey" <[EMAIL PROTECTED]> 
> Sent: Monday, May 07, 2001 12:55 PM
> To: King, Justin; [EMAIL PROTECTED]
> Subject: RE: [PHP] Variable question
> 
> you can do it a couple ways...
> 
> echo "my user name is " . $user_data["username"];
> 
> or
> 
> echo "my username is ${user_data["username"]}";
> 
> -Original Message-
> From: King, Justin [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 3:49 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Variable question
> 
> 
> How can I evaluate a variable in a string?  For example if I have a
> string defined as "my user name is $user_data["username"]", how do I
> echo that string and have php evaluate $user_data["username"].
>  
> Thanks in advance..
>  
> -Justin
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 

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




RE: [PHP] HTTP authentication : logout!!!

2001-05-07 Thread John Vanderbeck


I to have never been happy with the way PHP handles actual secure sessions.
GameDesign was written to entirely use session based access.  Both the main
user site, and the admin backend use it, and it works quite well.

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Robert Covell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 9:14 AM
> To: Martín Marqués; elias
> Cc: [EMAIL PROTECTED]
> Subject: RE: [PHP] HTTP authentication : logout!!!
>
>
> I must support this fashion of "login" and "logout".  I have
> never been able
> to find a way to clear the browser of the username and password.  Once I
> combined sessions with a date and timestamp in the realm, it worked like a
> charm.
>
> Sincerely,
>
> Robert T. Covell
> President / Owner
> Rolet Internet Services, LLC
> Web: www.rolet.com
> Email: [EMAIL PROTECTED]
> Phone: 816.210.7145
> Fax: 816.753.1952
>
> -Original Message-
> From: Martín Marqués [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 2:13 AM
> To: elias
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] HTTP authentication : logout!!!
>
>
> On Mar 08 May 2001 02:07, you wrote:
> > Never tried it though...but can you try to empty or unset the
> > $PHP_AUTH_USER/PWD ?
>
> This doesn't work, thats why I use a login html page and sessions. :-)
>
> Saludos... :-)
>
> --
> El mejor sistema operativo es aquel que te da de comer.
> Cuida tu dieta.
> -
> Martin Marques  |[EMAIL PROTECTED]
> Programador, Administrador  |   Centro de Telematica
>Universidad Nacional
> del Litoral
> -
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




RE: [PHP] Passing variables to another page - newbie

2001-05-06 Thread John Vanderbeck

Your location header should be a fully qualified URL, just like you had
typed it into your browser.

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Dean Martin [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 06, 2001 1:50 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Passing variables to another page - newbie
>
>
> I have an order form that is validating input, mailing me the
> results of the
> form, then I want to pass the user off to either Paypal or Revecom
> (depending on their choice) for processing.
>
> Everything works except trying to pass the variables to the payment
> processor.  I thought that
>
> header("location://url?var1=value1?var2=value2") would work but not luck.
>
> Could someone point me in the right direction please?
>
> Thanks,
> Dean Martin
>
>
> --
> PHP General Mailing List (http://www.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] best ide for windows

2001-05-06 Thread John Vanderbeck

But isn't VIM a *nix only tool?

The thread was about Windows IDE's. I'm always open to new editors though,
so if VIM is available for Windows, can you give an URL?

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Andrzej Swedrzynski [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 06, 2001 1:12 PM
> To: [EMAIL PROTECTED]
> Cc: Bjorn Sodergren
> Subject: RE: [PHP] best ide for windows
>
>
> On Sun, 6 May 2001, Bjorn Sodergren wrote:
>
> [UltraEdit]
> > > And  sends plain password over the network. Thanks.
>
> > And how does this differ from any other ftp client ?
>
> Does  not differ. But I use ssh/scp for everything and with vim I
> can  send  my file to its destination with a single keystroke. In
> UltraEdit I would have to  open  ssh  client  and  send  file  by
> hand...
>
> [snip]
> > Homesite is not near as complex in learning as vim,
>
> IMHO  vim  is  worth learning and it's not as hard to learn as it
> seems to be. And once you've learnt it you won't  use  any  other
> editor anymore ;-).
>
> Regards,
>
>   Andrzej
>
> --
> http://kokosz.horyzont.net
> http://www.earthdawn.pl
>
>
> --
> PHP General Mailing List (http://www.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] searching a MySQL database

2001-05-06 Thread John Vanderbeck

Well, my site currently does not search based on multiple keywords, but
rather just ONE keyword.  This makes it easiers, as I offload all the work
to mySQL.

However, theoreticly, you could do the same things with a complex SQL query.

[CODE]
case 'searchform':
{
  echo "Search for Article\n";
  echo "\n";
  echo "\n";
  echo "Keyword: \n";
  echo "";
  echo "\n";
  break;
}
case 'search':
{
  $link = db_connect();
  $query = "SELECT article_id,article_title,article_local,article_url FROM
Articles WHERE article_keywords LIKE'%$searchkeyword%'";
  $result = mysql_query($query, $link);
  echo "SQL Result:";
  echo mysql_error($link);
  echo "\n";
  echo "Your search results:\n";
  $numRows = mysql_num_rows($result);
  echo "Your keyword matched $numRows articles.\n";
  while ($row = mysql_fetch_assoc($result))
  {
if ($row["article_local"] == 0)
{
// build link
$title = "".$row["article_title"]."";
}
else
{
// build link
$title = "http://gamedesign.incagold.com/displayarticle.php?mode=article&id=".$
row ["article_id"]."\">".$row["article_title"]."";
}
echo $title."\n";
  }
  break;
}
[/CODE]

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: bill [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 06, 2001 11:10 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] searching a MySQL database
>
>
> On Sun, 6 May 2001, Jamie Saunders wrote:
>
> > Hi,
> >
> > I've set up a MySQL database and an HTML search form.  I'd like
> to know how
> > to search the database with whatever it entered into the form.  It only
> > needs to be a simple search, returning anything that matches the word(s)
> > entered into the input box in the form.  Thanks.
>
> Yes, I would like to know how people are doing this too. I have a database
> where columns in multiple tables are searched for multiple keywords. The
> statement ends up lookup like this for the entered keyword: 'this or that'
> (the REGEXP prevents partial word matches, like 'hunk' in 'chunky') if you
> want the source for this part, email me privately...
>
> SELECT dates.date, dates.time, dates.city, dates.location, dates.contact,
> dates.phone, dates.eventid, dates.id ,events.title, events.descrip,
> events.speaker, events.attr, events.id
>
> FROM dates, events
>
> WHERE dates.eventid = events.id
>   AND (
> (
>   ( dates.city REGEXP '[[:<:]]this[[:>:]]' )
>OR (dates.location REGEXP '[[:<:]]this[[:>:]]' )
>OR (events.title REGEXP '[[:<:]]this[[:>:]]' )
>OR (events.descrip REGEXP '[[:<:]]this[[:>:]]' )
>OR (events.speaker REGEXP '[[:<:]]this[[:>:]]' )
>OR (events.attr REGEXP '[[:<:]]this[[:>:]]' )
> )
>  OR (*note) (
>   ( dates.city REGEXP '[[:<:]]that[[:>:]]' )
>OR (dates.location REGEXP '[[:<:]]that[[:>:]]' )
>OR (events.title REGEXP '[[:<:]]that[[:>:]]' )
>OR (events.descrip REGEXP '[[:<:]]that[[:>:]]' )
>OR (events.speaker REGEXP '[[:<:]]that[[:>:]]' )
>OR (events.attr REGEXP '[[:<:]]that[[:>:]]' )
> )
>  )
> AND date LIKE '2001-05%'
> ORDER BY date
>
> (*note): this would have been AND if the keyword was 'this and that'
>
> is this how it is generally done or am I way off here? :)
>
> cheers,
> bill
>
>
> --
> PHP General Mailing List (http://www.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] best ide for windows

2001-05-06 Thread John Vanderbeck

I am a fan of UltraEdit.  It has syntax highlighting and is a good all
purpose powerful editor.  What I really like though is the ability to Open
>From and Save To FTP sites.  This speeds up my work considerably.


- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues


> -Original Message-
> From: Geir Eivind Mork [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 06, 2001 9:39 AM
> To: Alexander Bierbrauer; [EMAIL PROTECTED]
> Subject: Re: [PHP] best ide for windows
>
>
> On Sunday 06 May 2001 14:57, Alexander Bierbrauer wrote:
> >  does anyone know a good PHP developer IDE for Windows?? I'm using PHP
> > Coder but it's a little bit to buggy.
>
> slickedit is what I preffer to use, you got syntax highlighting,
> api help,
> function tagging so that you get info about your own functions,
> autocomplete
> on variable and functionnames, configurable to the limits and
> support almost
> any other major and minor language beside php. a bit pricy but still.
> --
>  php developer / CoreTrek AS| Above all things, reverence
> yourself.
>  Sandnes / Rogaland / Norway|
>  web: http://www.moijk.net/ |
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.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] Install problems with PHP and GD

2001-05-06 Thread John Vanderbeck

Hello all,

Normally I have a sysadmin that takes care of all these things, but recently
I joined onto another project and we are all clueless :)

We need to install the GD extras, mainly JPEG and PNG for creating images
with PHP.  We are using the latest PHP and RedHat Linux.  We understand that
you need to compile in the GD options, but are unclear on what the path's
are that it asks for.

Would anyone has the kindness to write up a quick Installation of PHP-GD for
Dummies? :)

Thanks a million!

- John Vanderbeck
- Admin, GameDesign (http://gamedesign.incagold.com/)
- GameDesign, the industry source for game design and development issues



-- 
PHP General Mailing List (http://www.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] RegExp help..

2001-03-11 Thread John Vanderbeck


I really wish I could figure these darn things out :)  I have a task I need
to do, and i'm certain I could do this easily with a regexp..

I have a file name in the format MMDDYY-*.txt...I need to parse it to
determine if the month and year matches a specified month and year.  Day is
irrelevant

Can any of your regexp wizards help me?

Thanks!

- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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 problem - stumped

2001-03-10 Thread John Vanderbeck

Grr..

Thank You!  God I feel like the idiot now.  Why didn't I see that? Heck why
didn't anyone else see it either :)  I'm so used to using $rows =
mysql_num_rows($result), that I just did the same thing here.  But your
right, the docs say THIS one takes a LINK and not a RESULT identifier. Grr..

Thanks again.  Your a deadline saver :)

- John Vanderbeck
- Admin, GameDesign

> -Original Message-
> From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 10, 2001 2:32 PM
> To: PHP User Group
> Subject: Re: [PHP] MySQL problem - stumped
>
>
> On Saturday 10 March 2001 19:58, you wrote:
> > The following code is giving an me problems, I can't figure it out to
> > save my soul.  The last line gives:
> >
> > Here is the code:
> >
> > $link = db_connect();
> > $query = "UPDATE Users SET firstname='$firstname', lastname='$lastname'
> > WHERE username='$user' && password='$password'";
> > $result = mysql_query($query, $link);
> > $err = mysql_error();
> > echo "Errors:".$err;
> > $rows = mysql_affected_rows($result);
> >
> > And here is the output:
> > Errors:
> > Warning: Supplied argument is not a valid MySQL-Link resource in
> > //*//**..***/db.php on line 147
> >
> > Line 147, is the last line in the above snippet.  I cleared out the
> > path name for security, no offense intended :)
>
> This one?
> > $rows = mysql_affected_rows($result);
>
> Try
> $rows = mysql_affected_rows($link);
>
> --
> Christian Reiniger
> LGDC Webmaster (http://sunsite.dk/lgdc/)
>
> The use of COBOL cripples the mind; its teaching should, therefore,
> be regarded as a criminal offence.
>
> - Edsger W. Dijkstra
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




RE: [PHP] MySQL problem - stumped

2001-03-10 Thread John Vanderbeck


I do'nt connect multiple times..its one large script that handles different
tasks based on the settings of control vars.  I just like to keep it all
together.  The $link has to be valid, or it would be erroring out on the
mysql_query() call.  Which it is not, and it reports no errors with that
call.

- John Vanderbeck
- Admin, GameDesign

> -Original Message-
> From: Julian Wood [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 10, 2001 2:28 PM
> To: John Vanderbeck; PHP User Group
> Subject: Re: [PHP] MySQL problem - stumped
>
>
>
> Well, PHP seems to think that $link is not working, so your
> db_connect() is
> in fact, the problem. You say you use db_connect several times in this
> script without problem - why do you keep connecting to the same database
> repeatedly in the same script - one connection will do for all
> your queries.
>
> HTH,
>
> Julian
>
> on 3/10/01 12:11 PM, John Vanderbeck at [EMAIL PROTECTED] wrote:
>
> >
> >
> > Ok,
> >
> > Well I got 3 replies saying that my use of && is incorrect, and that I
> > should use AND.  This confused me for 2 reasons. First, is that
> I use && in
> > all my other SELECT queries, with no problems.  In fact, the MySQL docs,
> > show the use of &&, not AND. Secondly, because if I had a bad query, it
> > should have given me some sort of error when I output mysql_error(). No?
> >
> > However, I did of course try changing it to AND instead of &&.  But the
> > problem remains.  Same error.
> > Any other ideas?
> >
> > - John Vanderbeck
> > - Admin, GameDesign
> >
> >> -Original Message-
> >> From: Rick St Jean [mailto:[EMAIL PROTECTED]]
> >> Sent: Saturday, March 10, 2001 2:09 PM
> >> To: PHP User Group
> >> Subject: Re: [PHP] MySQL problem - stumped
> >>
> >>
> >> At 01:58 PM 3/10/01 -0500, John Vanderbeck wrote:
> >>
> >>
> >> You are using && in your statement ... should be "AND"
> >>
> >> .
> >>
> >>
> >>> The following code is giving an me problems, I can't figure it
> >> out to save
> >>> my soul.  The last line gives:
> >>>
> >>> Here is the code:
> >>>
> >>> $link = db_connect();
> >>> $query = "UPDATE Users SET firstname='$firstname',
> lastname='$lastname'
> >>> WHERE username='$user' && password='$password'";
> >>> $result = mysql_query($query, $link);
> >>> $err = mysql_error();
> >>> echo "Errors:".$err;
> >>> $rows = mysql_affected_rows($result);
> >>>
> >>> And here is the output:
> >>> Errors:
> >>> Warning: Supplied argument is not a valid MySQL-Link resource in
> >>> //*//**..***/db.php on line 147
> >>>
> >>> Line 147, is the last line in the above snippet.  I cleared
> out the path
> >>> name for security, no offense intended :)
> >>>
> >>> Now, I KNOW that the db_connect() function is not the problem,
> >> as I use it
> >>> in many other places in this script with no errors.  What am
> I missing?
> >>>
> >>> - John Vanderbeck
> >>> - Admin, GameDesign
> >>>
> >>>
>
> --
> Julian Wood
> Learning Technologies and Digital Media
> University of Calgary
>
>


-- 
PHP General Mailing List (http://www.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 problem - stumped

2001-03-10 Thread John Vanderbeck


Ok,

Well I got 3 replies saying that my use of && is incorrect, and that I
should use AND.  This confused me for 2 reasons. First, is that I use && in
all my other SELECT queries, with no problems.  In fact, the MySQL docs,
show the use of &&, not AND. Secondly, because if I had a bad query, it
should have given me some sort of error when I output mysql_error(). No?

However, I did of course try changing it to AND instead of &&.  But the
problem remains.  Same error.
Any other ideas?

- John Vanderbeck
- Admin, GameDesign

> -Original Message-
> From: Rick St Jean [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, March 10, 2001 2:09 PM
> To: PHP User Group
> Subject: Re: [PHP] MySQL problem - stumped
>
>
> At 01:58 PM 3/10/01 -0500, John Vanderbeck wrote:
>
>
> You are using && in your statement ... should be "AND"
>
> .
>
>
> >The following code is giving an me problems, I can't figure it
> out to save
> >my soul.  The last line gives:
> >
> >Here is the code:
> >
> >$link = db_connect();
> >$query = "UPDATE Users SET firstname='$firstname', lastname='$lastname'
> >WHERE username='$user' && password='$password'";
> >$result = mysql_query($query, $link);
> >$err = mysql_error();
> >echo "Errors:".$err;
> >$rows = mysql_affected_rows($result);
> >
> >And here is the output:
> >Errors:
> >Warning: Supplied argument is not a valid MySQL-Link resource in
> >//*//**..***/db.php on line 147
> >
> >Line 147, is the last line in the above snippet.  I cleared out the path
> >name for security, no offense intended :)
> >
> >Now, I KNOW that the db_connect() function is not the problem,
> as I use it
> >in many other places in this script with no errors.  What am I missing?
> >
> >- John Vanderbeck
> >- Admin, GameDesign
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> ##
> #  Rick St Jean,
> #  [EMAIL PROTECTED]
> #  President of Design Shark,
> #  http://www.designshark.com/
> #  Quick Contact:  http://www.designshark.com/messaging.ihtml
> #  Tel: 905-684-2952
> ##
>
>
> --
> PHP General Mailing List (http://www.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] MySQL problem - stumped

2001-03-10 Thread John Vanderbeck


The following code is giving an me problems, I can't figure it out to save
my soul.  The last line gives:

Here is the code:

$link = db_connect();
$query = "UPDATE Users SET firstname='$firstname', lastname='$lastname'
WHERE username='$user' && password='$password'";
$result = mysql_query($query, $link);
$err = mysql_error();
echo "Errors:".$err;
$rows = mysql_affected_rows($result);

And here is the output:
Errors:
Warning: Supplied argument is not a valid MySQL-Link resource in
//*//**..***/db.php on line 147

Line 147, is the last line in the above snippet.  I cleared out the path
name for security, no offense intended :)

Now, I KNOW that the db_connect() function is not the problem, as I use it
in many other places in this script with no errors.  What am I missing?

- John Vanderbeck
- Admin, GameDesign


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




[PHP] PHP & mySQL primer?

2001-03-06 Thread John Vanderbeck

Hello all,

I'm lookign at having to do a user registration setup, and I would imagine
the best way to do that would be a databse.  The server has mySQL setup on
it, but I have no experience with it.

Can anyone point me to some good basic primers?  Soemthing that just creates
a db that holds user names and passwords?

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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] regex help

2001-02-23 Thread John Vanderbeck

Hello,

I need to take a string and remove everything from the first "<" character
to the end of the line.  I'm pretty sure I could do this with an
ereg_replace(), but I am horrible at regular expressions.  Could anyone help
me with this?

- John Vandebreck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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] processing form data

2001-02-20 Thread John Vanderbeck

Try changing your echo line to:

echo ("Welcome $HTTP_POST_VARS[username]!");

- John Vanderbeck
- Admin, GameDesign


> 
> 
> 
>  echo ("Welcome, " . $username . "!")
> ?>
> 
> 
> 
> Thanks in advance
> Denis
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.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] File upload problem on IIS/NT4

2001-02-19 Thread John Vanderbeck

ITry searching the drive(s) for the file.  I dont know what the deal is, but
I found on my system that the session path specified in the php.ini file
isn't being used, it is using /tmp instead.  Might be doing the same thing
for the upload path.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: Josh G <[EMAIL PROTECTED]>
To: PHP User Group <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 6:58 PM
Subject: [PHP] File upload problem on IIS/NT4


> Hi guys, I'm having a problem with file uploads, and I can't seem to
> fix it. I'm on IIS using php as an ISAPI module on NT4, and file uploads
> seem to work, but $userfile does not exist. Any ideas on how I can
> fix it?
>
> userfile:\\php8
> userfile_name:notes.txt
>
> Cheers,
>
> Gfunk -  http://www.gfunk007.com/
>
> I sense much beer in you. Beer leads to intoxication, intoxication to
> hangovers, and hangovers to... suffering.
>
>
>
>
> --
> PHP General Mailing List (http://www.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] Apache log analyzer

2001-02-18 Thread John Vanderbeck

Hello,

Does anyone know where I might find a good PHP script for analyzing apache
logs, with as much information as can be gathered?

I looked around on a few of the script sites, but didn't see any and I
thought this wierd.

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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

2001-02-17 Thread John Vanderbeck

from: http://www.php.net/manual/en/function.header.php
"Remember that the header() function must be called before any actual output
is sent, either by normal HTML tags blank lines in a file, or from PHP. It
is a very common error to read code with include(), or require(), functions,
or another file access function, and have spaces or empty lines that will
output before header() is called. The same problem exists when using a
single PHP/HTML file."

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Brandon Feldhahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 17, 2001 4:05 PM
Subject: [PHP] php


> im trying to make somthing that takes the user to the members page if
> the authentecation is right, but i keep getting this error:
>
> Warning: Cannot add header information - headers already sent by (output
> started at C:\www\login2.PHP:7) in C:\www\login2.PHP on line 30
>
> and this is my code:
>
> 
> 
>
> My Login Form
> 
>
>  require ('header.php');
> switch ($do) {
>
>  case "authenticate":
>
>  $connection = mysql_connect("localhost", "brandon", "**")
> or die ("Couldn't connect to server.");
>
>  $db = mysql_select_db("TNB", $connection)
>   or die ("Couldn't select database.");
>
>  $sql = "SELECT id
>   FROM members
>   WHERE username='$username' and password='$password'";
>
>   $result = mysql_query($sql)
>   or die("Couldn't execute query.");
>
>  $num = mysql_numrows($result);
>
>  if ($num == 1) {
>
>  header("Location:index.php");
>
>  }else if ($num == 0)  {
>
>   unset($do);
>   echo "You are not authorized! Please try
> again.";
>   include("login_form.irc");
>
>  }
>
>  break;
>
>  default:
>
>   include("login_form.irc");
>
> }
> require ('footer.php');
> ?>
>
> 
> 
>
> Line 30 is in bold.
> what should i do? PLEASE HELP
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] Strip HTML codes from a string?

2001-02-17 Thread John Vanderbeck

Ok, ignore me. I'm an idiot.. I just found the striptags() fucntion.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "John Vanderbeck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 17, 2001 12:33 PM
Subject: [PHP] Strip HTML codes from a string?


> I'm really crappy with regex's, and I can't find a good tutorial on using
> them , and all the syntaxes.  What I need to do is strip all HTML tags
from
> a string.
>
> This is from a form, where a user can submit comments on things, but I
need
> to strip the HTML out, in case anyone tries to abuse it :)
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
>
> --
> PHP General Mailing List (http://www.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] Strip HTML codes from a string?

2001-02-17 Thread John Vanderbeck

I'm really crappy with regex's, and I can't find a good tutorial on using
them , and all the syntaxes.  What I need to do is strip all HTML tags from
a string.

This is from a form, where a user can submit comments on things, but I need
to strip the HTML out, in case anyone tries to abuse it :)

- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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] Determingin if cookies are useable?

2001-02-17 Thread John Vanderbeck

Well, since cookies are set in the header, I would say you would have to at
least refresh the same page.  I'm just putting a cookie into my home page
for now. and it will be checked in just afew areas of the site that REQUIRE
the cookies to work right.

- John Vanderbeck
- Admin, GameDesign
- Original Message -
From: "Jeff Gannaway" <[EMAIL PROTECTED]>
To: "Chris Lee" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, February 17, 2001 6:29 AM
Subject: Re: [PHP] Determingin if cookies are useable?


> At 08:35 AM 2/17/01 -0800, Chris Lee wrote:
> >I test for cookies support in the same manner you mentioned, set it, see
if
> >its still there.
>
> Can this be done on one page?  Or does one page have to set it, then when
> the visitor goes to the next page, have that page check to see if it was
set?
>
> Thanks,
> Jeff
> ___
>
>  2001 Wall Calendars
>* Art, Jazz, Blues, Women's, African-American.
>* Everyday Discounts.
>* Excellent paper and reproductions.
>
>  And as always, a great selection of abstract,
>  contemporary and African-American art prints.
>
>  PopStreet.com is your avenue to art.
>  http://www.popstreet.com
> ___
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] checking image extensions

2001-02-17 Thread John Vanderbeck

> Hi, Newbie question here. I'm trying to write a function to check an image
> extension, part of the code is:
>
> if (substr($imgName, -4) != ".jpg")

if ((substr($imgName, -4) != ".jpg") || (substr($imgName, -4) != ".gif"))
{
 echo "I'm sorry, but the ikmage format you submitted is not
a supported format.";
}

- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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] Determingin if cookies are useable?

2001-02-17 Thread John Vanderbeck

I'm trying to find an enviroment variable, or something, that will let me
know if the client's browser has cookies enabled or not.  I'm doing this,
because I don't want to pass the SID in the URL if I don't have to, and the
PHP I am working with is not compiled with --trans-sid

I'm guessing I could do this in a roundabout way, by setting a cookie, then
trying to read it back.  However, I was wondering if there way a simpler
way?

- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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] Sessions again :(

2001-02-17 Thread John Vanderbeck

Sorry about all these questions. Just a quickie.  Does a session registered
variable take on global scope, or do I still need to do a "global
$my_session_var" to make my function see it?

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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 Editors

2001-02-16 Thread John Vanderbeck

I have Allaire and use it for web development, but i'm not happy with it.  I
like the APP itself, but its such a resource hog, crashes all the time, and
causes other problems.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Hoover, Josh" <[EMAIL PROTECTED]>
To: "'Julian Wood'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 16, 2001 11:51 AM
Subject: RE: [PHP] PHP Editors


> I think BBEdit can get that percentage because so many people doing web
> development use Macs.  Even though the overall marketshare for Macs is
> small, there is a high concentration in the web/graphics development
areas.
> Still, those numbers Allaire shows seem a bit out of whack to me too :)
>
> Josh Hoover
> KnowledgeStorm, Inc.
>
> Searching for a new IT solution for your company? Need to improve your
> product marketing?
> Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can
simplify
> the process for you.
> KnowledgeStorm - Your IT Search Starts Here
>
> > how does BBEdit garner 42.6% of the share when the Mac
> > has only a
> > 3-5% share of the worldwide computer market?
> >
> > J
>


-- 
PHP General Mailing List (http://www.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 make text BOLD

2001-02-16 Thread John Vanderbeck

All my output scripts use stylesheets, that way they can be easily
customized.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Brian V Bonini" <[EMAIL PROTECTED]>
To: "Nguyen, David M" <[EMAIL PROTECTED]>
Cc: "PHP Lists" <[EMAIL PROTECTED]>
Sent: Friday, February 16, 2001 11:23 AM
Subject: RE: [PHP] How to make text BOLD


> How about:
>
> 
> li.bold {font-weight: bold;}
> 
> 
> The following Webpage is added or updated:
> 
> DATE: 
> Equipment: 
> Topic: 
> URL: 
> 
> 
>
> or
>
> 
> The following Webpage is added or updated:
> 
> DATE: 
> Equipment: 
> Topic: 
> URL: 
> 
> 
>
> > -Original Message-
> > From: Nguyen, David M [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 16, 2001 10:55 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to make text BOLD
> >
> >
> > Below is my script and the output I got, I want DATE and EQUIPMENT TO BE
> > BOLD:
> >
> > $message = "The following Webpage is added or updated:\n\nDate:
> > $date\nEquipment: $equipment\nTopic: $topic\nURL: $url";
> > mail( $to, $subject, $message, $mail_header ) or print "Could not send
> > mail";
> >
> >
> > print ("\n");
> >
> > print ("\n");
> >
> > print ("$title\n");
> >
> > print ("\n");
> >
> > print (" > bgcolor=\"#FF\">\n");
> >
> >
> > SEE what I got from output:
> >
> > Date: Fri, February 2001 - 09:50:38
> > Equipment: General
> >
> >
> > Please advise how to fix it.
> >
> > Thanks,
> > David
> >
> > -Original Message-
> > From: Hoover, Josh [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 16, 2001 9:35 AM
> > To: Nguyen, David M; [EMAIL PROTECTED]
> > Subject: RE: [PHP] How to make text BOLD
> >
> >
> > Could you send an example of how you're using the bold/strong tags in
your
> > PHP code?  If we see it, we can probably help you out better :)
> >
> > Josh Hoover
> > KnowledgeStorm, Inc.
> >
> > Searching for a new IT solution for your company? Need to improve your
> > product marketing?
> > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we
> > can simplify
> > the process for you.
> > KnowledgeStorm - Your IT Search Starts Here
> >
> > > I want to make my text BOLD using either  or
> > >  but it
> > > did not work with PHP.  Can someone please advise why not or
> > > if there is
> > > another way to do it.
> > >
> > > Thanks,
> > > David
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] ereg_replace

2001-02-15 Thread John Vanderbeck

> why does this
>
>  $string = "this is my string.";
>
> print $string . "\n";
>
> $string = preg_replace(
> array( '/is/', '/string/'),
> array( 'is not', 'bit of text' ),
> $string
>   );
>
> print $string . "\n";
> ?>
>

This happens because you are replacing  "is" with "is not" so parse your
string by hand:

"this is my string"..ok the first occurence of "is", is in the word "this",
so do the replace..the replaced part in CAPS:
"thIS NOT" .. then the second "is":
thIS NOT IS NOT" etc..I think you can see why now..

- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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] parse error driving me nuts ...

2001-02-15 Thread John Vanderbeck

> Jon, John, Ifrim, the == worked ... thank you!!
> gotta read up on it now :)
>
> Cameron, dropping the extra () did not work :(
>
> thanks for the suggestions folks!
> andrew
>

Remember that '=' means assign what is on the right to what is on the left,
whereby '==' means is what is on the left equal to what is on the right.

C, and C based languages allow you to out an assignemtn statement even when
you intend a relational expression.  It is a very common pitfall.  I know I
have fallen into it in my C work many times :(

- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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] parse error driving me nuts ...

2001-02-15 Thread John Vanderbeck

> hi, can anyone help me spot the parse error?
> It's throwing up on the first "if" line, and for the life of me I cannot
> find it! :)
>
> tia,
> andrew
>
> 
> include("db_connect_params.inc");
> $sql="select path from PHOTO where pid =1";
> $link_id = mysql_connect($host, $usr, $pass);
> $result = mysql_db_query($database, $sql, $link_id) or die("no result");
>
> if ((mysql_num_rows($result)) = 1)

Well I don't know if it will give a parse error or not, but you  have made
the oh way too common C error in your IF statement.
> if ((mysql_num_rows($result)) = 1)
should be:
if ((mysql_num_rows($result)) == 1)

- John Vanderbeck
- Admin, GameDesign




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




[PHP] Session Questions...

2001-02-15 Thread John Vanderbeck

I was reading through the documentation on sessions at
http://www.php.net/manual/en/html/ref.session.html

I have a few questions..

1) How do I explicitly close a session, so that any subsequent attempts to
use pages would require a new session started? Will session_destroy() do
this?

2) I don't want to rely on cookies being set for the client's browser.  What
are the security ramifications for passing the SID through the URL?

Most important to me is to understand the overall concept.  Can I start and
stop sessions whever I want? Can I start and use one session, then destroy
it, then start a whole new session on the client?

I'm just starting to hate the looks of all these encoded urls being thrown
around as i'm developing the site.  It is getting more and more complex, and
some of the stuff i'm passing in the urls is ugly, and some of it is not
good to be showing.

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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] HTTP authentication

2001-02-15 Thread John Vanderbeck

I'm sure this wont' help, but just in case you may have missed the obvious
(it happens sometimes)..Make sure you PHP script has the extension .PHP
.. The server won't recognize it as a PHP file otherwise, and it won't know
what to do with it.  Also this extension has to be registred properly on the
server, but that is beyond me.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Thomas Edison Jr." <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 15, 2001 2:07 AM
Subject: [PHP] HTTP authentication


> I was browsing thru the http authentication method
> given thru the header() function in the manual. I
> tried it out but it's not giving me the pop-up window
> asking me the username and password and is only
> writing the text given in the code on the page.
> I'm using win98 and otherwise use sun solaris. Does
> this function work on these two OS?
> I have to write a code that checks each time a user
> enters a page, his previously entered user/pwd so as
> to prevent anyone from entering the page if he knows
> and writes the page's URL in the address bar. I've
> used the same authentication method in ASP before for
> the same. Can I use it in my OS using PHP?
> The code I'm entering is:
>
>  if(!isset($PHP_AUTH_USER)) {
> Header("WWW-Authenticate: Basic realm=\"My Realm\"");
> Header("HTTP/1.0 401 Unauthorized");
> echo "Text to send if user hits Cancel button\n";
> exit;
> } else {
> echo "Hello $PHP_AUTH_USER.";
> echo "You entered $PHP_AUTH_PW as your password.";
> }
> ?>
>
> Regards,
> T.Edison jr.
>
> =
> Rahul S. Johari (Director)
> **
> Abraxas Technologies Inc.
> Homepage : http://www.abraxastech.com
> Email : [EMAIL PROTECTED]
> Tel : 91-4546512/4522124
> ***
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




[PHP] Security...

2001-02-14 Thread John Vanderbeck

Can someone point me to an url where I can read up and learn about how to be
sure my back-end admin scripts will all be secure?  My site isn't even open
yet and I am already seeing access atempts to non-existant CGI scripts.  A
good friend of mine says it looks like the pattern hackers use to try and
gain access. And i'm not even open yet!  So I want to make SURE my PHP
back-end will be as secure as I can make it.

- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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] gettimeofday() question

2001-02-14 Thread John Vanderbeck

Hello,

I need to be able to create files with unique names.  One thought I had was
to use the date functions.  In windows API you can call a function that
returns the number of milliseconds since, I think its January 1, 1970.  That
number would pretty much be garunteed to be unuquie (although it could be
long, noone has to read these names).

if I use the PHP gettimeofday() function and get the "usec" value, would
this be the same thing? The manual is unclear about what the usecs is in
reference to.


- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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 Editors

2001-02-14 Thread John Vanderbeck

I still strongly recommend UltraEdit.  It is SO flexible its unbelievable.
It also allows you to load from and save to files on an FTP server which
saves me , god I can't even measure how much that saves me.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Michael McGlothlin" <[EMAIL PROTECTED]>
To: "Matt DeLong" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 12:53 PM
Subject: Re: [PHP] PHP Editors


> I write all my code in a normal plain-text editor, whatever is available
> on whatever OS I'm using - usually Linux. On MacOS I have a handy tool
> called BEdit (I think) that allows me to do a multiple-file search and
> replace. The only problem is it's a hassle to move a couple hundred
> makes of source files back and forth over the network so I'd rather do
> it on the server itself. Does anyone know of a good tool for doing such
> a search and replace? If it only works on individual files that is okay
> as I can always add the multiple-file abilties. I'd like it to be a
> freely available open source program if possible. I know I can do this
> sort of thing w/ Perl, and have, but Perl is a less than perfect tool in
> this case so I'd like something made for the purpose. Thanks.
>
> Matt DeLong wrote:
>
> > Also try:
> > http://www.textpad.com/
> >
> >
> >
> > Thanks,
> >
> > Matt DeLong
> > Studio 77
> >
> > eBusiness & Wireless Solutions Provider
> > 615.793.2947
> > www.studio77.com
> >
> >
> > - Original Message -
> > From: Brandon Orther <[EMAIL PROTECTED]>
> > To: PHP User Group <[EMAIL PROTECTED]>
> > Sent: Thursday, January 18, 2001 11:28 AM
> > Subject: RE: [PHP] PHP Editors
> >
> >
> >> I am not sure what OS you are running but for windows I use PHPED.
Check
> >
> > it
> >
> >> out at www.phped.com
> >>
> >> -Original Message-
> >> From: Karl J. Stubsjoen [mailto:[EMAIL PROTECTED]]
> >> Sent: Thursday, January 18, 2001 7:03 AM
> >> To: PHP Mailing List
> >> Subject: [PHP] PHP Editors
> >>
> >>
> >> So what editor is recommended?  I'm a little familiar with Emacs (kinda
> >> cool, but I'm use to keywords and such being colored - as in Interdev).
> >>
> >> Thanks!
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> >>
> >>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >> To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> >>
>
>
>
> --
> PHP General Mailing List (http://www.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] Is this "typecast" safe?

2001-02-14 Thread John Vanderbeck

I'm a little unsure of how variables are cast around in PHP, since it seems
like VisualBasic where I don't declare any types, the compiler just figures
it out.

Would something like this be safe?
$info = fread($file, filesize("blah");
$info = explode("\n", $info);

echo $info[0];



- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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: $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

Ok, I feel like the big idiot now.

I fixed the problem.  It was because of the whole global bit.  The ones that
were not working were inside a function, the ones that were working were
outside the function.  I guess I ASSUMED (yeah we know what happens when you
do that) that things like $PHP_SELF were always global.

Sorry to have bothered everyone :(

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "John Vanderbeck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 10:59 AM
Subject: [PHP] RE: $PHP_SELF in Netscape PART 2


> I converted everythign over to use '.' instead of  ',' but I still get the
> same exact results.  That is, $PHP_SELF is resolved to NULL, and every
other
> variable to the correct data.  Here is the new string:
>
> echo ''
> .$subcategories[$index]. '';
>
>
> I think i'm just going to give up on this and rewrite it, because it DOES
> work if I do the old double quotes bit.  Just means I need to re-arrange
it
> and do it in multiple ECHO statements, because I can't do the urlencode()
in
> double quotes. But I would really like to understand WHY this doesn't
work.
> Again, all other varaibles are properly resolved, and in IE $PHP_SELF is
> properly resolved.
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
> --
> PHP General Mailing List (http://www.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] Why???

2001-02-14 Thread John Vanderbeck

I can help you there, as I had the same problem until someone else helped
me.  This is because PHP will escape the input it gets.  I think this is
dependant on some enviroment setting, but I can't recall which one.

To fix it you call stripslashes($var);

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Nguyen, David M" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 14, 2001 11:02 AM
Subject: [PHP] Why???


> Hi all,
>
> I have a PHP web form setup for user to fill in information then email it
to
> me after pressing SUBMIT button.  Everytime user uses double-quote(") or
> single(') it inserts (/) right in front of " or '.  Does anyone know why
and
> how to fix it?  Please advise.  Below is example of what I got from my
email
> when user submits form to me.
>
>
> Topic: Added \"Initial login to the EMS\" procedure.
>
>
> Thanks in advance,
> David
>
>
>
> --
> PHP General Mailing List (http://www.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] RE: $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

I converted everythign over to use '.' instead of  ',' but I still get the
same exact results.  That is, $PHP_SELF is resolved to NULL, and every other
variable to the correct data.  Here is the new string:

echo ''
.$subcategories[$index]. '';


I think i'm just going to give up on this and rewrite it, because it DOES
work if I do the old double quotes bit.  Just means I need to re-arrange it
and do it in multiple ECHO statements, because I can't do the urlencode() in
double quotes. But I would really like to understand WHY this doesn't work.
Again, all other varaibles are properly resolved, and in IE $PHP_SELF is
properly resolved.

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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 globals aren't really globals

2001-02-14 Thread John Vanderbeck

> Rasmus wrote:
>  >I swore I would not have the same problem in PHP and thus the
requirement
>  >for people to be explicit about using global variables inside functions.
>  >Hopefully it also forces a little bit of structure and organization on
>  >people.
>
> Hear, hear and thank you Rasmus. It seems to me that the several other
ways
> folks have listed to solve this one example indicates that we don't really
> need the temporary convenience of wide open globals (temporary as in it
> doesn't end up very convenient when they create problems).

I was always tought very simply, don't use globals :)

However, that isn't always an option.  I have no problems with the way PHP
does things.  I think its a good idea for the shelter. What I find
interesting is that it seems when you are first learning a language, you use
more globals, than when you are more experienced with it.  When I first
started programmig in C, 99% of my variables were global.  Look at any of my
C/C++ code nowadays, over 10 years later, and you will be hard pressed to
find a global.

PHP is still new to me, so i'm still trying to use alot of globals.  Because
of the way PHP handles it, i'm jumping through a few hoops.  That is
annoying, but I don't consider it a problem, because as I get better, I know
I will go back through and rewrite things to not use globals.  I guess my
confusion is this: I am passing all my variables around between scripts by
sending them through the URLs (index.php?mode=index).  I guess what "annoys"
me, is I would expect those to be available from inside the functions, but
they aren't.

- John Vanderbeck
- Admin, GameDesign

>
>  Visit the Gates Motel webgame:
>  http://www.gameslate.com/gatesmotel/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

> You are using commas instead of periods, use ".$PHP_SELF." instead of
> ",$PHP_SELF," (and for the other instances as well).

Huh? I am going off of the example from the PHP documentation:

>From http://www.php.net/manual/en/function.urlencode.php
echo '';

So I am using that as a model:
echo ' A HREF=" ', $PHP_SELF, '?mode=index&category=',
urlencode($cateogory), ' ">Blah';

- John Vanderbeck
- Admin, GameDesign

>
>
>  Visit the Gates Motel webgame:
>  http://www.gameslate.com/gatesmotel/
>
>


-- 
PHP General Mailing List (http://www.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 globals aren't really globals

2001-02-14 Thread John Vanderbeck

> Perhaps I'm missing something.  In order to access the value of any
> variable defined outside the scope of the function, you have to declare
> it as "global".  This is true in every single instance.  If you do not,
then
> you cannot access the value of that variable.  While it's been a while
> since I've worked with C, I seem to recall it being the case there as
> well.  And in Pascal.  And in VB.  Again, it's been a while so I could be
> wrong (but don't think so).

Not realy.  In most languages, heck , all I can think of, the variable's
scope is simply dependant on WHERE it was declared, not how it was declared.
If in C/C++ you define a variable outside the scope of any function, then it
becomes global and can be accessed by any function.

I'm not arguing one side or the other, just stating :) I personally find the
PHP way a bit annoiying, but its workable, and i'm SURE there was a reason
for it.  Just not sure what that reason was :)

- John Vanderbeck
- Admin, GameDesign

>
> 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] $PHP_SELF in Netscape PART 2

2001-02-14 Thread John Vanderbeck

Ok, I made all the changes from $PHPSELF to $PHP_SELF, and i'm further along
with Netscape than before.  However, it now seems that there are still some
statements that $PHP_SELF isn't evaluated in.  However, now I can narrow it
down to certain statements:

WORKS:
   echo "Main -> $category";

DOES NOT WORK:
echo '',
$subcategories[$index], '';


- John Vanderbeck
- Admin, GameDesign



-- 
PHP General Mailing List (http://www.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] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck

> > Thanks that fixed it.  I didn't realize there were two version of this
> > variable.  Why? Hmm, strange that the other one worked fine with IE but
not
> > Netscape.  I thought all thi was done server side, so what the heck does
the
> > browser have to do with it?
>
> As far as I know, $PHP_SELF is the variable and NOT $PHPSELF.  It works
> in IE because if no page is printed in the tag, it just reloads the same
> page anyway.  If you look at your html source while using $PHPSELF, you
> will probably see something like this:
>
> This is the link
>
> Netscape realizes this is invalid html and complains, IE simply reloads
> the current page.
>

No, that can't be it, because it actually gets resolvedI have echo'd it
out to the screen to verify, and it DOES get resolved in IE.

- John Vanderbeck
- Admin, GameDesign

> --
> Jason Stechschulte
> [EMAIL PROTECTED]
> --
> But you have to allow a little for the desire to evangelize when you
> think you have good news.
>  -- Larry Wall in <[EMAIL PROTECTED]>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck


- Original Message -
From: "Pavel Jartsev" <[EMAIL PROTECTED]>
To: "John Vanderbeck" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 12:49 PM
Subject: Re: [PHP] Netscape not resolving $PHPSELF ??


>
> Try $PHP_SELF.
>
> --
> Pavel a.k.a. Papi
>

Thanks that fixed it.  I didn't realize there were two version of this
variable.  Why? Hmm, strange that the other one worked fine with IE but not
Netscape.  I thought all thi was done server side, so what the heck does the
browser have to do with it?

- John Vanderbeck
- Admin, GameDesign


> --
> PHP General Mailing List (http://www.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] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck

Well, yes the script was in the root (root of the URL not root of the
server).  I threw it into a subdirectory, but no go.  Same problem.

Very strange.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Jon Haworth" <[EMAIL PROTECTED]>
To: "'John Vanderbeck'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 12:46 PM
Subject: RE: [PHP] Netscape not resolving $PHPSELF ??


> Is the script in the root? I seem to remember reading about problems with
> this and Netscape (although that sounds so strange I'm doubting myself
here
> :-)
>
> Try shoving it in a subdirectory and see what happens. It's got to be
worth
> 30 seconds to find out - I'd do it right now only I don't have Netscape at
> work
>
> HTH
> Jon
>
>
>
> -Original Message-
> From: John Vanderbeck [mailto:[EMAIL PROTECTED]]
> Sent: 13 February 2001 17:42
> To: [EMAIL PROTECTED]
> Subject: [PHP] Netscape not resolving $PHPSELF ??
>
>
> I'm having a problemin Netscape, any of my echo statements that use
> $PHPSELF, netscape isn't resolving $PHPSELF, but properly resolving all
the
> other vars.  There are several different types of echo statements, but
here
> is a sample:
>
> echo '',
> $subcategories[$index], '';
>
> and:
>
>echo " HREF=$PHPSELF?mode=index&category=root>Main -> $category";
>
>
> Any ideas? This works FINE in Internet Explorer. And all the other vars in
> those echo statements are properly resoved into value.
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
> --
> PHP General Mailing List (http://www.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] Netscape not resolving $PHPSELF ??

2001-02-13 Thread John Vanderbeck

I'm having a problemin Netscape, any of my echo statements that use
$PHPSELF, netscape isn't resolving $PHPSELF, but properly resolving all the
other vars.  There are several different types of echo statements, but here
is a sample:

echo '',
$subcategories[$index], '';

and:

   echo "Main -> $category";


Any ideas? This works FINE in Internet Explorer. And all the other vars in
those echo statements are properly resoved into value.

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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] Any performance penalties for switch vs. if/else?

2001-02-13 Thread John Vanderbeck

In most cases, using a switch is preferrable. The code is cleaner, and the
performance increases.  This is true accross languages.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "John Guynn" <[EMAIL PROTECTED]>
To: "Php (E-mail)" <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 11:34 AM
Subject: [PHP] Any performance penalties for switch vs. if/else?


> If I have a complex if else statement and I replace it with a switch case
> statement do I loose any performance?  I would think I would gain
> performance and the code is definitely easier to maintain but I wanted
some
> other opinions.
>
> John Guynn
>
> This email brought to you by RFCs 821 and 1225.
>
>
> --
> PHP General Mailing List (http://www.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] Mystery quotes

2001-02-13 Thread John Vanderbeck

What about just forcing the use of escaped quotes? Have you tried that?

instead of:
echo "document.write(\"
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 13, 2001 10:38 AM
Subject: [PHP] Mystery quotes


> I'm encountering the following problem and now wonder if it's related to
> magic quotes.
>
> The code in the current, non-working form. Please note that for the
>  there are no quotes or apostropies around the word "text" the
size
> of 9, the name of proj[].
>

> ***
> echo "  

Re: [PHP] fscanf problem

2001-02-12 Thread John Vanderbeck

Hmm..noone has any ideas on this one?  Its really driving me crazy

- John Vanderbeck
- Admin, GameDesign

- Original Message - 
From: "John Vanderbeck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 11, 2001 10:01 PM
Subject: [PHP] fscanf problem


> my code...
> 
> WRITE TO FILE:
>  if ($item_file = fopen("$thisdir/item.dat", "w"))
>  {
>   fwrite($item_file, "$new_item\n$asin\n$description\namazon");
>   fclose($item_file);
>   echo "$new_item created";
>  }
> 
> READ FROM FILE:
>$item_file = fopen("$thisdir/item.dat", "r");
>fscanf($item_file, "%s\n%s\n%s\n%s", $display, $asin, $description,
> $link);
>fclose($item_file);
> 
> PROBLEM:
> $display comes out correct, but $asin, $descrition and $link are always
> empty
> 
> SAMPLE FILE:
> MyItem
> 11517
> ThisIsMyDecriptionWithoutSpaces
> amazon
> 
> - John Vanderbeck
> - Admin, GameDesign
> 
> 
> -- 
> PHP General Mailing List (http://www.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] fscanf problem

2001-02-11 Thread John Vanderbeck

my code...

WRITE TO FILE:
 if ($item_file = fopen("$thisdir/item.dat", "w"))
 {
  fwrite($item_file, "$new_item\n$asin\n$description\namazon");
  fclose($item_file);
  echo "$new_item created";
 }

READ FROM FILE:
   $item_file = fopen("$thisdir/item.dat", "r");
   fscanf($item_file, "%s\n%s\n%s\n%s", $display, $asin, $description,
$link);
   fclose($item_file);

PROBLEM:
$display comes out correct, but $asin, $descrition and $link are always
empty

SAMPLE FILE:
MyItem
11517
ThisIsMyDecriptionWithoutSpaces
amazon

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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: Re[2]: [PHP] Testing CONNECTION Speed

2001-02-10 Thread John Vanderbeck

Well,

There are about 3 or 4 sites on the net that will test your connection
speed, so it must be possible.  I know MSN has one.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Andrew Golovin" <[EMAIL PROTECTED]>
To: "Adam Knight" <[EMAIL PROTECTED]>
Cc: "Matias Banzas" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Saturday, February 10, 2001 1:21 AM
Subject: Re[2]: [PHP] Testing CONNECTION Speed


> Hello, Adam!
>
> Thursday, February 08, 2001, 11:48:12, you wrote:
>
> AK> 3) Send a large graphic (200K)
>
> AK> No, it's not transparent to the user and no it's not microtime
accurate, but
> AK> it *does* work.
> it *dosn't* work. what if user turn off grafix in his browser?
>
> >>Is there any way to do this?? i mean.. test the connection speed of a
client
> >>machine???
>   i think that no way to determine client connection speed. browsers
>   open not one connection to server. usually it's 10 threads to load
>   grafix in separate treads. some grafix placed in cache (remote or
>   local).
>   asking user is the only way to determine connection speed.
>
> Best regards!
> Andrew Golovin
> PGP Fingertip 24FD A0CD 667C 1FC7 C2F7  A2EA 9742 D484 FD3C 598D
> http://exper.ural.ru/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] [Newbie] PHP Variables

2001-02-09 Thread John Vanderbeck

> I just wanted to try this:
>
> I take a link : http//www.xy.com/index.php?contents=HOME
>
> There I echo contents
>
> 
> 

I'm still learning PHP, but...

Why are you echoing it twice? Also, the first line, shouldn't it be:


Looks liek you dropped the semi colon

- John Vanderbeck
- Admin, GameDesign

>
> It should display HOME? But it does not !
>
>
>  -Original Message-
> From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
> Sent: donderdag 8 februari 2001 23:55
> To: Steve Haemelinck
> Subject: RE: [PHP] [Newbie] PHP Variables
>
> you can, what's the rest of your script look like.
>
> > -Original Message-
> > From: Steve Haemelinck [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, February 08, 2001 3:49 PM
> > To: PHP Mailing Listl (E-mail)
> > Subject: [PHP] [Newbie] PHP Variables
> >
> >
> > I thought you can pass variables in PHP as in CGI.
> >
> > http://www.xy.com/index.php?contents=HOME
> >
> > contents should be available as variable, but it does not seem to
> > work. Doe
> > anyone has an idea why not?
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] shows up in IE but not Netscape

2001-02-09 Thread John Vanderbeck

> Good web design rule of thumb: Always check against Netscape.  If it
> renders in Netscape, odds are it'll render in IE.  The reverse is not
> true.
>
> Matt


I find dealing with Netscape browsers a pain.  So many people complain that
IE doesn't follow the standards, but I find it the other way around.
Especially when it comes to Stylesheets, even using CSS Level 1, which is
like 5 years old.  Netscape just plain ignores alot of attributes, or
handles them different from the spec, that it makes it such a pain getting a
page to look the same in both.  Arg

/Rant off
- John Vanderbeck
- Admin, GameDesign

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


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




Re: [PHP] how to know which web dir you're in

2001-02-09 Thread John Vanderbeck

Well... $PHPSELF gives the full url to the current webpage..so if you are
at:
http://gamedesign.incagold.com/index.php

then $PHPSELF = http://gamedesign.incagold.com/index.php

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Jason Jacobs" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 10:40 AM
Subject: [PHP] how to know which web dir you're in


> Anyone got any ideas on how to tell what the url you're at?  One of my
sites
> is for a bank with a bunch of branches, and when people go to a site for a
> branch, I want the "prequalify for loan" to know where the person came
from
> (it's the same page for all branches, but it just has a select box) and
make
> the location they came from be the selected one when the prequal page
comes
> up.  Whaddya think?
>
> Thanks.
> Jason
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] good free/cheap IDE for PHP

2001-02-09 Thread John Vanderbeck

I use UltraEdit (ultraedit.com).  It does syntax highlighting and ALOT more.
The one feature that I REALLY like is the ability to treat files on my FTP
as if they were local files.  It greatly simplifies things, and speed up my
development.

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "Dennis von Ferenczy" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Friday, February 09, 2001 8:08 AM
Subject: [PHP] good free/cheap IDE for PHP


> can anybody please tell me which good IDEs are theee, that are optimized
for
> PHP?
> It acztually doesn't need to do much more, than just code highlighting and
> line numbering for me purposes, althoug i would of course appreciate
> additionla features.
> thx in advance
>
>
> --
> PHP General Mailing List (http://www.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] include("blah.php?var=this"); doesn't work?!

2001-02-08 Thread John Vanderbeck

Thanks everyone who responded.  I got it fixed now.  I didn't realize that
the included file resided in the same scope.  Once I knew that it was easy
to take care of.

Thanks!

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "John Vanderbeck" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 08, 2001 12:27 PM
Subject: [PHP] include("blah.php?var=this"); doesn't work?!


> I need to be able to do:
>
>  if (isset($asin))
> {
> include("book_reviews.php?asin=$asin");
> }
> else
> {
> include("book_reviews.php");
> }?>
>
> This is embeded in one of my sites pages..However, the call with the var
> added on won't work, it seems like its looking for a file with that whole
> name.  Does anyone know how I can do this?
>
> - John Vanderbeck
> - Admin, GameDesign
>
>
> --
> PHP General Mailing List (http://www.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] include("blah.php?var=this"); doesn't work?!

2001-02-08 Thread John Vanderbeck

I need to be able to do:



This is embeded in one of my sites pages..However, the call with the var
added on won't work, it seems like its looking for a file with that whole
name.  Does anyone know how I can do this?

- John Vanderbeck
- Admin, GameDesign


-- 
PHP General Mailing List (http://www.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] test for undefined variables & renaming variables

2001-02-07 Thread John Vanderbeck

Not sure if this is hat you are looking for, but I do something similiar in
my script.  Its set up so that the action of the script depends on whether
or not the ASIN was passed in..

if(isset($asin))
{
 $mode='save_info';
}

that way if something like: "book_reviews.php?asin=000129091" is called,
then it will save the information, but if "book_reviews.php" is passed, then
its not defined and it goes to a different mode (which in my case is a form
to get the information)

- John Vanderbeck
- Admin, GameDesign

- Original Message -
From: "August Malson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, February 08, 2001 2:11 AM
Subject: [PHP] test for undefined variables & renaming variables


> Q:
> Does anyone know of a way to test for undefined variables?  For example, I
> am sending a variable into the page, but the processing of the page
depends
> on what is being passed to the page.
>
> Say, I am typing the following on the location bar:
> index.php?fuseaction=something&fuse=6
>
> and I want something to happen if fuse is actually declared, and something
> else to happen if fuse is not defined.
>
> I have tried isdef(), but that function does not seem to work, and I
> couldn't find it in the manual when I was looking for it.
>
> Code to use on:
>
> if($HTTP_GET_VARS("fuse") == NULL) then do something; else do something
> else;
>
>
> Q:
> Also, does anyone know how to rename a variable?
>
> I want to create a variable $attributes_NameOfVariable, but it does not
seem
> to work.  is there a function that exists in PHP that will assist me in
this
> process?
>
> Thank you for all of your help, and thank you for your time,
>
> August Malson
>
>
> --
> PHP General Mailing List (http://www.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] UN-Escaping text from a form submit?

2001-02-07 Thread John Vanderbeck

Thanks everyone..Seems it was a very simple thing   I had searched
around on the PHP site, but i'm tired, and I must have missed it.  Thanks!

- John Vanderbeck
- Admin, GameDesign

- Original Message - 
From: "David Robley" <[EMAIL PROTECTED]>
To: "John Vanderbeck" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 07, 2001 10:57 PM
Subject: Re: [PHP] UN-Escaping text from a form submit?


> On Thu,  8 Feb 2001 14:17, John Vanderbeck wrote:
> > Hello again,
> >
> > I have a form that is used to submit data to my script.  If the user
> > enters something like:
> >
> > The title of this book doesn't really matter to "me"!
> >
> > When I get that back, and read it from the file, it always ends up
> > like:
> >
> > The title of this book doesn\'t really matter to \"me\"!
> >
> > Note the addition of the escape sequences.  How can I stop this? Is
> > there some function in PHP? Or am I goign to have to write a character
> > routine to strip out escape sequences? 
> >
> > - John Vanderbeck
> > - Admin, GameDesign
> 
> addslashes and stripslashes are the functions you need.
> 
> -- 
> David Robley| WEBMASTER & Mail List Admin
> RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
> AusEinet| http://auseinet.flinders.edu.au/
> Flinders University, ADELAIDE, SOUTH AUSTRALIA
> 


-- 
PHP General Mailing List (http://www.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] UN-Escaping text from a form submit?

2001-02-07 Thread John Vanderbeck

Hello again,

I have a form that is used to submit data to my script.  If the user enters
something like:

The title of this book doesn't really matter to "me"!

When I get that back, and read it from the file, it always ends up like:

The title of this book doesn\'t really matter to \"me\"!

Note the addition of the escape sequences.  How can I stop this? Is there
some function in PHP? Or am I goign to have to write a character routine to
strip out escape sequences? 

- John Vanderbeck
- Admin, GameDesign


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




[PHP] PHP Newbie, Experienced Porgrammer, Annoying fread() problem

2001-02-07 Thread John Vanderbeck

Hello all,

Please bear with me for a moment.  I am new to PHP work, but have over 10
years experience in various other programming languages including C/C++

I'm just getting really frustrated here, and i'm hoping its a simple
mistake.  What I am running into is that ever file I open and read from, I
never actually get any data.  I know the data is in the file, but I don't
get it.  I can write to it fine.

Basic scenario is this...I have 2 modules, one that creates my data and one
that reads it.  I'm setting up a system for book reviews.  The first module
has a forms page that gets the book's ASIN, TITLE, and DESCRIPTION.  There
is a common books directory.  The module creates a subdirectory off of this
dir, and the sub dir's name is the ASIN of the book.  In this new sub
directory a file is created that contains 3 lines.  The ASIN, the TITLE, and
the DESCRIPTION, each seperated by a newline (\n).  This seems to work fine.

The second module is one that will display everythign to the users, and
eventually allow user submitted reviews.  This module opens a directory
handle for the common books directory, and enumerates each subdir (skipping
'.' and '..').  It then attempts to open the information file in each subdir
that was created above, and display the results.  Its always empty.  I can
include code if requested, but here are a few snippets of the immediate
areas..

first module 1 which does the saving of info:

 case 'save_info':
  if ($book_file = fopen("$booksdir/books.dat", "a"))
  {
   fwrite($book_file, $asin);
  }
  fclose($book_file);
  if ($book_file = fopen("$thisdir/book_info.dat", "w"))
  {
   fwrite($book_file, "$asin\n$title\n$description");
  }
  fclose($book_file);
  break;


and the module 2, the reads:
 // get directory handle
 $dir_handle = opendir($thisdir);
 $books = array();
 // load valid book directories into an array
 while($book_file = readdir($dir_handle))
 {
  if ($book_file != "." && $book_file != ".." &&
is_dir("$thisdir/$book_file"))
  {
   $books[] = $book_file;
   echo "Added: $book_file";
  }
 }
 // loop through books and create HTML entry for each
 $index = 0;
 for ($index = 0; $index < sizeof($books); $index++)
 {
  $book_data_file = fopen("$thisdir/$books[$index]/book_info.dat", "r");
  echo "Opened $thisdir/$books[$index]/book_info.dat";
  $book_data_in = fread($book_data_file, filesize($book_data_file));
  echo "book_data_in = $book_data_in";
  fclose($book_data_file);
  $book_data = explode("\n", $book_data_in);
  echo "ASIN:";
  echo "$book_data[0]";
  echo "";
  echo "Title:";
  echo "$book_data[1]";
  echo "";
  echo "Description:";
  echo "$book_data[2]";
  echo "";
 }


If anyoen can clear this up for me, I would most appreciate it.  I'm on a
tight deadline, learning PHP as I go, and losing my mind on this seemingly
simple excersise!

- John Vanderbeck
- Admin, GameDesign


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