Re: [PHP] exploding strings

2002-11-20 Thread Ernest E Vogelsinger
At 05:54 20.11.2002, Michael P. Carel said:
[snip]
Hi to all,

I have a problem regarding  exploding string. I want to explode string
sepated by + sign, but i want it also the first variable in the array be
distinc in terms of collor or whatever when viewed in the page.

ex.

$no=(1+2+3);
$number=explode(+, $no);

how could i echo $no with the first no. 1  be in colored.
[snip] 

You need to handle the first element separately, then chime in with the rest:

$string = '1+2+3';
$as = explode('+',$string);
echo 'font color=red',array_shift($as), '/font, ', join(', ', $as);


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] date

2002-11-20 Thread Matthieu Le Corre
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

2 fonction for that ;) 
written specially for the same pb as you ;)

// transformation de la date jj/mm/ - -mm-jj
function modate ( $date )
{ $inter= split(/,$date) ;
  $date=$inter[2].-.$inter[1].-.$inter[0] ;
  return $date ;
}

// transformation de la date -mm-jj - jj/mm/
function revmodate( $date )
{ $inter= split(-,$date) ;
  $date=$inter[2]./.$inter[1]./.$inter[0] ;
  return $date ;
}


Le Mardi 19 Novembre 2002 15:10, Edward Peloke a ¨¦crit :
 I am pulling from a datetime field in mysql.  The actual data looks like
 this: 2002-11-30 00:00:00  When I output the data to the page, I want it to
 appear as 11/30/2002.  I want to use a php date format.  I do not want it
 formatted as it comes out of the db. But date(m/d/y, $myrow[departdate])
 returns 12/31/69.  How can I do this?

 THanks,
 Eddie

- -- 
   __
 / Matthieu Le Corre
|  Service Informatique
| 
|  Inspection Academique de la Sarthe
|  72000 LE MANS
| 
|  Tel   : 02 43 61 58 91 
|  Mail : [EMAIL PROTECTED]
 \
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE921i5iQG6YxCcev4RAu1jAJ0UFm1XAp7C8zKeOPc/CEA32jZpdgCfReBY
3uhaeYd614pugiecRDDCYOM=
=7f9l
-END PGP SIGNATURE-


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




[PHP] using move_uploaded_file

2002-11-20 Thread nirat
can anyone give me a hint  as to how to use a file upload script any kind of
code will be good.. I am using IIS5.0 with PHP 4.2.3.

Regards
Nirat



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




RE: [PHP] using move_uploaded_file

2002-11-20 Thread Michael Hazelden
http://www.php.net/manual/sk/features.file-upload.php

found in 2 seconds searching the PHP site for Uploaded File.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 20 November 2002 05:32
To: [EMAIL PROTECTED]
Subject: [PHP] using move_uploaded_file


can anyone give me a hint  as to how to use a file upload script any kind of
code will be good.. I am using IIS5.0 with PHP 4.2.3.

Regards
Nirat



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


_
This message has been checked for all known viruses by the 
MessageLabs Virus Control Centre.

This message has been checked for all known viruses by the MessageLabs Virus Control 
Centre.


*

Notice:  This email is confidential and may contain copyright material of Ocado 
Limited (the Company). Opinions and views expressed in this message may not 
necessarily reflect the opinions and views of the Company.
If you are not the intended recipient, please notify us immediately and delete all 
copies of this message. Please note that it is your responsibility to scan this 
message for viruses.

Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

*

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




Re: [PHP] using move_uploaded_file

2002-11-20 Thread nirat
thanks will give it a try


Michael Hazelden [EMAIL PROTECTED] wrote in message
C1260EE72F22C44F833D033A17524AD702A4D1A2@lhoexc1">news:C1260EE72F22C44F833D033A17524AD702A4D1A2@lhoexc1...
 http://www.php.net/manual/sk/features.file-upload.php

 found in 2 seconds searching the PHP site for Uploaded File.


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: 20 November 2002 05:32
 To: [EMAIL PROTECTED]
 Subject: [PHP] using move_uploaded_file


 can anyone give me a hint  as to how to use a file upload script any kind
of
 code will be good.. I am using IIS5.0 with PHP 4.2.3.

 Regards
 Nirat



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


 _
 This message has been checked for all known viruses by the
 MessageLabs Virus Control Centre.

 This message has been checked for all known viruses by the MessageLabs
Virus Control Centre.


 *

 Notice:  This email is confidential and may contain copyright material of
Ocado Limited (the Company). Opinions and views expressed in this message
may not necessarily reflect the opinions and views of the Company.
 If you are not the intended recipient, please notify us immediately and
delete all copies of this message. Please note that it is your
responsibility to scan this message for viruses.

 Company reg. no. 3875000.  Swallowdale Lane, Hemel Hempstead HP2 7PY

 *



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




Re: [PHP] catching a robot or spider - asking too

2002-11-20 Thread W. Enserink
check out the url for aother big list of user agents.
I guess the only way to catch a robot is to use this list and compate them
to the incoming user agent and then do your thingie.

http://www.browserlist.browser.org/browser_mappings_list_big.html

regards Wilbert


- Original Message -
From: Steve Vernon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, November 19, 2002 11:18 PM
Subject: Re: [PHP] catching a robot or spider - asking too


 From what I think I heard on another group was that it dosent matter what
 stylesheet you use, it will just read the file, getting words and
following
 links. Cant remember where I read this, think it was a forum, and they
were
 argueing about robots and whether they follow links specified in
JavaScript.

 One person said he was going to do a link to a page which only robots will
 follow, say do it on a 1*1 pixel so no chance of a user to follow it. And
on
 that page do list of keywords as most robots ignore to many keywords in
meta
 tags. This would mean doing the limit robot meta tags to only the home
page
 and the robot page.

 So you could do a page with your links on, that is linked from the home
page
 but hard to click on! And do the meta tags on other pages to stop robots.

 Could work?!

 Love,

 Steve
 XX





   does anybody know a way to make a distinction
   between robots and users?
   should I use the user agent? Or is this not a safe method.
   If the visitor is a spider/robot I want to include some script
   containing extra URL's for the robot.
 
  I am very interested too in this, as I received visits from a site with
a
  rather strange user agent (well, at least, that I did not expect) on a
web
  site of mine. The user agent was something like
 
  SurveyBot/2.2 a href=\'http://www.whois.sc\'Whois Source/a
 
  I really don't know how I should generate my pages in this case, what
kind
  of stylesheet I should include to make the page correct (if I even have
 to).
 
  Anyway, the real question behind is :
 
  Is there a good way to handle the user agent info?
 
 
  Vincent Vandemeulebrouck
  http://www.leguerriersorde.com/
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 


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

- 
Pas de Deux 
Van Mierisstraat 25 
2526 NM Den Haag 
tel 070 4450855 
fax 070 4450852 
http://www.pdd.nl 
[EMAIL PROTECTED] 
-

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




Re: [PHP] Help with functions()

2002-11-20 Thread Chris Hewitt
Beauford 2002 wrote:


Hi,

I have form that a user would input information and that info is sent to
a function, but I need to be able to return a result of this function
and is where I am having a problem. 

For example:

testfunction($var1, $var2, $var3, $var4);  //the form fills these
values.

echo $meat;

function testfunction($a, $b, $c, $d) {

	The $meat of the function goes here;

	Now I need to return the result of $meat;

	return $meat;
}

$return_value = testfunction (

echo $return_value;

HTH
Chris






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




Re: [PHP] Problem whith query in query

2002-11-20 Thread Marek Kilimajer
you can use temporary tables:

CREATE TEMPORARY TABLE tmp_name SELECT SELECT MAX(ii.identifiseringid) 
AS max_ii
FROM identifisering as ii
GROUP BY dprosjekt

then:

SELECT * FROM identifisering as i, tmp
WHERE i.identifiseringid='123' AND i=identifiseringid=tmp.max_id;


Lars Espelid wrote:

Hello,

I need some help whith a mysql-query. Can anyone help?
Is there a good newsgroup for mysql?

Identifiseringid is the primary key of the table identifisering and is
autoincrement.
There is also a coloumn named dprosjekt in identifisering and some other
coloumns.
dprosjekt has the same value for several tuples.
For each unike dprosjekt I want to print the record where identifiseringid
is max.

I tought this would work, but it won't:

SELECT * FROM identifisering as i
WHERE i.identifiseringid=(SELECT MAX(ii.identifiseringid)
FROM identifisering as ii
GROUP BY dprosjekt);

also tried:

SELECT * FROM identifisering as i
WHERE i.identifiseringid IN (SELECT MAX(ii.identifiseringid)
FROM identifisering as ii
GROUP BY dprosjekt);

When I split the query they work:

SELECT * FROM identifisering as i
WHERE i.identifiseringid='123';

SELECT MAX(ii.identifiseringid)
FROM identifisering as ii
GROUP BY dprosjekt;



Thanks,

Lars




 



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




[PHP] Re: PHP Application Framework

2002-11-20 Thread Alexandru COSTIN
Hello,
You could check Krysalis, http://www.interakt.ro/products/Krysalis/

It's GPL, and it has a lot of powerful features included, as it's based on 
XML and XSL.

Alexandru
 Hi all,
 
 
 Does anyone have a recommendation for a stable yet flexible application
 framework for PHP?
 
 Something similar to Midgard that will run on Windows would be nice.
 
 Thanks!


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




[PHP] RE: exploding strings

2002-11-20 Thread COQUET,JULIEN (HP-France,ex1)
heh does the job :)

?php

$no=(1+2+3);
$number=explode(+, $no);

foreach ($number as $key=$value){
if ($value==1) {
print 'span style=color:red;'.$value.'/span';

}

}

?

-Original Message-
From: Michael P. Carel [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 5:54 AM
To: 
Subject: exploding strings


Hi to all,

I have a problem regarding  exploding string. I want to explode string
sepated by + sign, but i want it also the first variable in the array be
distinc in terms of collor or whatever when viewed in the page.

ex.

$no=(1+2+3);
$number=explode(+, $no);

how could i echo $no with the first no. 1  be in colored.

Any idea. thanx in advance



Regards,

mike


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




[PHP] Simple Question on Date conversion

2002-11-20 Thread Jack
Dear all
Can anyone pls tell me how i can turn number : 10 to Oct?
i counting on the month, that's why i won't to convert the result to month!

Thx a lot

Jack



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




[PHP] editing .htaccess / .htpasswrd

2002-11-20 Thread Oliver Witt
Hi everyone,
I'm looking for a script that enables users of password demanding web
sites to change their password, in other words a script, that can write
into the .htpsswrd file.
Thanks for help,
Olli


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




RE: [PHP] Simple Question on Date conversion

2002-11-20 Thread John W. Holmes
 Dear all
 Can anyone pls tell me how i can turn number : 10 to Oct?
 i counting on the month, that's why i won't to convert the result to
 month!

$months = array(1='January',2='February',3='March',...);

echo $months[$your_month_number];

You could also use a combo of date() and mktime().

echo date('F',mktime(0,0,0,$your_month_number,15,2002);

The day and year part of mktime() can be anything.

---John Holmes...



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




[PHP] Re: isapi mod on iis

2002-11-20 Thread Brian McGarvie
The Internet Guest user needs to have permissions to the foler the script's
are located. This should remove the auth request.

Chris Edwards [EMAIL PROTECTED] wrote in message
04f901c28ffa$a75867e0$4300a8c0@development">news:04f901c28ffa$a75867e0$4300a8c0@development...
 is anyone running the isapi mod on iis?  why does it ask for
authenitcation
 when I run a script?

 --
 Chris Edwards
 Web Application Developer
 Outer Banks Internet, Inc.
 252-441-6698
 [EMAIL PROTECTED]
 http://www.OuterBanksInternet.com




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




[PHP] flush() issue

2002-11-20 Thread Jock Pereira
Having an issue getting flush to work. Browser version is IE 6 sp1.  I am not using 
mod_gzip on Apache. In the following code sample you can see that I am looping through 
a mysql result array and using a different include each time. At the end of the 
foreach loop I am attempting to flush to the browser. I am taking into consideration 
the buffer size that must be met for flush to work (str_pad) and all other 
considerations I came across in the php manual... 
http://www.php.net/manual/en/function.flush.php. 

Despite the below my browser does not show results until the entire script has 
completed (~10 minutes). Any idea on how I can get this to work? Anything to take into 
consideration that I am not... considering... below?

Thanks!

Jock Pereira
_ Code_Sample_Below__

$result = mysql_query(SELECT * FROM DEALER_Inventory WHERE DealerID = '$this_dealer' 
AND Car_Type != 'new'); 

foreach ($themalls as $thismall)

{

 logExportResults($this_dealer, $thismall, Exporting...);
 Print (brstrongfont size=\2\ face=\Arial, Helvetica, 
sans-serif\nbsp;nbsp;$this_dealer: Sending to $thismall/font/strongbr);


 
 include('include/EXPORT_'.$thismall.'.php');
 mysql_data_seek($result,0);
 logIt(7,,$thismall);
 logExportResults($this_dealer, $thismall, Export Done...);
 
 echo str_pad( , 300);
 flush(); 

}
___ End_Code_Sample__



Re: [PHP] flush() issue

2002-11-20 Thread Marek Kilimajer
I don't see an y newlines, try adding some. Is it working with other 
browsers?

Jock Pereira wrote:

Having an issue getting flush to work. Browser version is IE 6 sp1.  I am not using mod_gzip on Apache. In the following code sample you can see that I am looping through a mysql result array and using a different include each time. At the end of the foreach loop I am attempting to flush to the browser. I am taking into consideration the buffer size that must be met for flush to work (str_pad) and all other considerations I came across in the php manual... http://www.php.net/manual/en/function.flush.php. 

Despite the below my browser does not show results until the entire script has completed (~10 minutes). Any idea on how I can get this to work? Anything to take into consideration that I am not... considering... below?

Thanks!

Jock Pereira
_ Code_Sample_Below__

$result = mysql_query(SELECT * FROM DEALER_Inventory WHERE DealerID = '$this_dealer' AND Car_Type != 'new'); 

   foreach ($themalls as $thismall)

   {
   
logExportResults($this_dealer, $thismall, Exporting...);
Print (brstrongfont size=\2\ face=\Arial, Helvetica, sans-serif\nbsp;nbsp;$this_dealer: Sending to $thismall/font/strongbr);
   


include('include/EXPORT_'.$thismall.'.php');
mysql_data_seek($result,0);
logIt(7,,$thismall);
logExportResults($this_dealer, $thismall, Export Done...);

echo str_pad( , 300);
flush(); 
   
   }
___ End_Code_Sample__

 



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




[PHP] Pause for user input?

2002-11-20 Thread Larry Brown
Does anyone know of a method to pause during the processing of a script to
prompt a user for information and then incorporate the user's response for
the remainder of the script?

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388




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




[PHP] manage Form data

2002-11-20 Thread ??????? ?????ta?
I want to sumbit data from a form and then view the data and then send it to the data 
base...



Re: [PHP] Pause for user input?

2002-11-20 Thread Ernest E Vogelsinger
At 14:42 20.11.2002, Larry Brown spoke out and said:
[snip]
Does anyone know of a method to pause during the processing of a script to
prompt a user for information and then incorporate the user's response for
the remainder of the script?
[snip] 

This seems to be a very common misunderstanding of how the Web works.

First as an answer to your question, you cannot do it, no way.

Next, assume you're a manufacturer and send some goods to a customer,
wrapped in a parcel. What you want to achieve is: when the customer
eventually receives the parcel, you ask him if the address label is printed
correctly. If he answers yes you give him a scissor to open it, if not
you hand him another - now corrected - label.

It's clear that this can't be done - you're at your office, and your
customer is at his location. While clear in real world terms, this is
often misunderstood for internet applications.

In the example above the client browser (better: the web form) is you, the
manufacturer. The customer receiving the goods is the server application.
The form is displayed and filled out at the users browser, clicking on
submit transmits the whole form content to the server for processing.
From this moment the client's out of the game.

-
Ok, but I have a solution.

If you are able to interrupt your processing to ask the user some question,
you can view your process as two parts - let's name them PreProcess and
PostProcess. When the user submits the form, the server starts the
PreProcess action. At the end of the PreProcess action the current data
status gets saved to session persistent storage, and another form is sent
to the browser to answer your specific question.

Eventually the user answers your question and submits this (second) form.
Now the server application is fired up again, rereads the session data, and
continues with PostProcess as you like.

Everything clear?


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



Re: [PHP] manage Form data

2002-11-20 Thread JohnMeyer
At 03:52 PM 11/20/2002 +0200, ???  ?ta? wrote:

I want to sumbit data from a form and then view the data and then send it 
to the data base...



Okay, send it to an intermediate page which has a form with hidden values 
representing all of the data, show the data on the page, and then have the 
users click submit to approve.




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



Re: [PHP] manage Form data

2002-11-20 Thread ??????? ?????ta?
Can you show me an example? I already tried that but it doesn't work...
- Original Message -
From: JohnMeyer [EMAIL PROTECTED]
To: ??? ?ta? [EMAIL PROTECTED];
[EMAIL PROTECTED]
Sent: Wednesday, November 20, 2002 3:55 PM
Subject: Re: [PHP] manage Form data


 At 03:52 PM 11/20/2002 +0200, ???  ?ta? wrote:
 I want to sumbit data from a form and then view the data and then send it
 to the data base...



 Okay, send it to an intermediate page which has a form with hidden values
 representing all of the data, show the data on the page, and then have the
 users click submit to approve.






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




Re: [PHP] manage Form data

2002-11-20 Thread Jason Wong
On Wednesday 20 November 2002 22:06, ??? ?ta? wrote:
 Can you show me an example? I already tried that but it doesn't work...

For an example, try the simple tutorial available on the PHP website.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
This sentence no verb.
*/


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




[PHP] Unlink

2002-11-20 Thread JohnMeyer
Does unlink work with wildcards e.g unlink(somefile*.*);



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




Re: [PHP] Re: Listing a table /Limit

2002-11-20 Thread Jason Wong
On Wednesday 20 November 2002 22:12, Matt Schroebel wrote:
 I was thinking you'd start at the beginning, displaying row 0 through
 row 19, and then have a next link, that will show rows 20 through 39,
 and so on.

Read the question again :) That's not what the OP wants.

  And how would I find out which portion (row number) the row
  would be in,
  that I would like to see in a listing?

The only way I can think of to achieve this is to read all your rows into an 
array and process it from there. I'm not sure whether it's possible in SQL -- 
but then again if you was looking for an SQL solution you would have posted 
to the php-db list!

  Q
  Hello, how would I go about listing a portion of a MySQL
  table, without an
  overall selection criterium? I have a unique index field, but
  it's a string
  and not autoincremented (but manually and with gaps). I just
  want to go to
  one particular row (query on that index field) and then list,
  say, 20 rows
  before that point and 20 rows after it. So I can create an
  output of 41
  rows in a HTML table. Is there something like the dBase SKIP and GOTO
  command? Should I do a query for each individual row (and get
  41 result
  sets) or can I somehow walk through 1 result set ?
  /Q

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Laundry is the fifth dimension!!  ... um ... um ... th' washing machine
is a black hole and the pink socks are bus drivers who just fell in!!
*/


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




[PHP] pass file data through forms

2002-11-20 Thread ??????? ?????ta?
Is there any way of submitting a file , pass all the data for it throuhg
another form and upload from another form?



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




Re: [PHP] New generation of PHP Program, reaction to ASP.NET

2002-11-20 Thread shi ziye
Are you interested in this?!
New generation of PHP Program, reaction to ASP.NET


WOOP (Web Object Of Php)
Have you write PHP program like this ?

// begin
class TForm extends System_UI_Form
{
function init()
{
$this-label1 =  new System_UI_Label(label1, $this);
$this-button1 =  new System_UI_Button(button1, $this);
$this-button2 =  new System_UI_Button(button2, $this);

$this-label1-caption = 23;

$this-button1-caption = number+1;
$this-button1-onclick = button1click;

$this-button2-caption = number-1;
$this-button2-onclick = button2click;
}

function button1click()
{
$this-label1-caption++;
}


function button2click()
{
$this-label1-caption--;
}
}

$form1 =  new TForm(form1);
$form1-init();

//end

to see the result of this program
Goto http://www.shiziye.net/woop

I need your help to finish this system together!!!



_
Ãâ·ÑÏÂÔØ MSN Explorer:  http://explorer.msn.com/lccn/


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




[PHP] Stripping HTML tags, but keeping entities...

2002-11-20 Thread David Russell
Hi all

I have a text field that users can enter any information into (it is
supposed to be a description field)

For obvious reasons, I want to strip unfriendly HTML/PHP tags. This I am
doing using:

strip_tags($_POST['Duplicate'], 'B I P A LI OL UL EM
BR TT STRONG BLOCKQUOTE DIV ECODE ');

OK, so this is cool. I got this list from the Slashdot allowed tags
list, which I would assume is ok. Now I get someone sending me
information such as:
In fact the value of the destination is  the source.

Strip_tags removes all info after the  sign. Obviously I would like to
convert it to a gt; entity, but how can I do both of these?

Thanks for any advice.

David Russell
IT Support Manager
Barloworld Optimus (Pty) Ltd
Tel: +2711 444-7250 
Fax: +2711 444-7256
e-mail: [EMAIL PROTECTED]
web: www.BarloworldOptimus.com



smime.p7s
Description: application/pkcs7-signature


RE: [PHP] New generation of PHP Program, reaction to ASP.NET

2002-11-20 Thread Jon Haworth
Hi,

 Are you interested in this?!
 New generation of PHP Program, reaction to ASP.NET

I saw it when you posted it yesterday and tried it out, but it didn't work
for me. I imagine this is because I've disabled Javascript.

Cheers
Jon

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




Re: [PHP] Pause for user input?

2002-11-20 Thread Chris Shiflett
No.

However, I'm sure whatever you are trying to do can be designed as
two pages to yield the exact same user experience.

Chris

--- Larry Brown [EMAIL PROTECTED] wrote:
 Does anyone know of a method to pause during the processing of a
 script to prompt a user for information and then incorporate the
 user's response for the remainder of the script?

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




Re: [PHP] catching a robot or spider

2002-11-20 Thread Tom Woody
User agent isn't very useful.  Most web spiders can be set to
return what ever user agent needed.  You are depending on the
writers/users of the spiders to follow commonly acceptable practices ie
looking for robots.txt and the like.



On Tue, 19 Nov 2002 14:54:49 +0100
Wilbert Enserink [EMAIL PROTECTED] wrote:

 Hi all,
 
 
 does anybody know a way to make a distinction between robots and
 users? should I use the user agent? Or is this not a safe method.
 If the visitor is a spider/robot I want to include some script
 containing extra URL's for the robot.
 
 regards Wilbert
 
 
 -
 Pas de Deux
 Van Mierisstraat 25
 2526 NM Den Haag
 tel 070 4450855
 fax 070 4450852
 http://www.pdd.nl
 [EMAIL PROTECTED]
 -


-- 
Tom Woody
Systems Administrator
NationWide Flood Research, Inc.
phone: 214-631-0400 x209
  fax: 214-631-0800

Don't throw your computer out the window, 
throw the Windows out of your computer! 


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




Re: [PHP] manual trans-sid?

2002-11-20 Thread Chris Shiflett
If you are creating a socket application, then *you* control when you
send output to the browser.

So, essentially what you are asking is how to replace the values of
the href attributes in some HTML with a modified value that includes
a session ID. I would recommend a combination of a regular expression
to  correctly obtain the value of each href, parse_url() to correctly
parse the URL into its parts, and some basic string concatenation to
build the new URL.

You might also want to look at the nanoweb project
(http://nanoweb.si.kz/). It is a Web server written in PHP.

Chris

--- Thomas Weber [EMAIL PROTECTED] wrote:
 does anyone know a way to rewrite url's with the session-tag in a
 string, without sending the output to a browser? I'm writing some
 sort of webserver in php wich should, of course, send rewrited urls
 to its clients via sockets.

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




Re: [PHP] flush() issue

2002-11-20 Thread @ Edwin
Hello,

Andrew Brampton [EMAIL PROTECTED] wrote:

 Are you outputing each row in a table?
 IE won't start displaying the table until the /table tag, that might be
 causing your problem...

...then, CSS to the rescue... :)

Try this:

  table style=table-layout:fixed
...
  /table

HTH,

- E

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




Re: [PHP] manage Form data

2002-11-20 Thread @ Edwin
Hello,

??? ?ta? [EMAIL PROTECTED] wrote:

 Can you show me an example? I already tried that but it doesn't work...

Please don't get me wrong but...

Saying that it doesn't work... doesn't work either. You have to at least
help others to help you. Show some codes, error messages, etc. And try to be
more specific on what/where doesn't work...

- E

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




Re: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
Eddie,
I use the attached on a site of mine... works with JavaScript and DIV tags.

There are 2 parts to the file - the javascript, and then the HTML code to 
make it happen.  Tweak according to your needs.

Peter


At 11:00 AM 11/20/2002 -0500, you wrote:
I have a large amount of data to present to the user.  Currently, I am just
putting it in a table and displaying it on the page, if it is more than a
page of course the page just scrolls.  Is there a way o, without using
frames, to put all the data from the db in the middle of the page with a
scroll bar on the side that just scrolls the data, I mean the header and
footer of the php page do not move?  I am sure I will need javascript for
this...right?

Thanks,
Eddie


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


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -

!-- TWO STEPS TO INSTALL LAYER SCROLLER:

  1.  Insert the first code in a new file, save as popup.html
  2.  Add the opening code to the BODY of your main HTML document  --

!-- STEP ONE: Insert the first code in a new file, save as popup.html  --

HTML
HEAD

SCRIPT LANGUAGE=JavaScript
!-- Begin

//verScroll('up','1','true')

function verScroll(dir, spd, loop) {
loop = true;
direction = up;
speed = 10;
scrolltimer = null;
if (document.layers) {
var page = eval(document.contentLayer);
}
else {
if (document.getElementById) {
var page= eval(document.getElementById('contentLayer').style);
}
else {
if (document.all) {
var page = eval(document.all.contentLayer.style);
  }
   }
}
direction = dir;
speed = parseInt(spd);
var y_pos = parseInt(page.top);
if (loop == true) {
if (direction == dn) {
page.top = (y_pos - (speed));
} else {
if (direction == up  y_pos  10) {
page.top = (y_pos + (speed));
} else {
if (direction == top) {
page.top = 10;
  }
   }
}
scrolltimer = setTimeout(verScroll(direction,speed), 1);
   }
}
function stopScroll() {
loop = false;
clearTimeout(scrolltimer);
}
//  End --
/script
/head
body
div id=contentLayer style=position:absolute; width:300px; z-index:1; left: 39px; 
top: 51px 


insert your text here !!



/div
div id=scrollmenu style=position:absolute;width:200px;height:30px;z-index:1; 
left:400px; top: 40px
table border=1trtd
table
tr
td align=leftUp/td
td /td
td align=rightDown/td
/tr
tr
td colspan=3
a href=# onMouseOver=verScroll('up','25','true') 
onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('up','5','true') onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('up','1','true') onMouseOut=stopScroll()/a |
a href=# onMouseOver=verScroll('dn','1','true') onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('dn','5','true') onMouseOut=stopScroll()/a 
a href=# onMouseOver=verScroll('dn','25','true') onMouseOut=stopScroll()/a
/td
/tr
/table
/td/tr/table
/div
/body
/html







!-- STEP TWO: Add the opening code to the BODY of your main HTML document  --

BODY

center
form name=scrollwindow
input type=button value=Open Scroll Window 
onClick=window.open('popup.html','scrollwindow','top=100,left=100,width=575,height=400');
/form
/center

pcenter
font face=arial, helvetica SIZE=-2Free JavaScripts providedbr
by a href=http://javascriptsource.com;The JavaScript Source/a/font
/centerp

!-- Script Size:  7.99 KB --

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


Re: [PHP] scrolling data from db

2002-11-20 Thread @ Edwin
Hello,

Edward Peloke [EMAIL PROTECTED] wrote:

 I have a large amount of data to present to the user.  Currently, I am
just
 putting it in a table and displaying it on the page, if it is more than a
 page of course the page just scrolls.  Is there a way o, without using
 frames, to put all the data from the db in the middle of the page with a
 scroll bar on the side that just scrolls the data, I mean the header and
 footer of the php page do not move?  I am sure I will need javascript for
 this...right?

Not really...

Of course, you can use javascript. (I think somebody just posted--er, kindly
posted--a sample code...)

You can also use CSS to make the header, etc. be fixed on different
location of your browser window. However, this approach works only on
browsers that support that css. (e.g. Mozilla-based browsers like N7, etc.
or Opera 6...)

How about another approach using iframes? (Personally, I don't like frames
or iframes...) It might work for you.

But then again, the best way IMHO, is to divide your table into different
sections or pages. Do you really need to keep them in one page?

Just some ideas...

- E

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




Re: [PHP] Unlink

2002-11-20 Thread Mark Charette
On Wed, 20 Nov 2002, JohnMeyer wrote:

 Does unlink work with wildcards e.g unlink(somefile*.*);

No.

unlink() is a thin veneer on the system unlink() call.

Wildcard expansion like you have it is done by a shell glob function. You
would need to replicate what the shell does - use it as a regular
expression in an opendir()/readdir()/delete file on regexp
match/closedir() set of operations.

Or, preferably, look up the glob() function in PHP and use the return 
values in an unlink() call. Much better than spawning a shell process  
;^)

--
... but while you're marching in the rain, doesn't the *bell* on the sax
fill with water? - jerry
Yes, Jerry ... the bell would fill with water. (un)Fortunately, this does
not affect the way a sax sounds. - Fred (postings on the Clarinet BBoard)


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




Re: [PHP] Server-server file copy question

2002-11-20 Thread Ernest E Vogelsinger
At 17:55 20.11.2002, Richard Fox spoke out and said:
[snip]
Hi,

I am using PHP 4.4.2.. I need a function to copy a file from one server to
another. The src/dst filenames are relative to the Document Root of the 
website, but
I can build an absolute path name if necessary. I can't use ftp because the
ftp ports are closed on these servers. I would like to use http or ssh for
the file transfer. The application is that multiple files can be copied from
website to website on our various servers. I have been looking around at
mailing lists, etc but haven't found a function described which does a
non-ftp inter-IP file copy, only client/server file uploads and ftp
functions.

TIA,
Rich
[snip] 

I'd try to use scp in conjunction with a SSH certificate (to avoid a
password prompt)


-- 
   O Ernest E. Vogelsinger 
   (\) ICQ #13394035 
^ http://www.vogelsinger.at/



[PHP] DBF files

2002-11-20 Thread Tony Burgess
Hi everyone,

Can anyone tell me if and how to access DBF tables using PHP on UNIX.
Ideally i want to display data from the tables, but also update the tables
and index's etc.
all through a web interface.

Thank you for any help.

--
Tony Burgess



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




Re: [PHP] Re: PHP Application Framework

2002-11-20 Thread Ryan Gallagher
Quoting Alexandru COSTIN [EMAIL PROTECTED]:

 Hello,
 You could check Krysalis, http://www.interakt.ro/products/Krysalis/
 
 It's GPL, and it has a lot of powerful features included, as it's based on 
 XML and XSL.
 
 Alexandru
  Hi all,
  
  
  Does anyone have a recommendation for a stable yet flexible application
  framework for PHP?
  
  Something similar to Midgard that will run on Windows would be nice.
  
  Thanks!

If you mean PHP Application Framework (and not IDE). 
The Horde Project http://www.horde.org 

(some of the modules require linux servers, but the framework itself is very
robust and should be cross-platform, we use many of the project modules and some
of our own in a production enviornment).

-- 
Ryan T. Gallagher
[EMAIL PROTECTED]
International Studies Abroad
http://www.studiesabroad.com
(512)480-8522



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




RE: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread John W. Holmes
 I have code that says:
 
 if($_GET['sc'] != '2' OR '8'){
 do this.
 }

if($_GET['sc'] != 2 || $_GET['sc'] != 8)
{ do this... }

You don't need the single quotes if you're comparing integers. 

---John Holmes...



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




Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread Ryan Gallagher
Quoting Jami [EMAIL PROTECTED]:

 I have code that says:
 
 if($_GET['sc'] != '2' OR '8'){
 do this.
 }
 
 but I doesn't work. What do I need to do to get it to work? I have checked
 operator precendence and all that and am still confused on whether I should
 be using '||' or 'OR' or something else... I have tried both of those, as
 well as 'XOR' and '^'. Help please!
 
 Jami

Try:

if( ( $_GET['sc'] != 2 ) OR ( $_GET['sc'] != 8 ) ){
  /* 
   * Do Foo provided sc is anything but a 2 or 8 
   */
  do foo; 
}

Assuming of course that you meant to exclude cases of 2 or 8.  It's a bit hard
to tell what your intended event for 8 is.

-- 
Ryan T. Gallagher
[EMAIL PROTECTED]
International Studies Abroad
http://www.studiesabroad.com
(512)480-8522



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




[PHP] Still having ereg migranes

2002-11-20 Thread Mako Shark
Sorry to repost this, but I haven't found a solution
and it's still nagging me. Maybe some of you can come
up with something I can't. Here was my original post:

I've made myself an INPUT TYPE=HIDDEN tag that
contains in the value attribute a list of
comma-delimited numbers. I need to find if a certain
number is in these tags (and each file contains one
tag). I need an ereg statement that will let me search
these lines to see if a number exists, obviously in
the beginning or the end or the middle or if it's the
only number in the list. So, say I need #1, I need to
grep each file to find if 1 is in its INPUT
TYPE=HIDDEN list. Here's what I mean (searching for
number 1):

INPUT TYPE = HIDDEN NAME = numbers VALUE =
1,2,3,4,5   //beginning

INPUT TYPE = HIDDEN NAME = numbers VALUE =
0,1,2,3,4,5   //middle

INPUT TYPE = HIDDEN NAME = numbers VALUE =
5,4,3,2,1   //end

INPUT TYPE = HIDDEN NAME = numbers VALUE = 1 
//only

I can't grab all the tags and search for it in PHP
(there would be too many tags to parse through and I'd
rather let the OS handle that). I need to do this at
the operating system level. Does anybody yet have a
solution? I *know* it's possible, but I can't get it
and I've been working on it for days now. This is one
of those really annoying bugs that really grates on a programmer.

__
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

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




Re: [PHP] Re: cURL with PHP Help?

2002-11-20 Thread Steve Keller
At 11/20/2002 08:46 AM, you wrote:

Have you tried this:
http://curl.haxx.se/libcurl/php/examples/

Yeah. That's where you end up from the Sourcefourge site. There's a sample on there 
for a multi-part post, but I'm confused as to how it works.

Would help if you posted some code, or errors or something. I've used curl
in several PHP applications successfully.

I'm not getting any errors. And, as I said, I'm just not getting cURL, so as far as 
code, I've been monkeying with just about every example I  could find. But again, I'm 
not asking for debugging of my code, I'm just trying to find something to help me 
understand how the cURL functions in PHP work. 

Snoopy is actually a really awesome implementation of curl in php:
http://sourceforge.net/projects/snoopy/

I replaced several of my functions with snoopy classes.

Thanks. I'll definitely take a look at that. 


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




Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread Jonathan Wright
Hiya,

On Wed, Nov 20, 2002 at 11:24:11AM -0600, Jami wrote:
 I have code that says:
 
 if($_GET['sc'] != '2' OR '8'){
 do this.
 }
 
 but I doesn't work. What do I need to do to get it to work? I have checked
 operator precendence and all that and am still confused on whether I should
 be using '||' or 'OR' or something else... I have tried both of those, as
 well as 'XOR' and '^'. Help please!

It won't work 'cause you're asking two different questions:

 1. if $_GET['sc'] != 2, and
 2. 8

Operators can only work on two operands, i.e. one either side, so you if
you want to ask any more questions, like above, you have to split them
each into their own question:

  if ($_GET['sc'] != '2' || $_GET['sc'] != 8) {

It also works the same when looking for a range like '2  $x  6', it has
to be two questions - '2  $x  $x  6'.

Hope that helps! :)

-- 
Jonathan Wright..
// [EMAIL PROTECTED]
// www.djnauk.co.uk
--
// life has no meaning unless we can enjoy what we've been given

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




Re: [PHP] Problem whith query in query

2002-11-20 Thread Ryan Gallagher
Quoting Ernest E Vogelsinger [EMAIL PROTECTED]:

 At 18:29 20.11.2002, Ryan Gallagher said:
 [snip]
 SELECT * FROM identifisering as i
 WHERE i.identifiseringid = (
 SELECT MAX(ii.identifiseringid) AS maxIdentifiseringid
 FROM identifisering as ii
   )
 GROUP BY dprosjekt
 
 Now that I look at it, your GROUP BY was definitely out of place, since
 dprosjekt no doubt is a col being returned from the SELECT * of the main
 query.
 [snip] 
 
 No, it wasn't.
 You need the GROUP BY in the subquery to retrieve the max(id) for any
 distinct dprosjekt. If you have it like you did the subquery would simply
 return a single result, the max(id) of all records. Your version simply
 functions as an order by which is useless here since only a single record
 will be returned.

Sorry, that's what I was trying to decipher... The '=' combined with the use of
MAX led me to believe the desired recordset size was ONE in the sub query.


-- 
Ryan T. Gallagher
[EMAIL PROTECTED]
International Studies Abroad
http://www.studiesabroad.com
(512)480-8522



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




Re: [PHP] Still having ereg migranes

2002-11-20 Thread Marek Kilimajer
first way:
if(ereg('([^0-9]|^)'.$your_number.'([^0-9]|$)',$_REQUEST['numbers']) )
second way:
$numbers=explode(',',$_REQUEST['numbers']);
if(in_array($your_number,$numbers))

Mako Shark wrote:


Sorry to repost this, but I haven't found a solution
and it's still nagging me. Maybe some of you can come
up with something I can't. Here was my original post:

I've made myself an INPUT TYPE=HIDDEN tag that
contains in the value attribute a list of
comma-delimited numbers. I need to find if a certain
number is in these tags (and each file contains one
tag). I need an ereg statement that will let me search
these lines to see if a number exists, obviously in
the beginning or the end or the middle or if it's the
only number in the list. So, say I need #1, I need to
grep each file to find if 1 is in its INPUT
TYPE=HIDDEN list. Here's what I mean (searching for
number 1):

INPUT TYPE = HIDDEN NAME = numbers VALUE =
1,2,3,4,5   //beginning

INPUT TYPE = HIDDEN NAME = numbers VALUE =
0,1,2,3,4,5   //middle

INPUT TYPE = HIDDEN NAME = numbers VALUE =
5,4,3,2,1   //end

INPUT TYPE = HIDDEN NAME = numbers VALUE = 1 
//only

I can't grab all the tags and search for it in PHP
(there would be too many tags to parse through and I'd
rather let the OS handle that). I need to do this at
the operating system level. Does anybody yet have a
solution? I *know* it's possible, but I can't get it
and I've been working on it for days now. This is one
of those really annoying bugs that really grates on a programmer.

__
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

 



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




RE: [PHP] Still having ereg migranes

2002-11-20 Thread John W. Holmes
 Sorry to repost this, but I haven't found a solution
 and it's still nagging me. Maybe some of you can come
 up with something I can't. Here was my original post:
 
 I've made myself an INPUT TYPE=HIDDEN tag that
 contains in the value attribute a list of
 comma-delimited numbers. I need to find if a certain
 number is in these tags (and each file contains one
 tag). I need an ereg statement that will let me search
 these lines to see if a number exists, obviously in
 the beginning or the end or the middle or if it's the
 only number in the list. So, say I need #1, I need to
 grep each file to find if 1 is in its INPUT
 TYPE=HIDDEN list. Here's what I mean (searching for
 number 1):
 
 INPUT TYPE = HIDDEN NAME = numbers VALUE =
 1,2,3,4,5   //beginning
 
 INPUT TYPE = HIDDEN NAME = numbers VALUE =
 0,1,2,3,4,5   //middle
 
 INPUT TYPE = HIDDEN NAME = numbers VALUE =
 5,4,3,2,1   //end
 
 INPUT TYPE = HIDDEN NAME = numbers VALUE = 1
 //only
 
 I can't grab all the tags and search for it in PHP
 (there would be too many tags to parse through and I'd
 rather let the OS handle that). I need to do this at
 the operating system level. Does anybody yet have a
 solution? I *know* it's possible, but I can't get it
 and I've been working on it for days now. This is one
 of those really annoying bugs that really grates on a programmer.

Well, one way without regex would be to explode() numbers on a comma and
use in_array() to see if you're value exists.

$ar = explode(',',$_GET['numbers']);
if(in_array($search_number,$ar))
{ //number is present; }
else
{ //number is not present; }

With regex, maybe something like this?

if(preg_match('/^|,'.$search_number.',|$/',$_GET['numbers']))
{ //number is present; }
else
{ //number is not present; }

That should look for your number, preceded by either the beginning of
the string or a comma and followed by either a comma or the end of the
string. 

Let me know if that works. 

---John Holmes...



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




Re: [PHP] THANK YOU! - How to: If($var != '#' OR '#')

2002-11-20 Thread Jami
Thanks all for the prompt responses. In case someone else searchs on the
list, the following code worked:

if($_GET['sc'] != '2' AND $_GET['sc'] !='8'){
do this.
 }

Thanks Jason, Jonathan W., John H, Ryan G., and Tony B.!


- Original Message -
From: Jami [EMAIL PROTECTED]
To: PHP General [EMAIL PROTECTED]
Sent: Wednesday, November 20, 2002 11:24 AM
Subject: [PHP] How to: If($var != '#' OR '#')


 I have code that says:

 if($_GET['sc'] != '2' OR '8'){
 do this.
 }

 but I doesn't work. What do I need to do to get it to work? I have checked
 operator precendence and all that and am still confused on whether I
should
 be using '||' or 'OR' or something else... I have tried both of those, as
 well as 'XOR' and '^'. Help please!

 Jami



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







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




[PHP] interpreting variables containing in another variable

2002-11-20 Thread ROBERT MCPEAK
I've got a variable - $email_body, that contain's other variables.  For example, echo 
$email_body, might look like this:

$name, $address, $phone, $blah


I want those variables to interpreted with corresponding values set earlier in the 
script.  So, in effect, where name=bob, address=101 east main, phone=555-, and 
blah=foo, echo $email_body would look like this:

bob, 101 east main, 555-, foo


Any suggestions?

Thanks in advance.

-Bob


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




Re: [PHP] interpreting variables containing in another variable

2002-11-20 Thread Adam Voigt
Not sure what your saying, but like:

$email_body = $name . ,  . $address . ,  . $phone . ,  . $blah;

?

On Wed, 2002-11-20 at 13:15, ROBERT MCPEAK wrote:
 I've got a variable - $email_body, that contain's other variables.  For example, 
echo $email_body, might look like this:
 
 $name, $address, $phone, $blah
 
 
 I want those variables to interpreted with corresponding values set earlier in the 
script.  So, in effect, where name=bob, address=101 east main, phone=555-, and 
blah=foo, echo $email_body would look like this:
 
 bob, 101 east main, 555-, foo
 
 
 Any suggestions?
 
 Thanks in advance.
 
 -Bob
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
Adam Voigt ([EMAIL PROTECTED])
The Cryptocomm Group
My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc



signature.asc
Description: This is a digitally signed message part


Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread Jason Wong
On Thursday 21 November 2002 01:34, Ryan Gallagher wrote:

 Try:

 if( ( $_GET['sc'] != 2 ) OR ( $_GET['sc'] != 8 ) ){
   /*
* Do Foo provided sc is anything but a 2 or 8
*/
   do foo;
 }

 Assuming of course that you meant to exclude cases of 2 or 8.  It's a bit
 hard to tell what your intended event for 8 is.

The above would not have the intended effect. My boolean maths is extremely 
rusty but I think it is equivalent to saying:

  if (!($_GET['sc'] == 2  AND  $_GET['sc'] == 8))

Which means your code above is *always* TRUE, so do foo is always executed!

In any case you can easily test it by mentally plugging in values 1 to 8 for 
$_GET['sc'] and evaluating it for yourself.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
History repeats itself.  That's one thing wrong with history.
*/


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




RE: [PHP] Still having ereg migranes

2002-11-20 Thread Mako Shark
first way:
if(ereg('([^0-9]|^)'.$your_number.'([^0-9]|$)',$_REQUEST['numbers'])
) second way:
$numbers=explode(',',$_REQUEST['numbers']);
if(in_array($your_number,$numbers))

Not sure I get this but, again, I can't use $_REQUEST
or explode or in_array at this point. The entire
process needs to happen in the shell_exec() command,
because I'd much rather have that handle the whole
shebang than PHP.

__
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

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




RE: [PHP] Pause for user input?

2002-11-20 Thread Larry Brown
The idea is to have the script start to load, prompt for a question or more,
then use the data from the response to complete loading the page and avoid
having to post all of the variables from page to page to get all of the
responses back.  A lot of the questions are formed based on the answers to
previous questions so I'm trying to keep the number of separate pages to a
minimum by using such a technique.  I understand that Java can provide this
function, but I want to do as much with PHP and as little as possible with
Java.

Larry S. Brown MCSE
President/CEO
Dimension Networks, Inc.
Member ICCA
(727) 723-8388

-Original Message-
From: @ Edwin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 11:29 AM
To: Larry Brown
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Pause for user input?

Hello,

Larry Brown [EMAIL PROTECTED] wrote:

 Does anyone know of a method to pause during the processing of a script to
 prompt a user for information and then incorporate the user's response for
 the remainder of the script?

... in addition to what the others already said, let me just ask a couple of
questions:

1. Do you really need to pause? What did you exactly mean by pause?
2. Is it even necessary to pause?

Just wondering...

- E



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




[PHP] web server and permissions

2002-11-20 Thread Dennis Gearon
Please B/CC me, thank you.

I am on a site that has all the files in both the /home/sitename/www/ directory and a 
directory 
we'll call /home/directory/includes/ with the following permisssions:

 rwxr-x--r

The group I have in /etc/group does not have anyone in it, including me.

The server reads everything fine and the php engine can include fine from the 
/home/sitename/includes/ directory.

The problem is, everyone else on the site can read the includes directory as well, 
including my 
database password file which get's included.

What I would like to set up is:

[1] the apache/php engine can include from the
includes directory, but not just spit it out.
I think that is taken care of by the
.htaccess file already.

[2] the apache/php process is in my group,
and everything I want to go out has
the group permissions set to rwx--r---
(do php/html/inc files also have to be
 executable to be serverd?)

[3] 'everyone' does not have the ability to read
my files on myserver. 

Is this the way to do it? What is the normal way permission are set up for 
users/apache/groups/everyone?



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




Re: [PHP] interpreting variables containing in another variable

2002-11-20 Thread Chris Shiflett
--- ROBERT MCPEAK [EMAIL PROTECTED] wrote:
 I've got a variable - $email_body, that contain's other variables. 
 For example, echo $email_body, might look like this:
 
 $name, $address, $phone, $blah
 
 I want those variables to interpreted with corresponding values set
 earlier in the script.  So, in effect, where name=bob, address=101
 east main, phone=555-, and blah=foo, echo $email_body would
 look like this:
 
 bob, 101 east main, 555-, foo

Check out the eval() function:

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

Also, you might want to consider altering your approach slightly. For
example, maybe something like this would be more appropriate:

$email_body = $name, $address, $phone, $blah;

If you echo $email_body in this case, it will output:

bob, 101 east main, 555-, foo

Good luck.

Chris

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




Re: [PHP] interpreting variables containing in anothervariable

2002-11-20 Thread ROBERT MCPEAK
Duh!!! Thanks!  Being a newbie hurts sometimes.

 Chris Shiflett [EMAIL PROTECTED] 11/20/02 01:50PM 
--- ROBERT MCPEAK [EMAIL PROTECTED] wrote:
 I've got a variable - $email_body, that contain's other variables. 
 For example, echo $email_body, might look like this:
 
 $name, $address, $phone, $blah
 
 I want those variables to interpreted with corresponding values set
 earlier in the script.  So, in effect, where name=bob, address=101
 east main, phone=555-, and blah=foo, echo $email_body would
 look like this:
 
 bob, 101 east main, 555-, foo

Check out the eval() function:

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

Also, you might want to consider altering your approach slightly. For
example, maybe something like this would be more appropriate:

$email_body = $name, $address, $phone, $blah;

If you echo $email_body in this case, it will output:

bob, 101 east main, 555-, foo

Good luck.

Chris

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



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




[PHP] failded to connect with imap

2002-11-20 Thread Jochen Kächelin
Warning: imap_open(): Couldn't open stream {192.168.0.1:143}INBOX in /www/imap.php on 
line 4
can't connect: Certificate failure for 192.168.0.1:
self signed certificate: 
/C=--/ST=SomeState/L=SomeCity/O=SomeOrganization/OU=SomeOrganizationalUnit
[EMAIL PROTECTED]


Any suggestions?

-- 
Jochen Kaechelin


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




Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread Chris Shiflett
--- Jason Wong [EMAIL PROTECTED] wrote:
 On Thursday 21 November 2002 01:34, Ryan Gallagher wrote:
  if( ( $_GET['sc'] != 2 ) OR ( $_GET['sc'] != 8 ) ){
/*
 * Do Foo provided sc is anything but a 2 or 8
 */
do foo;
  }
 
  Assuming of course that you meant to exclude cases of 2 or 8. 
 
 The above would not have the intended effect. My boolean maths is
 extremely rusty but I think it is equivalent to saying:
 
   if (!($_GET['sc'] == 2  AND  $_GET['sc'] == 8))
 
 Which means your code above is *always* TRUE, so do foo is always
 executed!

Your boolean math may be rusty, but you are correct. :-) I think,
however, that he was simply focusing on a literal interpretation of
the original poster's code without considering if it made sense.

If you want to exclude 2 *and* exclude 8 (saying things aloud can
sometimes reveal obvious logic problems), just write it like this:

if($_GET[sc] != 2  $_GET[sc] != 8)
{
   ...
}

Chris

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




RE: [PHP] copying tables

2002-11-20 Thread Edward Peloke
I apologize, I meant to add a new message, not respond to the copy tables
message.

-Original Message-
From: Edward Peloke [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 2:30 PM
To: PHP
Subject: RE: [PHP] copying tables


Is anyone using php and iframes?  I have a php script

 ?
  $clientreqid2=$clientreqid;
  $bidhist2=$bidhist;


  echo iframe width=95% height=90%
src=\auction.php?clientreqid=$clientreqid2bidhist=$bidhist2\
frameborder=0  /iframe;


?

The script within the frame, auction.php, has buttons that when clicked
sends parameters back to this iframe script which calls the auction.php
script again with the new parameters.  Everything works fine, the only
problem is as I click the buttons, each time the frame gets smaller and
smaller.

Any suggestions?

Thanks,
Eddie


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



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




Re: [PHP] Graph Question..

2002-11-20 Thread Jonathan Sharp
Please post code.

-js


James Hatridge wrote:
 Hi all,,
 
 I d/l'ed a class for graphs last night. When I got the class working instead 
 of a line graph I got the netscape symbol for no picture, ie a broken box. I 
 must have missed something. Could someone give me a clue what I'm doing 
 wrong?
 
 Thanks
 
 JIM




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




Re: [PHP] Pause for user input?

2002-11-20 Thread @ Edwin

Larry Brown [EMAIL PROTECTED] wrote:

 The idea is to have the script start to load, prompt for a question or
more,
 then use the data from the response to complete loading the page and avoid
 having to post all of the variables from page to page to get all of the
 responses back.  A lot of the questions are formed based on the answers to
 previous questions so I'm trying to keep the number of separate pages to a
 minimum by using such a technique.  I understand that Java can provide
this
 function, but I want to do as much with PHP and as little as possible with
 Java.

I think you're referring to JavaScript and NOT Java.

But, whether it's Java or Javascript, you cannot really pause/stop the
browser then do something to complete loading the page. (Unless you press
stop--but this would require you to reload.)

Anyway, Javascript (if you're referring to it) doesn't have that kind of
function (AFAIK). Javascript can hide/unhide element on your form. It can
also enable/disable a checkbox, for example. But those functions would only
work AFTER the page is already loaded--and _not_ while it is loading. (Also,
*after* the Javascript file--if you're using and external one--is already
downloaded inside the your visitors' disk, etc.)

- E

PS
BTW, Javascript (support) can be turned off by your visitors--maybe you
already know that...

And... not all browsers supports Java. (But then again, you don't even need
a browser to run Java! What am I saying here?...)

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




RE: [PHP] Pause for user input?

2002-11-20 Thread Larry Brown
I understand that the Javascript will not pause the page from loading;
however, it should, like you stated, modify the page and hence change what
the client is seeing interactively which could include hiding/revealing
different questions based on their input.  This should ultimately present a
form with answers to those customized questions without traversing a number
of pages.  I only asked the question hoping there was a method of
accomplishing this that I wasn't aware of in PHP.  It is understandable that
it would not be possible server-side, but I figured I would check with the
gurus.

Thanks,

Larry S. Brown
Dimension Networks, Inc.
(727) 723-8388

-Original Message-
From: @ Edwin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 2:39 PM
To: Larry Brown
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Pause for user input?


Larry Brown [EMAIL PROTECTED] wrote:

 The idea is to have the script start to load, prompt for a question or
more,
 then use the data from the response to complete loading the page and avoid
 having to post all of the variables from page to page to get all of the
 responses back.  A lot of the questions are formed based on the answers to
 previous questions so I'm trying to keep the number of separate pages to a
 minimum by using such a technique.  I understand that Java can provide
this
 function, but I want to do as much with PHP and as little as possible with
 Java.

I think you're referring to JavaScript and NOT Java.

But, whether it's Java or Javascript, you cannot really pause/stop the
browser then do something to complete loading the page. (Unless you press
stop--but this would require you to reload.)

Anyway, Javascript (if you're referring to it) doesn't have that kind of
function (AFAIK). Javascript can hide/unhide element on your form. It can
also enable/disable a checkbox, for example. But those functions would only
work AFTER the page is already loaded--and _not_ while it is loading. (Also,
*after* the Javascript file--if you're using and external one--is already
downloaded inside the your visitors' disk, etc.)

- E

PS
BTW, Javascript (support) can be turned off by your visitors--maybe you
already know that...

And... not all browsers supports Java. (But then again, you don't even need
a browser to run Java! What am I saying here?...)

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



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




[PHP] Parsing an array from a posted form

2002-11-20 Thread Verdon Vaillancourt
Hi All :)

I have a form that is being passed to a mail function when submitted. It is
working OK, except that I am having trouble with values from arrays such as
checkbox lists. For example, I have a list such as:

input type=checkbox name=graphicFormat[] value=eps / .eps
input type=checkbox name=graphicFormat[] value=jpg / .jpg
input type=checkbox name=graphicFormat[] value=tif / .tif
input type=checkbox name=graphicFormat[] value=gif / .gif
input type=checkbox name=graphicFormat[] value=png / .png
input type=checkbox name=graphicFormat[] value=psd / .psd
input type=checkbox name=graphicFormat[] value=bmp / .bmp
input type=checkbox name=graphicFormat[] value=other / other

I am using something like:

for ($z=0;$zcount($graphicFormat);$z++) {
  $graphicFormat = stripslashes($graphicFormat[$z]);
}

Which will return a count of the number of items in the array. What I want
returned is a string of the values selected such as:

eps, gif, other

Any suggestions?

Best Regards,
verdon

Ps. Please cc me as I am on digest mode
Pps. Please excuse if my question is TOO fundamental


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




Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Jason Wong
On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote:
 Hi...
 I'm with a little sintax problem...
 The question is that i have two search fields (titulotxt and cdstxt) and i
 want to create an mysql condition... i trying:

  $sql1=($titulotxt) ? titulo like '%.$titulotxt.%':;
  $sql2=($cdstxt) ? cds like '$cdstxt':;
  $sql=SELECT * FROM divx WHERE .$sql1.$sql2  ORDER BY titulo;

 but he's giving me a sintax error on the 3 line... Can anyone
 teach me how i must do to validate the mysql condition and make it work?

Try:

 $sql=SELECT * FROM divx WHERE .$sql1..$sql2.  ORDER BY titulo;

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
He thinks by infection, catching an opinion like a cold.
*/


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




Re: [PHP] Graph Question..

2002-11-20 Thread Jim Hatridge
On Wednesday 20 November 2002 20:37, Van Andel, Robert wrote:
 More information would be helpful.  Perhaps the code to the page that is
 causing you trouble (i.e. the one where you are using the class you
 downloaded yesterday).  Perhaps you are missing a key piece there.

 Robbert van Andel

HI Robbert et al..

Below is part of the code. I don't think I should send it all to the list, 
it's quite large. Looking at all this I think that I'm missing a lib for 
graphs. But I can't find anything on my SuSE 8.1 disks. What libs do I need 
for doing graphs?

Thanks

JIM



 -Original Message-
 From: James Hatridge [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 20, 2002 7:07 AM
 To: PHP-GEN
 Subject: [PHP] Graph Question..



 Hi all,,

 I d/l'ed a class for graphs last night. When I got the class working
 instead

 of a line graph I got the netscape symbol for no picture, ie a broken box.
 I

 must have missed something. Could someone give me a clue what I'm doing
 wrong?

 Thanks

 JIM

#

?
require Color.php;
require Graph.php;
require Barchart.php;

$white = new Color(255,255,255);
$blue = new Color(0,0,255);
$red = new Color(255,0,0);
$green = new Color(0,255,0);

$line = new Barchart(500,500,$white);

$ar1 = array(12,13,16,2,5,10,0,1,2,8);
$ar2 = array(20,13,-1,2,23,11,1,3,4,9);
$ar3 = array(11,15,20,12,6,-10,28,30,10,0);

$line-addArray($ar1, $white);
$line-addArray($ar2, $green);
$line-addArray($ar3, $red);
$line-printHTML();

?


##
-- 
Vielfeind -- Viel Ehr'
Antiamerikanische Propaganda in der Philatelie des 20. Jahrhunderts
  http:/www.fecundswamp.net/~hatridge/stamps/index.html


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




[PHP] Re: Parsing an array from a posted form

2002-11-20 Thread Nick Eby
you can use the implode() function:

for ($z=0;$zcount($graphicFormat);$z++) {
   $graphicFormat = stripslashes($graphicFormat[$z]);
}

echo implode(, , $graphicFormat);



Verdon Vaillancourt [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All :)

 I have a form that is being passed to a mail function when submitted. It
is
 working OK, except that I am having trouble with values from arrays such
as
 checkbox lists. For example, I have a list such as:

 input type=checkbox name=graphicFormat[] value=eps / .eps
 input type=checkbox name=graphicFormat[] value=jpg / .jpg
 input type=checkbox name=graphicFormat[] value=tif / .tif
 input type=checkbox name=graphicFormat[] value=gif / .gif
 input type=checkbox name=graphicFormat[] value=png / .png
 input type=checkbox name=graphicFormat[] value=psd / .psd
 input type=checkbox name=graphicFormat[] value=bmp / .bmp
 input type=checkbox name=graphicFormat[] value=other / other

 I am using something like:

 for ($z=0;$zcount($graphicFormat);$z++) {
   $graphicFormat = stripslashes($graphicFormat[$z]);
 }

 Which will return a count of the number of items in the array. What I want
 returned is a string of the values selected such as:

 eps, gif, other

 Any suggestions?

 Best Regards,
 verdon

 Ps. Please cc me as I am on digest mode
 Pps. Please excuse if my question is TOO fundamental




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




Re: [PHP] Parsing an array from a posted form

2002-11-20 Thread 1LT John W. Holmes
 I have a form that is being passed to a mail function when submitted. It
is
 working OK, except that I am having trouble with values from arrays such
as
 checkbox lists. For example, I have a list such as:

 input type=checkbox name=graphicFormat[] value=eps / .eps
 input type=checkbox name=graphicFormat[] value=jpg / .jpg
 input type=checkbox name=graphicFormat[] value=tif / .tif
 input type=checkbox name=graphicFormat[] value=gif / .gif
 input type=checkbox name=graphicFormat[] value=png / .png
 input type=checkbox name=graphicFormat[] value=psd / .psd
 input type=checkbox name=graphicFormat[] value=bmp / .bmp
 input type=checkbox name=graphicFormat[] value=other / other

 I am using something like:

 for ($z=0;$zcount($graphicFormat);$z++) {
   $graphicFormat = stripslashes($graphicFormat[$z]);
 }

 Which will return a count of the number of items in the array. What I want
 returned is a string of the values selected such as:

 eps, gif, other

$string = implode(,,$graphicFormat);

To see how many checkboxes were selected, use

$num = count($graphicFormat);

---John Holmes...


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




Re: [PHP] Graph Question..

2002-11-20 Thread Andrew Brampton
Try going direct to the image's URL, this might show any PHP errors. If that
doesn't work, you can request the page via telnet and see if any errors are
appearing

Andrew
- Original Message -
From: James Hatridge [EMAIL PROTECTED]
To: PHP-GEN [EMAIL PROTECTED]
Sent: Wednesday, November 20, 2002 3:06 PM
Subject: [PHP] Graph Question..



Hi all,,

I d/l'ed a class for graphs last night. When I got the class working instead
of a line graph I got the netscape symbol for no picture, ie a broken box. I
must have missed something. Could someone give me a clue what I'm doing
wrong?

Thanks

JIM
--
Jim Hatridge
Linux User #88484
--
 BayerWulf
   Linux System # 129656
 The Recycled Beowulf Project
  Looking for throw-away or obsolete computers and parts
   to recycle into a Linux super computer


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



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




Re: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread DL Neil
 On Thursday 21 November 2002 03:53, Mr. BuNgL3 wrote:
  Hi...
  I'm with a little sintax problem...
  The question is that i have two search fields (titulotxt and cdstxt) and
i
  want to create an mysql condition... i trying:
 
   $sql1=($titulotxt) ? titulo like '%.$titulotxt.%':;
   $sql2=($cdstxt) ? cds like '$cdstxt':;
   $sql=SELECT * FROM divx WHERE .$sql1.$sql2  ORDER BY
titulo;
 
  but he's giving me a sintax error on the 3 line... Can anyone
  teach me how i must do to validate the mysql condition and make it work?

 Try:

  $sql=SELECT * FROM divx WHERE .$sql1..$sql2.  ORDER BY
titulo;

and add a space after the WHERE.

Also consider the positioning of the single quotes (') and double-quotes ()
in the $sql1 assignment statement - they must be nested.

Finally, consider echoing sql1,  $sql2, and $sql to be able to see with your
own eyes!
=dn


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




Re: [PHP] Parsing an array from a posted form

2002-11-20 Thread Verdon Vaillancourt
A sincere thanks to John for the prompt and succinct answer. I've seen many
answers from John on this list and am much appreciative of his generosity.

Best regards, verdon  :)


On 11/20/02 3:07 PM, 1LT John W. Holmes [EMAIL PROTECTED] wrote:

 I have a form that is...
... 
 Which will return a count of the number of items in the array. What I want
 returned is a string of the values selected such as:
 
 eps, gif, other
 
 $string = implode(,,$graphicFormat);
 
 To see how many checkboxes were selected, use
 
 $num = count($graphicFormat);
 
 ---John Holmes...
 
 


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




[PHP] preg_replace question

2002-11-20 Thread electroteque
how could i remove http://www. ot of a url string sing preg_replace ?



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




Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread electroteque
add to that i'd do this

if ($_GET['sc'] !== '2' || $_GET['sc'] !== 8) {

for me single equals seem to assign the variable with the value double
equals seem to check the variable for the value

Jonathan Wright [EMAIL PROTECTED] wrote in message
20021120184141.GA12806@chef">news:20021120184141.GA12806@chef...
 Hiya,

 On Wed, Nov 20, 2002 at 11:24:11AM -0600, Jami wrote:
  I have code that says:
 
  if($_GET['sc'] != '2' OR '8'){
  do this.
  }
 
  but I doesn't work. What do I need to do to get it to work? I have
checked
  operator precendence and all that and am still confused on whether I
should
  be using '||' or 'OR' or something else... I have tried both of those,
as
  well as 'XOR' and '^'. Help please!

 It won't work 'cause you're asking two different questions:

  1. if $_GET['sc'] != 2, and
  2. 8

 Operators can only work on two operands, i.e. one either side, so you if
 you want to ask any more questions, like above, you have to split them
 each into their own question:

   if ($_GET['sc'] != '2' || $_GET['sc'] != 8) {

 It also works the same when looking for a range like '2  $x  6', it has
 to be two questions - '2  $x  $x  6'.

 Hope that helps! :)

 --
 Jonathan Wright..
 // [EMAIL PROTECTED]
 // www.djnauk.co.uk
 --
 // life has no meaning unless we can enjoy what we've been given



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




[PHP] Anti Spam software

2002-11-20 Thread electroteque
anyone know of any good anti spam software for linux ?? and maybe be able to
monitor it with php ?




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




RE: [PHP] Newbie: PHP/MySQL (SELECT)

2002-11-20 Thread Van Andel, Robert
$sql1 = titulo like '%$titulotxt%'
$sql2 = cd like '$cdstxt';
$sql = SELECT * FROM divx WHERE $sql1 AND $sql2 ORDER BY titulo;

I think you are getting the error because of the ($titulotxt) ? portion of
your sql statements.  You really only need the two statements listed above
and then put into your actual sql statement.

Robbert van Andel 

-Original Message-
From: Mr. BuNgL3 [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 11:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Newbie: PHP/MySQL (SELECT)


Hi...
I'm with a little sintax problem...
The question is that i have two search fields (titulotxt and cdstxt) and i
want to create an mysql condition... i trying:

 $sql1=($titulotxt) ? titulo like '%.$titulotxt.%':;
 $sql2=($cdstxt) ? cds like '$cdstxt':;
 $sql=SELECT * FROM divx WHERE .$sql1.$sql2  ORDER BY titulo;

but he's giving me a sintax error on the 3 line... Can anyone
teach me how i must do to validate the mysql condition and make it work?
Thanks





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


 The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers. 





Re: [PHP] preg_replace question

2002-11-20 Thread Chris Shiflett
--- electroteque [EMAIL PROTECTED] wrote:
 how could i remove http://www. ot of a url string using
preg_replace?

No need to reinvent the wheel for this. Just use parse_url() instead:

http://www.php.net/manual/en/function.parse-url.php

Chris

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




Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread Chris Shiflett
--- electroteque [EMAIL PROTECTED] wrote:
 if ($_GET['sc'] !== '2' || $_GET['sc'] !== 8) {
 
 for me single equals seem to assign the variable with the value
 double equals seem to check the variable for the value

A single equals is = not !=. Otherwise, you would be correct.

Chris

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




Re: [PHP] preg_replace question

2002-11-20 Thread 1LT John W. Holmes
 --- electroteque [EMAIL PROTECTED] wrote:
  how could i remove http://www. ot of a url string using
 preg_replace?
 
 No need to reinvent the wheel for this. Just use parse_url() instead:
 
 http://www.php.net/manual/en/function.parse-url.php
 

Or just str_replace(). No need for regular expressions.

http://www.php.net/manual/en/function.str-replace.php

---John Holmes...

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




RE: [PHP] preg_replace question

2002-11-20 Thread Dan Rossi
looks like it returns www in the host array a bit silly when i need just the
bits afterwards to do a gethostbyname

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 21, 2002 7:41 AM
To: electroteque; [EMAIL PROTECTED]
Subject: Re: [PHP] preg_replace question


--- electroteque [EMAIL PROTECTED] wrote:
 how could i remove http://www. ot of a url string using
preg_replace?

No need to reinvent the wheel for this. Just use parse_url() instead:

http://www.php.net/manual/en/function.parse-url.php

Chris


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




Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread 1LT John W. Holmes
 --- electroteque [EMAIL PROTECTED] wrote:
  if ($_GET['sc'] !== '2' || $_GET['sc'] !== 8) {
 
  for me single equals seem to assign the variable with the value
  double equals seem to check the variable for the value

From the, imagine this, Manual:

  $a != $b Not equal TRUE if $a is not equal to $b.

  $a !== $b Not identical TRUE if $a is not equal to $b, or they are not
of the same type. (PHP 4 only)


---John Holmes...


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




RE: [PHP] scrolling data from db

2002-11-20 Thread Support @ Fourthrealm.com
Hi Eddie,
iFrames do offer a really nice solution, but they are an IE only 
tag.  Although I can't vouch for the latest Netscape, I know that the older 
versions simply ignore the iFRAME... tag, and leave a blank spot in its 
place.

If you know that your client base will ever only use IE, then go for 
it.  Otherwise, you'll have to avoid the iframe.


Peter

At 03:17 PM 11/20/2002 -0500, Edward Peloke wrote:
Thanks Peter!

I will take a look.  As I am new to javascript, why would someone use
javascript when iframes are easier?  Will I be able to use the javascript on
more browsers?  Are the iframes limited?

Thanks,
Eddie

-Original Message-
From: Support @ Fourthrealm.com [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 11:23 AM
To: Edward Peloke; [EMAIL PROTECTED]
Subject: Re: [PHP] scrolling data from db


Eddie,
I use the attached on a site of mine... works with JavaScript and DIV
tags.

There are 2 parts to the file - the javascript, and then the HTML code to
make it happen.  Tweak according to your needs.

Peter


At 11:00 AM 11/20/2002 -0500, you wrote:
I have a large amount of data to present to the user.  Currently, I am just
putting it in a table and displaying it on the page, if it is more than a
page of course the page just scrolls.  Is there a way o, without using
frames, to put all the data from the db in the middle of the page with a
scroll bar on the side that just scrolls the data, I mean the header and
footer of the php page do not move?  I am sure I will need javascript for
this...right?

Thanks,
Eddie


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

- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


- - - - - - - - - - - - - - - - - - - - -
Fourth Realm Solutions
[EMAIL PROTECTED]
http://www.fourthrealm.com
Tel: 519-739-1652
- - - - - - - - - - - - - - - - - - - - -


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




[PHP] How to unregister a single array item...

2002-11-20 Thread @ Nilaab
Hello,
How do I unregister a single array item from an array? For example:


session_start()
session_register(item);

$item['name'] = Some Name;
$item['img'] = some_image_name.jpg;
$item['desc'] = Some Description;
$item['price'] = 400;

// Now I want to get rid of the desc array item.
// I tried:

session_unregister(item[desc]);

// But that didn't work. However, I had some luck with:

unset($item['desc']);

// Is there another way?
// What is the best way to take this out of the session
// of the array that I registered above as $item?

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




Re: [PHP] How to unregister a single array item...

2002-11-20 Thread Nick Eby
@ Nilaab [EMAIL PROTECTED] wrote:
 Hello,
 How do I unregister a single array item from an array? For example:


 session_start()
 session_register(item);

 $item['name'] = Some Name;
 $item['img'] = some_image_name.jpg;
 $item['desc'] = Some Description;
 $item['price'] = 400;

--snip--

 unset($item['desc']);


that will work just fine.  think of it this way- the array $item is
registered (and maybe unregistered) with the session, but its elements
aren't individually registered with the array.  just register/unregister the
array, and otherwise work with the array by setting and unsetting the
elements as you described.



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




Re: [PHP] interpreting variables containing in another variable

2002-11-20 Thread Ernest E Vogelsinger
At 19:15 20.11.2002, ROBERT MCPEAK said:
[snip]
I've got a variable - $email_body, that contain's other variables.  For 
example, echo $email_body, might look like this:

$name, $address, $phone, $blah


I want those variables to interpreted with corresponding values set earlier 
in the script.  So, in effect, where name=bob, address=101 east main, 
phone=555-, and blah=foo, echo $email_body would look like this:

bob, 101 east main, 555-, foo
[snip] 

That's what eval() is for. eval() evaluates syntactically correct PHP code.

What you need to do is

$email_body = str_replace('', '\', $email_body);
global $php_error;
$php_error = null;
@eval(\$email_body = \$email_body\;);
if ($php_error) die ($php_error);

Of course all double quotes need to be escaped beforehand, as the example
shows. The error handling here is somewhat useless but demonstrates the idea.


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




Re: [PHP] How to: If($var != '#' OR '#')

2002-11-20 Thread Ernest E Vogelsinger
At 18:24 20.11.2002, Jami said:
[snip]
I have code that says:

if($_GET['sc'] != '2' OR '8'){
do this.
}
[snip] 

besides all other good examples, you could also
if (in_array($_GET['sc'], array('2','8'))) {
do this.
}


-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




[PHP] script seen on php.net manual

2002-11-20 Thread Pedro Furtado
Hey,
http://www.php.net/manual/en/function.mysql-fetch-array.php

regarding, jb at stormvision dot com dot na's post (below)

i need to output
row0=article__2||tipo 1:row1=art2|b|Tipo 2

how can i achieve this?

This might be usefull for people that work with lots of rows and want to 
place them all into one array for later usage. This script just takes care 
of all the tedious work one would have and puts all neccessary field names 
into your array automatically. This way you can use this script over and 
over for all kind of mysql functions.
$result=mysql_query(select * from mydata order by 'id')or die('died');
$num_rows = mysql_num_rows($result);
$j=0;
$x=1;
while($row=mysql_fetch_array($result)){
for($j=0;$j$num_rows;$j++){
$name = mysql_field_name($result, $j);
$object[$x][$name]=$row[$name];
}$x++;
}

For Later in the script you may use the below array to gain access to your data

$i=1;
$ii=count($object); //quick access function
for($i=1;$i=$ii;$i++){
echo $object[$i]['your_field_name'];
}

hope it helps






Kindest Regards,
Pedro Furtado
www.silkonski.com

Re: [PHP] script seen on php.net manual

2002-11-20 Thread Chris Boget
 i need to output
 row0=article__2||tipo 1:row1=art2|b|Tipo 2
 how can i achieve this?

I believe you can just use urlencode() and urldecode() on the values.

Chris


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




RE: [PHP] preg_replace question

2002-11-20 Thread Dan Rossi
this is fine but it didnt parse in just www.domain.com

-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 21, 2002 7:41 AM
To: electroteque; [EMAIL PROTECTED]
Subject: Re: [PHP] preg_replace question


--- electroteque [EMAIL PROTECTED] wrote:
 how could i remove http://www. ot of a url string using
preg_replace?

No need to reinvent the wheel for this. Just use parse_url() instead:

http://www.php.net/manual/en/function.parse-url.php

Chris

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




Re: [PHP] How to unregister a single array item...

2002-11-20 Thread Nick Eby

Nick Eby [EMAIL PROTECTED] wrote :

 that will work just fine.  think of it this way- the array $item is
 registered (and maybe unregistered) with the session, but its elements
 aren't individually registered with the .  just
register/unregister the
 array, and otherwise work with the array by setting and unsetting the
 elements as you described.




fill in the blank... should've said session.



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




Re: [PHP] web server and permissions

2002-11-20 Thread Ernest E Vogelsinger
At 19:49 20.11.2002, Dennis Gearon said:
[snip]
Please B/CC me, thank you.

I am on a site that has all the files in both the /home/sitename/www/ 
directory and a directory 
we'll call /home/directory/includes/ with the following permisssions:

 rwxr-x--r

The group I have in /etc/group does not have anyone in it, including me.

The server reads everything fine and the php engine can include fine from the 
/home/sitename/includes/ directory.

The problem is, everyone else on the site can read the includes directory as 
well, including my 
database password file which get's included.

You should set the owner and group of the includes directory correctly,
additional to the file permissions.

If you want only apache (and PHP) to be able to read from the includes
directory, and only you may add/modify, you should (assumed dgearon is your
username):

chown dgearon:apache /home/sitename/include/.
chown -R dgearon:apache /home/sitename/include/*
chmod 750 /home/sitename/include/.
chmod -R 640 /home/sitename/include/*

This will make your account the owner of the directory and all files, and
the group apache the owning group. Only the owner may list and modify the
directory and files, and only the owner and the owning group may read the
directory and its files. All others are blocked access.

What I would like to set up is:

   [1] the apache/php engine can include from the
   includes directory, but not just spit it out.
   I think that is taken care of by the
   .htaccess file already.

See my comment above

   [2] the apache/php process is in my group,
   and everything I want to go out has
   the group permissions set to rwx--r---
   (do php/html/inc files also have to be
   executable to be serverd?)

no, they are read by the web server, not executed

   [3] 'everyone' does not have the ability to read
   my files on myserver. 

set the last permission number to zero (see above). The last number stands
for world which means all others that are not owner or ownergroup.



-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




RE: [PHP] preg_replace question

2002-11-20 Thread Dan Rossi
getting really annoying one url will work where another one wont

//$formatted_url = preg_replace(/\b((http(s?):\/\/)|(www\.))\b/i, ,
$url);
//$formatted_url =
preg_replace(/\b((http(s?):\/\/)|(www\.))([\w\.]+)([\/\w+\.]+)\b/i, $5,
$url);
$formatted_url = eregi_replace(^(.{2,6}://)?([^:]*)?([^/]*)?(.*), 
\\2,
$url);

tried all these dont work

some urls will have http://www. some will only have www. some will have
:1023 for forced ports and they all will have /directory afterwards i just
need domain.com for example :|

-Original Message-
From: 1LT John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 21, 2002 7:48 AM
To: [EMAIL PROTECTED]; electroteque; [EMAIL PROTECTED]
Subject: Re: [PHP] preg_replace question


 --- electroteque [EMAIL PROTECTED] wrote:
  how could i remove http://www. ot of a url string using
 preg_replace?

 No need to reinvent the wheel for this. Just use parse_url() instead:

 http://www.php.net/manual/en/function.parse-url.php


Or just str_replace(). No need for regular expressions.

http://www.php.net/manual/en/function.str-replace.php

---John Holmes...


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




RE: [PHP] preg_replace question

2002-11-20 Thread Chris Shiflett
--- Dan Rossi [EMAIL PROTECTED] wrote:
 some urls will have http://www. some will only have www. some will
 have :1023 for forced ports and they all will have /directory
 afterwards i just need domain.com for example :|

Out of curiosity, did you not read the replies to your initial
question? I recall saying this:

 Just use parse_url() instead:

 http://www.php.net/manual/en/function.parse-url.php

I recall seeing John Holmes say this:

 Or just str_replace(). No need for regular expressions.
 
 http://www.php.net/manual/en/function.str-replace.php

Chris

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




Re: [PHP] Header Location not working

2002-11-20 Thread Baumann Reto
Yes, I have an exit() immediately following header...

Could these statements in any way affect the session? Or session update?

Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Wednesday 20 November 2002 06:36, Baumann Reto wrote:
  Hi all
 
  Does somebody know if there is a potential problem with
  Header(Location: );
  not working properly?
 
  I have a redirection, but it seems that on some browser, this doesn't
work.
  Instead of the redirection, the same page is requested again!

 Do you have exit() after using header()? You should.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *

 /*
  U   X
 e dUdX, e dX, cosine, secant, tangent, sine, 3.14159...
 */




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




Re: [PHP] web server and permissions

2002-11-20 Thread Dennis Gearon
Would this prevent other PHP users from including files in my include directory?

11/20/2002 1:45:08 PM, Ernest E Vogelsinger [EMAIL PROTECTED] wrote:

At 19:49 20.11.2002, Dennis Gearon said:
[snip]
Please B/CC me, thank you.

I am on a site that has all the files in both the /home/sitename/www/ 
directory and a directory 
we'll call /home/directory/includes/ with the following permisssions:

 rwxr-x--r

The group I have in /etc/group does not have anyone in it, including me.

The server reads everything fine and the php engine can include fine from the 
/home/sitename/includes/ directory.

The problem is, everyone else on the site can read the includes directory as 
well, including my 
database password file which get's included.

You should set the owner and group of the includes directory correctly,
additional to the file permissions.

If you want only apache (and PHP) to be able to read from the includes
directory, and only you may add/modify, you should (assumed dgearon is your
username):

chown dgearon:apache /home/sitename/include/.
chown -R dgearon:apache /home/sitename/include/*
chmod 750 /home/sitename/include/.
chmod -R 640 /home/sitename/include/*

This will make your account the owner of the directory and all files, and
the group apache the owning group. Only the owner may list and modify the
directory and files, and only the owner and the owning group may read the
directory and its files. All others are blocked access.

What I would like to set up is:

   [1] the apache/php engine can include from the
   includes directory, but not just spit it out.
   I think that is taken care of by the
   .htaccess file already.

See my comment above

   [2] the apache/php process is in my group,
   and everything I want to go out has
   the group permissions set to rwx--r---
   (do php/html/inc files also have to be
   executable to be serverd?)

no, they are read by the web server, not executed

   [3] 'everyone' does not have the ability to read
   my files on myserver. 

set the last permission number to zero (see above). The last number stands
for world which means all others that are not owner or ownergroup.



-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/







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




[PHP] Session Not Registering on Page it is Set On

2002-11-20 Thread vernon
These pup session are going to drive me nuts!

I can't seem to get this session to register on the same page it is set. For
instance I load a record, then set a session right after it using:

session_register(suckered);
$suckered = $row_rouser['ID'];

The session is set throughout the site, but not on the page I set it on.
What am I doing wrong?

Thanks



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




Re: [PHP] Stripping HTML tags, but keeping entities...

2002-11-20 Thread Justin French
on 21/11/02 2:25 AM, David Russell ([EMAIL PROTECTED]) wrote:

 strip_tags($_POST['Duplicate'], 'B I P A LI OL UL EM
 BR TT STRONG BLOCKQUOTE DIV ECODE ');
 
 OK, so this is cool. I got this list from the Slashdot allowed tags
 list, which I would assume is ok.

Whoa there... NEVER assume because someone else does something that it's
okay or safe.  According to your above checks, I'm allowed to do this:

B onmouseover=window.close();something evil/b

Strip tags does not make a post safe at all... *safer* maybe, but no where
near safe.

Really, what's needed is another version of strip tags which allows you to
specify allowed attributes per tag:

strip_tags_attr($string, 'B P class id style A href title BR')

But even that wouldn't prevent people from sneaking javascript (OR OTHER
CLIENT SIDE SCRIPTING) into the href attribute.

But, I haven't got enough brains to actually write the extension for PHP, so
hopefully someone else will pick it up eventually.


In the meantime, the only solution I can think of is to not allow
btags/b... perhaps allow some other form of [i]tag[/i] tag system which
doesn't allow any attributes.   Then you can simply strip all tags, and then
go onto replacing [b] with b, etc etc.  It's a lot of work, and you will
run into even more work when you choose to allow [a href=] or other
attributes, but it IS safer.


Or, perhaps it's cheaper for you to do some preliminary stripping of tags
as per your code above, and then have a moderator physically check over the
code for hidden evil.


Justin French

http://Indent.com.au
Web Developent  
Graphic Design



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




Re: [PHP] scrolling data from db

2002-11-20 Thread Justin French
Hi,

on 21/11/02 3:00 AM, Edward Peloke ([EMAIL PROTECTED]) wrote:

 I have a large amount of data to present to the user.  Currently, I am just
 putting it in a table and displaying it on the page, if it is more than a
 page of course the page just scrolls.  Is there a way o, without using
 frames, to put all the data from the db in the middle of the page with a
 scroll bar on the side that just scrolls the data, I mean the header and
 footer of the php page do not move?  I am sure I will need javascript for
 this...right?

This is certainly not PHP... a combination of javascript + css + a whole lot
of testing on browsers + an understanding that it will break some browsers
might do it.  iframes will do it, frames will too.


Justin French

http://Indent.com.au
Web Developent  
Graphic Design



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




RE: [PHP] Graph Question..

2002-11-20 Thread Van Andel, Robert
What I'm wondering is if you are calling the graphic's placing into the page
correctly.  I believe the class will probably work. 

I have a page that includes a graph that I generate using mySQL and PHP.
This is the code I use to actually display the graphic (not what generates
it).

ImageJPEG($pic,$graphname);

echo p align=\center\image src=\$graphname\/p\n;

Of course there is a significant amount of code that actually generates
$pic, but this is what I had to do to make the graphic appear.

Robbert van Andel 

-Original Message-
From: Jim Hatridge [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 20, 2002 12:03 PM
To: PHP-GEN
Subject: Re: [PHP] Graph Question..


On Wednesday 20 November 2002 20:37, Van Andel, Robert wrote:
 More information would be helpful.  Perhaps the code to the page that is
 causing you trouble (i.e. the one where you are using the class you
 downloaded yesterday).  Perhaps you are missing a key piece there.

 Robbert van Andel

HI Robbert et al..

Below is part of the code. I don't think I should send it all to the list, 
it's quite large. Looking at all this I think that I'm missing a lib for 
graphs. But I can't find anything on my SuSE 8.1 disks. What libs do I need 
for doing graphs?

Thanks

JIM



 -Original Message-
 From: James Hatridge [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, November 20, 2002 7:07 AM
 To: PHP-GEN
 Subject: [PHP] Graph Question..



 Hi all,,

 I d/l'ed a class for graphs last night. When I got the class working
 instead

 of a line graph I got the netscape symbol for no picture, ie a broken box.
 I

 must have missed something. Could someone give me a clue what I'm doing
 wrong?

 Thanks

 JIM

#

?
require Color.php;
require Graph.php;
require Barchart.php;

$white = new Color(255,255,255);
$blue = new Color(0,0,255);
$red = new Color(255,0,0);
$green = new Color(0,255,0);

$line = new Barchart(500,500,$white);

$ar1 = array(12,13,16,2,5,10,0,1,2,8);
$ar2 = array(20,13,-1,2,23,11,1,3,4,9);
$ar3 = array(11,15,20,12,6,-10,28,30,10,0);

$line-addArray($ar1, $white);
$line-addArray($ar2, $green);
$line-addArray($ar3, $red);
$line-printHTML();

?


##
-- 
Vielfeind -- Viel Ehr'
Antiamerikanische Propaganda in der Philatelie des 20. Jahrhunderts
  http:/www.fecundswamp.net/~hatridge/stamps/index.html


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


 The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited. If you received
this in error, please contact the sender and delete the material from all
computers. 





Re: [PHP] scrolling data from db

2002-11-20 Thread Justin French
on 21/11/02 7:56 AM, Support @ Fourthrealm.com ([EMAIL PROTECTED])
wrote:

 Hi Eddie,
 iFrames do offer a really nice solution, but they are an IE only
 tag.  

they are part of the HTML spec... so, conforming browsers (NN6, NN7, Opera I
think, etc) all have iframe support.  The real problem is NN  6 (of which
there are still plenty out there) and the lesser know and non-visual
browsers.

 Although I can't vouch for the latest Netscape, I know that the older
 versions simply ignore the iFRAME... tag, and leave a blank spot in its
 place.
 
 If you know that your client base will ever only use IE, then go for
 it.  Otherwise, you'll have to avoid the iframe.

That sounds a little harsh!

You can put a message in place of the iframe, for those who don't support
it.

iframe src= blah blah
Sorry, your browser does not support iframes, to view the content of this
frame, a href=click here/a.
/iframe

Or better still, you can actually PUT SOME CONTENT IN THERE.

I have an iframe which lists multiple tour dates for a band, sorted in date
order... if the iframe can be used, the user gets ALL upcomming gigs ina
scroller, otherwise they just get the next 3 (using approximately the same
amount of space), with a link to view all gigs.


iframes CAN work in many cases, if you think about it.


Justin


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




Fw: [PHP] Session Not Registering on Page it is Set On

2002-11-20 Thread Kevin Stone
What exactly are you doing?  The code you posted doesn't explain much.
-Kevin


- Original Message -
From: vernon [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 20, 2002 4:13 PM
Subject: [PHP] Session Not Registering on Page it is Set On


 These pup session are going to drive me nuts!

 I can't seem to get this session to register on the same page it is set.
For
 instance I load a record, then set a session right after it using:

 session_register(suckered);
 $suckered = $row_rouser['ID'];

 The session is set throughout the site, but not on the page I set it on.
 What am I doing wrong?

 Thanks



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





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




Re: [PHP] Newbie: php/mysql (Select)

2002-11-20 Thread Ernest E Vogelsinger
At 20:23 20.11.2002, Mr. BuNgL3 said:
[snip]
Hi...
I'm with a little sintax problem...
The question is that i have two search fields (titulotxt and cdstxt) and i
want to create an mysql condition... i trying:

 $sql1=($titulotxt) ? titulo like '%.$titulotxt.%':;
 $sql2=($cdstxt) ? cds like '$cdstxt':;
 $sql=SELECT * FROM divx WHERE .$sql1.$sql2  ORDER BY titulo;

but the bastard is giving me a sintax error on the 3 line... Can anyone
teach me how i must do to validate the mysql condition and make it work?
[snip] 

As already said, put a space after the WHERE clause.

What happens if $sql1 or $sql2 are empty (as your example provisons)?
Create an $sql3 that combines $sql1 and $sql2, and construct your SQL
accordingly:

$sql1 = ($titulotxt ? null : titulo like '%$titulotxt%');
$sql2 = ($cdstxt? null : cds like '$cdstxt');
$sql3 = $sql1 . ($sql1  $sql2 ? ' AND ' : null) . $sql2;
$sql  = 'SELECT * FROM divx ' .
($sql3 ? WHERE $sql3  : null) . 
'ORDER BY titulo';



-- 
   O Ernest E. Vogelsinger
   (\)ICQ #13394035
^ http://www.vogelsinger.at/



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




  1   2   >