[PHP] Image raw data

2004-01-14 Thread php
Hello

I've been using the image functions to resize images and do very basic stuff. I have 
PHP 4.2.2 with the built in GD.
I was wondering if there's a way to access the raw image data, somethiung like
image_get_as_array()

so that you can do more nifty things, such as applying convolution matrices or even do 
the resizing by hand with different algorythms.

Please reply privately because I'm not subscribed to the list, I don' teven know how 
to subscribe

Aristide

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



Re: [PHP] class limitations brought by PEAR

2004-01-14 Thread Burhan Khalid
Glenn Yonemitsu wrote:

I don't want to rely on PEAR, mainly because I don't know it too well to 
use it fully. But most PHP installs come with base PEAR classes, so does 
that take away my ability to name classes that PEAR already made? (ie. 
class DB).
No.

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


[PHP] Defining own globals

2004-01-14 Thread Ville Mattila
Hello,

Would it be possible to make all hard-coded variables beginning with $_ 
automatically global? I've found useful to set some variables per page 
to $_PAGE variable (for example $_PAGE['title'] etc) that would be nice 
to get available to all functions without extra procedures (like global 
command). The best way could be that $_ variables can't be defined by 
any user-input (forms, cookies etc)...

Well, that's a explanation. I hope that someone would give any hint 
concerning this subject. :)

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


[PHP] Re: class limitations brought by PEAR

2004-01-14 Thread David Robley
In article [EMAIL PROTECTED], 
[EMAIL PROTECTED] says...
 I don't want to rely on PEAR, mainly because I don't know it too well to 
 use it fully. But most PHP installs come with base PEAR classes, so does 
 that take away my ability to name classes that PEAR already made? (ie. 
 class DB).
 
 Glenn
 
If the base PEAR install is not in your include_path, then it shouldn't be 
a problem.

Cheers
-- 
Quod subigo farinam

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?

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



RE: [PHP] PHP, MySQL problem

2004-01-14 Thread Humberto Silva
 So, does anybody know what I the problem might be?

Hi,

Well you need to post the code so one can see what's the problem 
 
Humberto Silva
World Editing
Portugal
 


-Original Message-
From: Nicolai Elmqvist [mailto:[EMAIL PROTECTED] 
Sent: quarta-feira, 14 de Janeiro de 2004 0:11
To: [EMAIL PROTECTED]
Subject: [PHP] PHP, MySQL problem


Hi

I have just started working with PHP and MySQL and have gone through 3
tutorials on how to add and delete records from a database. Nearly
everything is working, as it should except for the communication between
HTML form and PHP. If I try to add a record to my database by pushing
a submit the text in the textboxes are deleted but no record is
inserted in the database. I have copied the code directly form the
tutorials so spelling mistakes should not be the problem.



It is possible to add records manually in the code so the connection to
and from the database is ok.



So, does anybody know what I the problem might be?



I'm using PHP 4.3.4, MySQL 4.0.17 and an Apache server.



On before hand, thank you.

Nicolai Elmqvist

-- 
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] PHP,MySQL problem

2004-01-14 Thread Nicolai Elmqvist
Sorry, I should have done that from the beginning, but here it is. I have
looked further on the variables and it seams like the name attribute
sumbit (in the form) is not converted to the $submit variable when I
press the button. If I make a var_dump() in the beginning and end of the
code, $submit is set to NULL in both occations. The same goes with the rest
of the variables. It's like the conversion part is out of order, but where
can I fix that?

It is possible to update the database by setting the variables directly in
the code, so that is not the problem.
I have gone though my php.ini and httpd.conf files to see if there was any
mistakes. Found one but it didn't solve the problem.

Hope somebody can help.

Thanks!

The tutorial i have copied the code from can be found at:
http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html

Here is the code for making the database if anyone would like to test it.

CREATE TABLE employees (  id tinyint(4) DEFAULT '0' NOT NULL AUTO_INCREMENT,
first varchar(20),  last varchar(20),  address varchar(255),  position
varchar(50),  PRIMARY KEY (id),  UNIQUE id (id));

Here is the script!

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN

html
head
titleIndex/title
/head
body

?php

$db = mysql_connect(localhost, root);
mysql_select_db(mydb,$db);

if ($submit) {
  // here if no ID then adding else we're editing
  if ($id) {
$sql = UPDATE employees SET
first='$first',last='$last',address='$address',position='$position' WHERE
id=$id;
  } else {
$sql = INSERT INTO employees (first,last,address,position) VALUES
('$first','$last','$address','$position');
  }
  // run SQL against the DB
  $result = mysql_query($sql);
  echo Record updated/edited!p;
} elseif ($delete) {
 // delete a record
$sql = DELETE FROM employees WHERE id=$id;
$result = mysql_query($sql);
echo $sql Record deleted!p;
} else {
 // this part happens if we don't press submit
  if (!$id) {
// print the list if there is not editing
$result = mysql_query(SELECT * FROM employees,$db);
while ($myrow = mysql_fetch_array($result)) {
  printf(a href=\%s?id=%s\%s %s/a \n, $PHP_SELF, $myrow[id],
$myrow[first], $myrow[last]);
   printf(a href=\%s?id=%sdelete=yes\(DELETE)/abr, $PHP_SELF,
$myrow[id]);
}
  }
  ?
  P
  a href=?php echo $PHP_SELF?ADD A RECORD/a
  P
  form method=post action=?php echo $PHP_SELF?
  ?php
  if ($id) {
// editing so select a record
$sql = SELECT * FROM employees WHERE id=$id;
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$id = $myrow[id];
$first = $myrow[first];
$last = $myrow[last];
$address = $myrow[address];
$position = $myrow[position];
// print the id for editing
?
input type=hidden name=id value=?php echo $id ?
?php
  }
  ?
  First name:input type=Text name=first value=?php echo $first
?br
  Last name:input type=Text name=last value=?php echo $last ?br
  Address:input type=Text name=address value=?php echo $address
?br
  Position:input type=Text name=position value=?php echo $position
?br
  input type=Submit name=submit value=Enter information
  /form
?php
}
?

/body
/html

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



Re: [PHP] PHP,MySQL problem

2004-01-14 Thread Richard Davey
Hello Nicolai,

Wednesday, January 14, 2004, 12:14:09 PM, you wrote:

NE Sorry, I should have done that from the beginning, but here it is. I have
NE looked further on the variables and it seams like the name attribute
NE sumbit (in the form) is not converted to the $submit variable when I

NE if ($submit) {

You probably have Register Globals turned off (you should do anyway,
PHP by default has this setting now). That article looks like it
assumed they were turned on.

Simple solution: if ($_POST['submit'])

You'll need to do this for each variable you want to use that comes in
via the form.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] Can you recommend a good PHP includes tutorial?

2004-01-14 Thread Freedomware
I thought this would be the easiest thing to learn, but I'm striking out 
right and left. I bought a book about PHP, but the includes examples 
don't work for me at all. I searched several forums and www.php.net, but 
it's hard to even zero in on a good tutorial.

I think part of the problem is that the word include apparently covers 
a lot of territory.

I'm looking for a plain vanilla equivalent to Microsoft's include 
pages. For example, suppose I want to have the same title and image at 
the top of every page on my website. I could put the title and image on 
a separate page, then use an include to insert it on all the other pages.

It might be especially nice to find an online working example that could 
be downloaded and picked apart.

Thanks.

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


RE: [PHP] Can you recommend a good PHP includes tutorial?

2004-01-14 Thread Jay Blanchard
[snip]
I thought this would be the easiest thing to learn, but I'm striking out

right and left. I bought a book about PHP, but the includes examples 
don't work for me at all. I searched several forums and www.php.net, but

it's hard to even zero in on a good tutorial.
[/snip]

http://www.php.net/include

There is no tutorial for this because it is painfully simple to use. 

Create toBeIncluded.php --

?php
$todayDate = date(m-d-Y);
?

h1Today is ?php echo $todayDate; ?/h1

You're all done!

Now create myIncluded.php --

html
head/head
body
h1Welcome!/h1
?php

inlclude(toBeIncluded.php);

?
/body
/html

All done! Now just place these files in the same directory in your web
server and load myIncluded.php from the browser. You may have to pay
close attention to the paths of the files, but it is pretty simple
really.

HTH!

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



[PHP] Re: Can you recommend a good PHP includes tutorial?

2004-01-14 Thread Freedomware
Yikes, scratch my last post!

I think I stumbled over the answer just after I posted it.

Freedomware wrote:

I thought this would be the easiest thing to learn, but I'm striking out 
right and left. I bought a book about PHP, but the includes examples 
don't work for me at all. I searched several forums and www.php.net, but 
it's hard to even zero in on a good tutorial.

I think part of the problem is that the word include apparently covers 
a lot of territory.

I'm looking for a plain vanilla equivalent to Microsoft's include 
pages. For example, suppose I want to have the same title and image at 
the top of every page on my website. I could put the title and image on 
a separate page, then use an include to insert it on all the other pages.

It might be especially nice to find an online working example that could 
be downloaded and picked apart.

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


[PHP] Multiple RDBMS in one request

2004-01-14 Thread Geoff Caplan
Hi folks,

Is it possible to interact with multiple RDBMS during a single
request? I seem to remember that with older versions at least, there
was some problems with this, but can't find anything definitive in the
archive or docs.

Can't try it out in practice as I only have 1 RDBMS installed on my
current server.

Any info most welcome

-- 

Geoff Caplan

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



RE: [PHP] Multiple RDBMS in one request

2004-01-14 Thread Jay Blanchard
[snip]
Is it possible to interact with multiple RDBMS during a single
request? I seem to remember that with older versions at least, there
was some problems with this, but can't find anything definitive in the
archive or docs.
[/snip]

If they are on one server, yes. Do not select a db, just specify the db
in the queries like

SELECT * FROM database.table

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



Re: [PHP] Defining own globals

2004-01-14 Thread CPT John W. Holmes
From: Ville Mattila [EMAIL PROTECTED]

 Would it be possible to make all hard-coded variables beginning with $_
 automatically global? I've found useful to set some variables per page
 to $_PAGE variable (for example $_PAGE['title'] etc) that would be nice
 to get available to all functions without extra procedures (like global
 command). The best way could be that $_ variables can't be defined by
 any user-input (forms, cookies etc)...

 Well, that's a explanation. I hope that someone would give any hint
 concerning this subject. :)

You already have $GLOBALS as a global (scope wise) variable, just add to
that if you want.

$GLOBALS['page_title'] = 'etc';

Or you can add directly to $_GET, $_POST, etc, so long as it doesn't
interfere with your forms. Maybe you need to use $_SESSION. Bottom line, the
variables are already there, just use them.

---John Holmes...

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



Re: [PHP] Multiple RDBMS in one request

2004-01-14 Thread CPT John W. Holmes
From: Geoff Caplan [EMAIL PROTECTED]

 Is it possible to interact with multiple RDBMS during a single
 request? I seem to remember that with older versions at least, there
 was some problems with this, but can't find anything definitive in the
 archive or docs.

Yes, you can open up multiple connections to different database systems in a
single script. Each one is separate, though; you're not going to be doing
any joins between them or sharing data in any way unless you bring it into
PHP first, though.

But yes, you can open a connection to MySQL, do some SELECTs, open a
connection to MSSQL, do an INSERT, open Oracle, etc, etc...

---John Holmes...

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



Re: [PHP] Can you recommend a good PHP includes tutorial?

2004-01-14 Thread Freedomware
Wow, that is a lot simpler than I imagined. Thanks for the tip!

Jay Blanchard wrote:

[snip]
I thought this would be the easiest thing to learn, but I'm striking out
right and left. I bought a book about PHP, but the includes examples 
don't work for me at all. I searched several forums and www.php.net, but

it's hard to even zero in on a good tutorial.
[/snip]
http://www.php.net/include

There is no tutorial for this because it is painfully simple to use. 

Create toBeIncluded.php --

?php
$todayDate = date(m-d-Y);
?
h1Today is ?php echo $todayDate; ?/h1

You're all done!

Now create myIncluded.php --

html
head/head
body
h1Welcome!/h1
?php
inlclude(toBeIncluded.php);

?
/body
/html
All done! Now just place these files in the same directory in your web
server and load myIncluded.php from the browser. You may have to pay
close attention to the paths of the files, but it is pretty simple
really.
HTH!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] mysql selecting question

2004-01-14 Thread tony
hi

I have a question
I have to select a group of person i.e
$query = SELECT * FROM table WHERE id = 10;

my question is that can we order order in random mode?? or do we have to
program it in php

any help is appreciated

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



[PHP] convert date from UK to US for strtotime

2004-01-14 Thread Jon Bennett
Hi,

I'm trying to re-work this code from the php site 
http://uk.php.net/strtotime so that my users can input dates in UK 
format (dd-mm-) and still use strtotime.

// from http://uk.php.net/strtotime

$date=explode(/,trim($records[2]));
$posted=strtotime ($date[1]./.$date[0]./.$date[2]);
so far I've got:

// converts a UK date (DD-MM-YYY) to a US date (MM-DD-) so 
strtotime doesn't fail
function convertDate ($sDate) {

$aDate = explode(/,trim($sDate[2]));

$return = strtotime ($aDate[1]./.$aDate[0]./.$aDate[2]);

return $return;
}
But this always fails, any idea why ??

What I really need is to re-order the string that a user inputs, say, 
21/04/2004, so that it becomes 04/21/2004 so I can use strtotime.

Cheers,

Jon

jon bennett  |  [EMAIL PROTECTED]
new media creative
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
J   b   e   n   .   n   e   t

91 Gloucester Rd,  Trowbridge,  Wilts,  BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/
On 14 Jan 2004, at 13:32, Chris W wrote:

I wanted to run by everyone what I am doing in my application to help
prevent someone from inadvertently or intensionally breaking the system
and compromising security.  First some quick background.  This is an
Apache/php/mysql project.  It is a wish list database where people can
create an account, then a wish list and share it with all their friends
and family so they will know what to get them for their birthday or
Christmas or whatever event.  There are many other features that I 
won't go into here, if you want to know more, you can take a look at 
the work in progress at http://thewishzone.com:8086

The first thing I do when getting data from a post or a get is run it
through a function that first checks to make sure it isn't any longer
than I am expecting (I will also eventually have java script that does
client side checking too, but a post or get can easily be faked so I
am checking on the server side as well)  I then verify that every 
character in the string is with in the ascii range of a space to the ~ 
which is basically all the characters on the key board.  If either 
test fails I print an error and stop the script.  If the value is 
supposed to be an integer or float I also check to make sure there 
aren't any non-numeric characters in the value.  Then finally before I 
put it in the database I use the mysql_real_escape_string function and 
put single quotes around my values in the sql statements.

Are there many php or mysql configuration considerations for making 
the site secure?  I have already done the obvious with my sql and set 
up the grant tables with passwords for all users and removed the 
[EMAIL PROTECTED] user.

--
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] Multiple RDBMS in one request

2004-01-14 Thread Geoff Caplan
John

CJWH Yes, you can open up multiple connections to different database systems in a
CJWH single script.

Thanks for the quick response: saved me from spending half a day
setting up a new RDBMS to try it out...

CJWH Each one is separate, though; you're not going to be doing
CJWH any joins between them or sharing data in any way

Sure: that would be a bit too much to expect!

Cheers

Geoff Caplan

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



Re: [PHP] Security issues

2004-01-14 Thread memoimyself
Hi Chris,

First of all, thanks a lot for sharing your modus operandi with us.

On 14 Jan 2004 at 7:32, Chris W wrote:

 I then verify that every character in the string is with in the ascii
 range of a space to the ~ which is basically all the characters on the
 key board. 

How exactly are you performing this check? Regular expression matching? If so, what 
regular expression are you using?

Thanks,

Erik

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



Re: [PHP] convert date from UK to US for strtotime

2004-01-14 Thread CPT John W. Holmes
From: Jon Bennett [EMAIL PROTECTED]

 I'm trying to re-work this code from the php site
 http://uk.php.net/strtotime so that my users can input dates in UK
 format (dd-mm-) and still use strtotime.

 // from http://uk.php.net/strtotime

 $date=explode(/,trim($records[2]));
 $posted=strtotime ($date[1]./.$date[0]./.$date[2]);

If you're going to split the date apart into it's components, why not just
use mktime()? There's no reason that you _need_ to use strtotime(), is
there?

$posted = mktime(0,0,0,$date[1],$date[0],$date[2]);

---John Holmes...

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



Re: [PHP] convert date from UK to US for strtotime

2004-01-14 Thread php
 What I really need is to re-order the string that a user inputs, say,
 21/04/2004, so that it becomes 04/21/2004 so I can use strtotime.

I use preg_match() (http://www.php.net/manual/de/function.preg-match.php):

$dateuk = '21/04/2004';
preg_match(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/, $dateuk, $m='');
$dateus = $m[2]/$m[1]/$m[3];

[0-9]{1,2} matches one or two numbers from 0 to 9
\/ matches /
(...) the first brackets-pair will go to $m[1] the second to $m[2] ...

g. martin luethi

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



Re: [PHP] convert date from UK to US for strtotime

2004-01-14 Thread Jon Bennett
ok,

got it:

// converts a UK date (DD-MM-YYY) to a US date (MM-DD-) and vice 
versa
function convertDate ($sDate) {

$aDate = split (/, $sDate);

$return = $aDate[1]./.$aDate[0]./.$aDate[2];

return $return;
}
Cheers,

Jon

jon bennett  |  [EMAIL PROTECTED]
new media creative
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
J   b   e   n   .   n   e   t

91 Gloucester Rd,  Trowbridge,  Wilts,  BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/
On 14 Jan 2004, at 13:50, Jon Bennett wrote:

Hi,

I'm trying to re-work this code from the php site 
http://uk.php.net/strtotime so that my users can input dates in UK 
format (dd-mm-) and still use strtotime.

// from http://uk.php.net/strtotime

$date=explode(/,trim($records[2]));
$posted=strtotime ($date[1]./.$date[0]./.$date[2]);
so far I've got:

// converts a UK date (DD-MM-YYY) to a US date (MM-DD-) so 
strtotime doesn't fail
function convertDate ($sDate) {

$aDate = explode(/,trim($sDate[2]));

$return = strtotime ($aDate[1]./.$aDate[0]./.$aDate[2]);

return $return;
}
But this always fails, any idea why ??

What I really need is to re-order the string that a user inputs, say, 
21/04/2004, so that it becomes 04/21/2004 so I can use strtotime.

Cheers,

Jon

jon bennett  |  [EMAIL PROTECTED]
new media creative
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
J   b   e   n   .   n   e   t

91 Gloucester Rd,  Trowbridge,  Wilts,  BA14 0AD
t: +44 (0) 1225 341039 w: http://www.jben.net/
On 14 Jan 2004, at 13:32, Chris W wrote:

I wanted to run by everyone what I am doing in my application to help
prevent someone from inadvertently or intensionally breaking the 
system
and compromising security.  First some quick background.  This is an
Apache/php/mysql project.  It is a wish list database where people can
create an account, then a wish list and share it with all their 
friends
and family so they will know what to get them for their birthday or
Christmas or whatever event.  There are many other features that I 
won't go into here, if you want to know more, you can take a look at 
the work in progress at http://thewishzone.com:8086

The first thing I do when getting data from a post or a get is run it
through a function that first checks to make sure it isn't any longer
than I am expecting (I will also eventually have java script that does
client side checking too, but a post or get can easily be faked so I
am checking on the server side as well)  I then verify that every 
character in the string is with in the ascii range of a space to the 
~ which is basically all the characters on the key board.  If either 
test fails I print an error and stop the script.  If the value is 
supposed to be an integer or float I also check to make sure there 
aren't any non-numeric characters in the value.  Then finally before 
I put it in the database I use the mysql_real_escape_string function 
and put single quotes around my values in the sql statements.

Are there many php or mysql configuration considerations for making 
the site secure?  I have already done the obvious with my sql and set 
up the grant tables with passwords for all users and removed the 
[EMAIL PROTECTED] user.

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


[PHP] ODBC in PHP4.3.4 crashes when used with Mysql 4

2004-01-14 Thread Nico Sabbi

Hi,
I have Mysql-4.0-14, MyODBC 3.51.06 and unixODBC 2.2.0. They are working
perfectly together
(isql works correctly) but php-4.3.x always crashes when I try
odbc_connect() on
the same DSN I use with isql (env vars are correctly set).

Is this a known bug?

This is a bt of a simplified example that leads to crash:

[EMAIL PROTECTED] php-4.3.4]# gdb sapi/cli/php
GNU gdb Red Hat Linux (5.1.90CVS-5)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type show copying to see the conditions.
There is absolutely no warranty for GDB.  Type show warranty for details.
This GDB was configured as i386-redhat-linux...
(gdb) run
Starting program: /root/apache/php-4.3.4/sapi/cli/php
[New Thread 1024 (LWP 15719)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1024 (LWP 15719)]
0x080839ee in strxmov (dst=0x8513ab9 , src=0x204d Address 0x204d out of
bounds)
at /root/apache/php-4.3.4/ext/mysql/libmysql/strxmov.c:26
26  while ((*dst++ = *src++)) ;
(gdb) bt
#0  0x080839ee in strxmov (dst=0x8513ab9 , src=0x204d Address 0x204d out
of bounds)
at /root/apache/php-4.3.4/ext/mysql/libmysql/strxmov.c:26
#1  0x401fe68a in set_connect_defaults () from /usr/local/lib/libmyodbc3.so
#2  0x401fed73 in SQLConnect () from /usr/local/lib/libmyodbc3.so
#3  0x400b338a in SQLConnect () from /usr/lib/libodbc.so.1
#4  0x0808b37f in odbc_sqlconnect (conn=0xbfffa1d0, db=0x8520bd4 mysql,
uid=0x8520afc root, pwd=0x85130ac root, cur_opt=2,
persistent=0) at /root/apache/php-4.3.4/ext/odbc/php_odbc.c:2118
#5  0x0808bd1e in odbc_do_connect (ht=3, return_value=0x851326c,
this_ptr=0x0, return_value_used=1, persistent=0)
at /root/apache/php-4.3.4/ext/odbc/php_odbc.c:2316
#6  0x0808b019 in zif_odbc_connect (ht=3, return_value=0x851326c,
this_ptr=0x0, return_value_used=1)
at /root/apache/php-4.3.4/ext/odbc/php_odbc.c:2045
#7  0x0819201f in execute (op_array=0x8233d00) at
/root/apache/php-4.3.4/Zend/zend_execute.c:1616
#8  0x08192252 in execute (op_array=0x8222818) at
/root/apache/php-4.3.4/Zend/zend_execute.c:1660
#9  0x08175206 in call_user_function_ex (function_table=0x81df0a8,
object_pp=0x0, function_name=0x84393f4, retval_ptr_ptr=0xbfffb58c,
param_count=2, params=0x8520a24, no_separation=1, symbol_table=0x0) at
/root/apache/php-4.3.4/Zend/zend_execute_API.c:567
#10 0x08174998 in call_user_function (function_table=0x81df0a8,
object_pp=0x0, function_name=0x84393f4, retval_ptr=0x85209e4,
param_count=2, params=0xbfffb618) at
/root/apache/php-4.3.4/Zend/zend_execute_API.c:409
#11 0x080ad227 in ps_call_handler (func=0x84393f4, argc=2, argv=0xbfffb618)
at /root/apache/php-4.3.4/ext/session/mod_user.c:60
#12 0x080ad3d5 in ps_open_user (mod_data=0x81dabb0, save_path=0x81e46a8
/tmp, session_name=0x81e4760 nemoSession)
at /root/apache/php-4.3.4/ext/session/mod_user.c:98
#13 0x080a8eec in php_session_initialize () at
/root/apache/php-4.3.4/ext/session/session.c:598
#14 0x080aa366 in php_session_start () at
/root/apache/php-4.3.4/ext/session/session.c:1047
#15 0x080abeb4 in zif_session_start (ht=0, return_value=0x852078c,
this_ptr=0x0, return_value_used=0)
at /root/apache/php-4.3.4/ext/session/session.c:1486
#16 0x0819201f in execute (op_array=0x821e8ec) at
/root/apache/php-4.3.4/Zend/zend_execute.c:1616
#17 0x0817fd00 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at
/root/apache/php-4.3.4/Zend/zend.c:884
#18 0x08147956 in php_execute_script (primary_file=0xbfffe6e0) at
/root/apache/php-4.3.4/main/main.c:1729
#19 0x081987ae in main (argc=1, argv=0xbfffe784) at
/root/apache/php-4.3.4/sapi/cli/php_cli.c:819
#20 0x42017499 in __libc_start_main () from /lib/i686/libc.so.6


Thanks,
Nico

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



[PHP] Security issues

2004-01-14 Thread Chris W
I wanted to run by everyone what I am doing in my application to help
prevent someone from inadvertently or intensionally breaking the system
and compromising security.  First some quick background.  This is an
Apache/php/mysql project.  It is a wish list database where people can
create an account, then a wish list and share it with all their friends
and family so they will know what to get them for their birthday or
Christmas or whatever event.  There are many other features that I won't 
go into here, if you want to know more, you can take a look at the work 
in progress at http://thewishzone.com:8086

The first thing I do when getting data from a post or a get is run it
through a function that first checks to make sure it isn't any longer
than I am expecting (I will also eventually have java script that does
client side checking too, but a post or get can easily be faked so I
am checking on the server side as well)  I then verify that every 
character in the string is with in the ascii range of a space to the ~ 
which is basically all the characters on the key board.  If either test 
fails I print an error and stop the script.  If the value is supposed to 
be an integer or float I also check to make sure there aren't any 
non-numeric characters in the value.  Then finally before I put it in 
the database I use the mysql_real_escape_string function and put single 
quotes around my values in the sql statements.

Are there many php or mysql configuration considerations for making the 
site secure?  I have already done the obvious with my sql and set up the 
grant tables with passwords for all users and removed the [EMAIL PROTECTED] user.

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


Re: [PHP] Defining own globals

2004-01-14 Thread Chris Boget
  Would it be possible to make all hard-coded variables beginning with $_
  automatically global? I've found useful to set some variables per page
  to $_PAGE variable (for example $_PAGE['title'] etc) that would be nice
  to get available to all functions without extra procedures (like global
  command). The best way could be that $_ variables can't be defined by
  any user-input (forms, cookies etc)...
  Well, that's a explanation. I hope that someone would give any hint
  concerning this subject. :)
 You already have $GLOBALS as a global (scope wise) variable, just add to
 that if you want.
 $GLOBALS['page_title'] = 'etc';

Or, if you want/need to be really anal about naming conventions, you can 
do something along the following (continuing from John's example):

$GLOBALS['_PAGE']['title'] = 'Page Title';
$GLOBALS['_PAGE']['css_file'] = '/some/absolute/path/css_file.css';

function whatever() {

  $_PAGE = $GLOBALS['_PAGE'];

  echo $_PAGE['title'];
  echo $_PAGE['css_file'];

}

Chris

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



Re: [PHP] Security issues

2004-01-14 Thread Chris W
[EMAIL PROTECTED] wrote:

Hi Chris,

First of all, thanks a lot for sharing your modus operandi with us.

On 14 Jan 2004 at 7:32, Chris W wrote:


I then verify that every character in the string is with in the ascii
range of a space to the ~ which is basically all the characters on the
key board. 


How exactly are you performing this check? Regular expression matching? If so, what 
regular expression are you using?
function validStr($s, $len)
{
  if(strlen($s)  $len){
return false;
  }
  for($i = 0;$i  strlen($S);$i++){
if($s[$i]  ' ' or $s[$i]  '~'){
  return false;
}
  }
  return true;
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] nested tags

2004-01-14 Thread Gregor Jaksa
Can anyone provide me with some link or code on how to deal with nested
tags.

thx!

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



Re: [PHP] nested tags

2004-01-14 Thread David T-G
Gregor --

...and then Gregor Jaksa said...
% 
% Can anyone provide me with some link or code on how to deal with nested
% tags.

What kind of tags?  HTML?  PHP?  Mattress?

What do you want to accomplish?


% 
% thx!


HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] nested tags

2004-01-14 Thread Gregor Jaksa
HTML tags.
I can have something like
table
  first
  table
second table
  /table
  table
/table

and i need to convert each table/table tags into something more user
friendly.

David T-G [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

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



Re[2]: [PHP] nested tags

2004-01-14 Thread Richard Davey
Hello Gregor,

Wednesday, January 14, 2004, 3:22:32 PM, you wrote:

GJ HTML tags.
GJ I can have something like
GJ table
GJ   first
GJ   table
GJ second table
GJ   /table
GJ   table
GJ /table

GJ and i need to convert each table/table tags into something more user
GJ friendly.

Come again? Might be helpful to give an example of what you want to
turn a nested table tag into. I mean, it's perfectly valid being
nested the way it is.

-- 
Best regards,
 Richardmailto:[EMAIL PROTECTED]

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



[PHP] Compiling php for MySQL and Apache 2 Newbie

2004-01-14 Thread James Marcinek
Hello Everyone,

I'm still having problems compiling the latest version of PHP. I have
several issues

- The apache 2 that was installed was from a Red Hat package. From what I
can tell it is configured in a manner that is similar to the
with-apxs2filter. The configuration file that point to this kind of
installation is already configured in apache. However there is no perl
script apxs of any kind.

My question is can somebody tell me how to set up the configure to include
apache 2 and MySQL without the apxs?

When I do a whereis mysql I get the following:

mysql: /usr/bin/mysql /usr/lib/mysql /usr/include/mysql /usr/share/mysql
/usr/share/man/man1/mysql.1.gz

When I do a whereis httpd (The RH distro uses httpd instead of apachectl
BUT it is still there as well):

httpd: /usr/sbin/httpd /etc/httpd /usr/lib/httpd
/usr/share/man/man8/httpd.8.gz

Before I was getting function not defined when I called the mysql_connect
function, now the page is blank. I can still run php scripts that do not
interact with a database with no problems.

Any help is appreciated,

Thanks

James

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



Re: Re[2]: [PHP] nested tags

2004-01-14 Thread CPT John W. Holmes
From: Richard Davey [EMAIL PROTECTED]
 GJ HTML tags.
 GJ I can have something like
 GJ table
 GJ   first
 GJ   table
 GJ second table
 GJ   /table
 GJ   table
 GJ /table

 GJ and i need to convert each table/table tags into something more
user
 GJ friendly.

 Come again? Might be helpful to give an example of what you want to
 turn a nested table tag into. I mean, it's perfectly valid being
 nested the way it is.

Maybe

str_replace('table','[Hi HTML, this is the user. Could you please start a
table for me? Thanks.]',$html);

and

str_replace('/table','[Hey HTML, me again. You know that table you
started? Can you end it, please? Thanks.]',$html);

Now tell me that isn't user friendly!

---John Holmes...

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



Re: [PHP] mysql selecting question

2004-01-14 Thread Lowell Allen
 I have a question
 I have to select a group of person i.e
 $query = SELECT * FROM table WHERE id = 10;
 
 my question is that can we order order in random mode?? or do we have to
 program it in php
 
 any help is appreciated

Not a PHP question, but if you're using MySQL version 3.23.2 or later, and
you only want to return one random result you can use:

$query = SELECT * FROM table WHERE id10 ORDER BY RAND() LIMIT 1;

I don't know if that works without the LIMIT clause; give it a try.

HTH

--
Lowell Allen

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



Re: [PHP] TMP directory problem

2004-01-14 Thread Matt Matijevich
[snip]
When I had a look at the servers phpinfo and I saw that both
upload_tmp_dir and user_dir have
no value and  no value set for them.how do I change it (via a
.htaccess file as I dont have access to the
php.ini) so that I can write the data as required from my script?
[/snip]

Take a look at:
http://www.php.net/manual/en/function.ini-set.php

user_dir and upload_tmp_dir are Changeable only by PHP_INI_SYSTEM which
can be set in :
PHP_INI_SYSTEM  4Entry can be set in php.ini or httpd.conf

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



Re: [PHP] Can you recommend a good PHP includes tutorial?

2004-01-14 Thread Steve Edberg
And, you can even do this automatically using the auto_prepend_file 
and auto_append_file settings:

	http://us3.php.net/manual/en/configuration.directives.php

These can be set in your Apache config file, php.ini or .htaccess, so 
you can control what files are used down to the lowest subdirectory 
level.

Of course, if you need to include() in the middle of a page, or 
conditionally include files, these won't work -

	steve

At 5:16 AM -0800 1/14/04, Freedomware wrote:
Wow, that is a lot simpler than I imagined. Thanks for the tip!

Jay Blanchard wrote:

[snip]
I thought this would be the easiest thing to learn, but I'm striking out
right and left. I bought a book about PHP, but the includes 
examples don't work for me at all. I searched several forums and 
www.php.net, but

it's hard to even zero in on a good tutorial.
[/snip]
http://www.php.net/include

There is no tutorial for this because it is painfully simple to use.
Create toBeIncluded.php --
?php
$todayDate = date(m-d-Y);
?
h1Today is ?php echo $todayDate; ?/h1

You're all done!

Now create myIncluded.php --

html
head/head
body
h1Welcome!/h1
?php
inlclude(toBeIncluded.php);

?
/body
/html
All done! Now just place these files in the same directory in your web
server and load myIncluded.php from the browser. You may have to pay
close attention to the paths of the files, but it is pretty simple
really.
HTH!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
++
| Steve Edberg  [EMAIL PROTECTED] |
| University of California, Davis  (530)754-9127 |
| Programming/Database/SysAdmin   http://pgfsun.ucdavis.edu/ |
++
| [EMAIL PROTECTED]: 1001 Work units on 23 oct 2002  |
| 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
++
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Hello,

This question may border on OT...

I have a web form where visitors must enter large amounts of text at one 
time (text area).  Once submitted, the large amount of text is stored as 
a CLOB in an Oracle database.

Some of my visitors create their text in Ms-Word and then cut and paste 
it into the text area and then submit the form.

When I retrieve it from the database, I do a stripslahses, htmlentities 
and nl2br in that order to preserve the format of the submitted test. 
When I view this text, single or double quotes show up as little white 
square blocks.  I've tested this out with MS-Word on a windows machine 
and a mac machine.  Same thing happens with either OS.  This only 
happens when they cut and paste from MS-Word into the text area.  If 
they type text into the text area directly, everything is fine...

I know I can search through their submitted text and swap out the 
unrecognized character and insert the proper one.  I just don't know 
what to look for as being the unrecognized character.

I've googled all over looking at ascII charts and keyboard maps. 
Nothing mentions MS-Word specific information though.

Anyone out there dealt with this before?

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


[PHP] Re: Apache - Previewing Pages with Dreamweaver

2004-01-14 Thread zerof
To use LIVEDATA in Dreamweaver you need:
( You are at Windows environment. )

1 ) Apache server running ( normaly as a service );
2 ) PHP installed and configured;
3 ) MySQL installed;
4 ) Dreamweaver configured for the server model PHP/MySQL.

Some pages are not shown correctly in LIVEDATA ( localy );

If you run 2 servers from the same machine ( IIS and Apache ) you have to modify the 
the
port to which the Apache listens.
---
zerof
-
Freedomware [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 P.S. Should I go ahead and install PHP, or should I wait until I'm able
 to preview pages on my new Apache server?

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



[PHP] Re: credit card acceptance recommendations?

2004-01-14 Thread Matt Grimm
Your needs are a little vague here -- if you're not looking for a service
that will actually accept payment, but will simply ensure a valid credit
card number has been submitted, you can build your own validation class.
There's a fabulous article on the process at Sitepoint:

http://www.sitepoint.com/article/728

--
Matt Grimm
Web Developer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Parkway
Anchorage, AK 99508
907.770.6200 ext. 686
907.336.6205 (fax)
E-mail: [EMAIL PROTECTED]
Web: www.healthtvchannel.org

Matt Hedges [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Howdy... I'm building a site in PHP for someone that let's people enter
 their wedding information and pictures...  they want to charge to do
this...
 So what I need is something that will only let the person enter the info.
if
 they've paid by credit card...  I don't need shopping carts or anything...

 Any ideas/suggestions?  I've come across one, charge.com... anybody had
any
 experience with it or another?

 thanks,
 Matt



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



[PHP][PEAR] PEAR::DB_Common::nextId()

2004-01-14 Thread Alessandro Vitale
I would like to get the last insert id... anyone has some experience in
using the PEAR::DB_Common::nextId() ?

any suggestion would be very much appreciated.

alessandro

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



Re: [PHP] nested tags

2004-01-14 Thread memoimyself
Gregor,

On 14 Jan 2004 at 16:02, Gregor Jaksa wrote:

 Can anyone provide me with some link or code on how to deal with nested
 tags. 

Could you please tell us a bit more about what you want or need? Are you talking about 
HTML or XML? What do you want to be able to do with your nested tags? You asked a 
very vague question and are unlikely to get any useful responses unless you explain 
yourself a little better.

Erik

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



Re: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Marek Kilimajer
I don't know what the character is but if you paste it into the 
textarea, ord() will tell you.

Roger Spears wrote:
Hello,

This question may border on OT...

I have a web form where visitors must enter large amounts of text at one 
time (text area).  Once submitted, the large amount of text is stored as 
a CLOB in an Oracle database.

Some of my visitors create their text in Ms-Word and then cut and paste 
it into the text area and then submit the form.

When I retrieve it from the database, I do a stripslahses, htmlentities 
and nl2br in that order to preserve the format of the submitted test. 
When I view this text, single or double quotes show up as little white 
square blocks.  I've tested this out with MS-Word on a windows machine 
and a mac machine.  Same thing happens with either OS.  This only 
happens when they cut and paste from MS-Word into the text area.  If 
they type text into the text area directly, everything is fine...

I know I can search through their submitted text and swap out the 
unrecognized character and insert the proper one.  I just don't know 
what to look for as being the unrecognized character.

I've googled all over looking at ascII charts and keyboard maps. Nothing 
mentions MS-Word specific information though.

Anyone out there dealt with this before?

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


[PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hi,
I have a blog kind of app running on my site...presently it shows like this:
show.php?category=Beginners%20Cornersid=1id=1

After searching on google on how to make my blog my search engine friendly I
came accorss
mod_rewrite and couple of tutorials on it, finally the one I understood and
tried to use was this one:

http://www.phpfreaks.com/tutorials/23/0.php

so I added this to my .htaccess:
RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*).php
/show.php?category=Beginners%20Cornersid=$2id=$3

and added this to my httpd.conf:
AccessFileName .htaccess
Files ~ ^\.ht
AllowOverride all
Order allow,deny
Deny from all
Satisfy All
/Files

Directory /usr/local/www/rizkhan.net/www/articles
Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride all
/Directory

But somehow its not working :-(( I made the changes in the httpd.conf and
also in a .htaccess file...

PLEAS HEEELLP.

Thanks in advance,
-Ryan

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



[PHP] Re: Security issues

2004-01-14 Thread John Leach
On Wed, 2004-01-14 at 13:32, Chris W wrote:
 Are there many php or mysql configuration considerations for making the 
 site secure?  I have already done the obvious with my sql and set up the 
 grant tables with passwords for all users and removed the [EMAIL PROTECTED] user.

Give the MySQL user you're using only the minimum permissions.  I doubt
your web app will need to ALTER table structures for example.

I like to use privilege separation.  In my code I have different MySQL
users with different permission.  One might have read-write access
(SELECT, INSERT, UPDATE etc.) and another has read-only.  I then use
these users appropriately throughout my code.  For example, a script
that searches a table uses the read-only user.  Then no matter how
clever the attacker is, they won't be able to DELETE all my data by
exploiting that code.

John.
-- 
GPG: B89C D450 5B2C 74D8 58FB  A360 9B06 B5C2 26F0 3047
URL: http://www.johnleach.co.uk


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


Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 11:14, Ryan A wrote:
 Hi,
 I have a blog kind of app running on my site...presently it shows like this:
 show.php?category=Beginners%20Cornersid=1id=1
 
 After searching on google on how to make my blog my search engine friendly I
 came accorss
 mod_rewrite and couple of tutorials on it, finally the one I understood and
 tried to use was this one:
 
 http://www.phpfreaks.com/tutorials/23/0.php
 
 so I added this to my .htaccess:
 RewriteEngine On
 RewriteRule ^show/(.*)/(.*)/(.*).php
 /show.php?category=Beginners%20Cornersid=$2id=$3
 
 and added this to my httpd.conf:
 AccessFileName .htaccess
 Files ~ ^\.ht
 AllowOverride all
 Order allow,deny
 Deny from all
 Satisfy All
 /Files
 
 Directory /usr/local/www/rizkhan.net/www/articles
 Options ExecCGI FollowSymLinks Includes MultiViews
 AllowOverride all
 /Directory
 
 But somehow its not working :-(( I made the changes in the httpd.conf and
 also in a .htaccess file...

How isn't it working? What happens? I would try one variable first, get
that working, then add the others. Also, I am not sure how it will
handle the space in Beginners Corner. Try passing simple values first.

I am assuming you have Apache compiled with mod_rewrite and you have the
proper settings in httpd.conf (ie. LoadModule). Did you restart Apache?

- Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
Thanks for replying.

It seems to be partly working.

/*
How isn't it working? What happens? I would try one variable first, get
that working, then add the others. Also, I am not sure how it will
handle the space in Beginners Corner. Try passing simple values first.
*/
Its a bit hard to explain what happens so see for yourself:
Heres the index page:
http://www.rizkhan.net/articles/articles.php
Heres the actual page:
http://www.rizkhan.net/articles/show.php?category=Beginners%20Cornersid=1id=1
and then if you modify it to:
http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1

it just shows me the index...which even links wrong.

Ok, will try to pass a value without the space in between.


/*
I am assuming you have Apache compiled with mod_rewrite and you have the
proper settings in httpd.conf (ie. LoadModule). Did you restart Apache?
*/

Yep, mod_rewrite is installed (http://rizkhan.net/phpinfo.php)
I did restart apache.

Any ideas?

-Ryan



On 1/14/2004 7:34:56 PM, Brad Pauly ([EMAIL PROTECTED]) wrote:
 On Wed, 2004-01-14 at 11:14, Ryan A wrote:
  Hi,
  I have a blog kind of app running on my site...presently it shows like
 this:
  show.php?category=Beginners%20Cornersid=1id=1
 
  After searching on google on how to make my blog my search engine
 friendly I
  came accorss
  mod_rewrite and couple of tutorials on it, finally the one I understood
 and
  tried to use was this one:
 
  http://www.phpfreaks.com/tutorials/23/0.php
 
  so I added this to my .htaccess:
  RewriteEngine On
  RewriteRule ^show/(.*)/(.*)/(.*).php
  /show.php?category=Beginners%20Cornersid=$2id=$3
 
  and added this to my httpd.conf:
  AccessFileName .htaccess
  Files ~ ^\.ht
  AllowOverride all
  Order allow,deny
  Deny from all
  Satisfy All
  /Files
 
  Directory /usr/local/www/rizkhan.net/www/articles
  Options ExecCGI FollowSymLinks Includes MultiViews
  AllowOverride all
  /Directory
 
  But somehow its not working :-(( I made the changes in the httpd.conf
 and
  also in a .htaccess file...

 How isn't it working? What

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



Re: [PHP] Compiling php for MySQL and Apache 2 Newbie

2004-01-14 Thread R'twick Niceorgaw
Hi James,

James Marcinek wrote:

Hello Everyone,

I'm still having problems compiling the latest version of PHP. I have
several issues

- The apache 2 that was installed was from a Red Hat package. From what I
can tell it is configured in a manner that is similar to the
with-apxs2filter. The configuration file that point to this kind of
installation is already configured in apache. However there is no perl
script apxs of any kind.

  

install httpd-devel package. I believe it contains the apxs module.

HTH
R'twick Niceorgaw

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



Re: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Marek Kilimajer wrote:
 I don't know what the character is but if you paste it into the
 textarea, ord() will tell you.

I have done some further testing.  I created a form with a text area. 
When you hit submit, it just redisplays what ever you typed.  Now, using 
this new test script if I cut and paste from MS-Word, there is no problem.

So that leads me to believe that it has something to do with either 
writing the CLOB onto the Oracel database or retrieving the CLOB from 
the Oracle database.  In either of those two actions, the data is 
becoming corrupted of sorts

I'm currently playing around with my arrangment of stripslashes, 
htmlentities and nl2br.  Trying to arrange them either before placing 
onto the database or after retrieval.

I'm also creating a test where I just cut and paste  into the area and 
use ord() to find out what it's returning...

Thanks for the tip(s)!

R


Roger Spears wrote:

Hello,

This question may border on OT...

I have a web form where visitors must enter large amounts of text at 
one time (text area).  Once submitted, the large amount of text is 
stored as a CLOB in an Oracle database.

Some of my visitors create their text in Ms-Word and then cut and 
paste it into the text area and then submit the form.

When I retrieve it from the database, I do a stripslahses, 
htmlentities and nl2br in that order to preserve the format of the 
submitted test. When I view this text, single or double quotes show up 
as little white square blocks.  I've tested this out with MS-Word on a 
windows machine and a mac machine.  Same thing happens with either 
OS.  This only happens when they cut and paste from MS-Word into the 
text area.  If they type text into the text area directly, everything 
is fine...

I know I can search through their submitted text and swap out the 
unrecognized character and insert the proper one.  I just don't know 
what to look for as being the unrecognized character.

I've googled all over looking at ascII charts and keyboard maps. 
Nothing mentions MS-Word specific information though.

Anyone out there dealt with this before?

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


Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 02:44, Ryan A wrote:

 It seems to be partly working.

 /*
 How isn't it working? What happens? I would try one variable first, get
 that working, then add the others. Also, I am not sure how it will
 handle the space in Beginners Corner. Try passing simple values first.
 */
 Its a bit hard to explain what happens so see for yourself:
 Heres the index page:
 http://www.rizkhan.net/articles/articles.php
 Heres the actual page:
 http://www.rizkhan.net/articles/show.php?category=Beginners%20Cornersid=1;
id=1 and then if you modify it to:
 http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1

 it just shows me the index...which even links wrong.

 Ok, will try to pass a value without the space in between.

   RewriteRule ^show/(.*)/(.*)/(.*).php
   /show.php?category=Beginners%20Cornersid=$2id=$3

It doesn't look like your rule would match. Try:
  RewriteRule ^show/(.*)/(.*)/(.*)

Another way to achieve a similar result without using Rewrite is to parse 
$_SERVER['REQUEST_URI'], and possibly $_SERVER['PATH_INFO']

Eg if your link is:

  http://www.rizkhan.net/articles/show.php/Beginners%20Corner/1/1

Then $_SERVER['REQUEST_URI'] would contain

  /articles/show.php/Beginners%20Corner/1/1

and $_SERVER['PATH_INFO'] would contain

  /Beginners%20Corner/1/1

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
You'd like to do it instantaneously, but that's too slow.
*/


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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 11:44, Ryan A wrote:

[snip]

 Its a bit hard to explain what happens so see for yourself:
 Heres the index page:
 http://www.rizkhan.net/articles/articles.php
 Heres the actual page:
 http://www.rizkhan.net/articles/show.php?category=Beginners%20Cornersid=1id=1
 and then if you modify it to:
 http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1

[snip]

 Any ideas?

One thing I noticed is that your rule is looking for a .php at the end
so the above url will not match.

RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*).php
/show.php?category=Beginners%20Cornersid=$2id=$3

I don't remember for sure, but do you need an [L] at the end of the
second line?

- Brad

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



Re: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Marek Kilimajer wrote:
 I don't know what the character is but if you paste it into the
 textarea, ord() will tell you.

When I run ord(), it returns the value of 19.  I'm guessing that is a 
hex value.  And when I look that up on the ascII table, it says:
19 DC3 (Device Control 3)

For some reason when it retrieves the CLOB from the database it is 
converting any  that were created with MS-Word into this DC3 character.

Strange indeed

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


Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Lowell Allen
 On Thursday 15 January 2004 02:44, Ryan A wrote:
 
 It seems to be partly working.
 
 /*
 How isn't it working? What happens? I would try one variable first, get
 that working, then add the others. Also, I am not sure how it will
 handle the space in Beginners Corner. Try passing simple values first.
 */
 Its a bit hard to explain what happens so see for yourself:
 Heres the index page:
 http://www.rizkhan.net/articles/articles.php
 Heres the actual page:
 http://www.rizkhan.net/articles/show.php?category=Beginners%20Cornersid=1;
 id=1 and then if you modify it to:
 http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1
 
 it just shows me the index...which even links wrong.
 
 Ok, will try to pass a value without the space in between.
 
 RewriteRule ^show/(.*)/(.*)/(.*).php
 /show.php?category=Beginners%20Cornersid=$2id=$3
 
 It doesn't look like your rule would match. Try:
 RewriteRule ^show/(.*)/(.*)/(.*)
 
 Another way to achieve a similar result without using Rewrite is to parse
 $_SERVER['REQUEST_URI'], and possibly $_SERVER['PATH_INFO']
 
 Eg if your link is:
 
 http://www.rizkhan.net/articles/show.php/Beginners%20Corner/1/1
 
 Then $_SERVER['REQUEST_URI'] would contain
 
 /articles/show.php/Beginners%20Corner/1/1
 
 and $_SERVER['PATH_INFO'] would contain
 
 /Beginners%20Corner/1/1

Ryan,

I'm doing what I believe Jason is indicating above. I'm sure in your
research you read the articles about URL rewriting on A List Apart,
specifically this one: http://www.alistapart.com/articles/succeed/. Using
a similar approach, I'm saving page content in a database with the unique
identifier set to the desired value of $REQUEST_URI. After redirecting all
requests to index.php as described in the article, I use code in index.php
similar to what's in the article, plus this for the database content:

-

// check for database content
$conn = db_connect();
if (!$conn) {
$db_error = mysql_error();
include(error_page.php);
exit();
}
// get the page details from db
$request = substr($REQUEST_URI, 1);
$results = mysql_query(SELECT DisplayStatus FROM Pages WHERE
MenuPath='$request' AND DisplayStatus='Y');
if (!$results) {
$db_error = mysql_error();
include(error_page.php);
exit();
}
if (mysql_num_rows($results)  0) {
include(page.php);
exit();
}

// if request has not been matched, include custom error page
include(notfound.php);
exit();

-

That pulls page content based on $REQUEST_URI. I build site menus from the
database, using values from the MenuPath field as URLs.

HTH

--
Lowell Allen

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



[PHP] Re: PHP, MySQL problem

2004-01-14 Thread Jan Grafström
Hi

Add records with this code.
?php
$name=isset($_POST['name']) ? $_POST['name'] :'';
$address=isset($_POST['address']) ? $_POST['address'] :'';
if (!empty($name)) {
mysql_connect($server,$user,$pass) or die (Error conecting);
mysql_select_db($dbnamn,$conection) or die (no db .$dbnamn);
$query = insert into mytable (name, address) values ('$name', '$address');
$result = mysql_query ($query) or die(bad query);
}
?
html
head/head
body
form action= method=post
name input name=name
address input name=address
input type=submit value=add record
/form
/body/html

Hope this helps.
Jan


Nicolai Elmqvist [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 Hi

 I have just started working with PHP and MySQL and have gone through 3
 tutorials on how to add and delete records from a database. Nearly
 everything is working, as it should except for the communication between
 HTML form and PHP. If I try to add a record to my database by pushing a
 submit the text in the textboxes are deleted but no record is inserted
in
 the database. I have copied the code directly form the tutorials so
spelling
 mistakes should not be the problem.



 It is possible to add records manually in the code so the connection to
and
 from the database is ok.



 So, does anybody know what I the problem might be?



 I'm using PHP 4.3.4, MySQL 4.0.17 and an Apache server.



 On before hand, thank you.

 Nicolai Elmqvist

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey Jason, Brad,
Thanks for replying.

I took out the .php part...and even tried it with [L] tacked to the end of
the second linenot working
Heres how my .htaccess looks now:

RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetrysid=$2id=$3

I even took out the space which was in category.

Any ideas?

Thanks,
-Ryan


On 1/14/2004 8:11:47 PM, Brad Pauly ([EMAIL PROTECTED]) wrote:
 On Wed, 2004-01-14 at 11:44, Ryan A wrote:

 [snip]

  Its a bit hard to explain what happens so see for yourself:
  Heres the index page:
  http://www.rizkhan.net/articles/articles.php
  Heres the actual page:
  http://www.rizkhan.net/articles/show.
 php?category=Beginners%20Cornersid=1id=1
  and then if you modify it to:
  http://www.rizkhan.net/articles/show/Beginners%20Corner/1/1

 [snip]

  Any ideas?

 One thing I noticed is that your rule is looking for a .php at the end
 so the above url will not match.

 RewriteEngine On
 RewriteRule ^show/(.*)/(.*)/(.*).php
 /show.php?category=Beginners%20Cornersid=$2id=$3

 I don't remember for sure, but do you need an [L] at the end of the
 second line?

 - Brad

 --
 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] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 12:41, Ryan A wrote:
 Hey Jason, Brad,
 Thanks for replying.
 
 I took out the .php part...and even tried it with [L] tacked to the end of
 the second linenot working
 Heres how my .htaccess looks now:
 
 RewriteEngine On
 RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetrysid=$2id=$3
 
 I even took out the space which was in category.
 
 Any ideas?

Do you have a print or echo in show.php to see if you are getting there?
I would work on getting the rule to take you to the right place first,
then worry about the variables.

- Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Lowell Allen
[snip]
 
 I took out the .php part...and even tried it with [L] tacked to the end of
 the second linenot working
 Heres how my .htaccess looks now:
 
 RewriteEngine On
 RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetrysid=$2id=$3
 
 I even took out the space which was in category.
 
 Any ideas?
 
[snip]

Make sure you upload the .htaccess file as ASCII mode, not binary. (That
wasted lots of my time recently.)

--
Lowell Allen

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
Ok, have added echo Ok,we are in show.php; and if you go to 
http://rizkhan.net/articles/show/category/1/2 or
http://rizkhan.net/articles/show.php?category=poetrysid=1id=2

you will see that its echoing that without a problem..so this is
partly working.

now what to do about the variables?

Thanks,
-Ryan 
 
 Do you have a print or echo in show.php to see if you are getting there?
 I would work on getting the rule to take you to the right place first,
 then worry about the variables.
 
 - Brad
 
 --
 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] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 13:14, Ryan A wrote:
 Hey,
 Ok, have added echo Ok,we are in show.php; and if you go to 
 http://rizkhan.net/articles/show/category/1/2 or
 http://rizkhan.net/articles/show.php?category=poetrysid=1id=2
 
 you will see that its echoing that without a problem..so this is
 partly working.
 
 now what to do about the variables?

Well, are any of them in $_GET? If so, are they getting assigned to the
right place? How about putting a print_r($_GET) in show.php.

- Brad

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



Re: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Dagfinn Reiersøl
Roger Spears wrote:

Marek Kilimajer wrote:
 I don't know what the character is but if you paste it into the
 textarea, ord() will tell you.

When I run ord(), it returns the value of 19.  I'm guessing that is a 
hex value.  And when I look that up on the ascII table, it says:
19 DC3 (Device Control 3)

For some reason when it retrieves the CLOB from the database it is 
converting any  that were created with MS-Word into this DC3 character.
According to the table at:

http://www.bbsinc.com/iso8859.html

the start quote character in the Windows Latin-1 character set is hex 93
= hex 80 + 13 = decimal 128 + 19. So it seems the 8-bit character has
lost its highest bit and become a 7-bit character.
Strange indeed
Stranger things have happened...

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


Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
I put this in for testing:

if(isset($_GET[id])){echo Got \$_GET[id]br;}else{echo No
\$_GET[id]br;}
if(isset($_GET[sid])){echo Got \$_GET[sid]br;}else{echo No
\$_GET[sid]br;}

and heres the output:
No $_GET[id]
No $_GET[sid]

So the variables are not being passed
Any idea why and what I can do about this?
(Am a total newbie here)

Cheers,
-Ryan



On 1/14/2004 9:27:03 PM, Brad Pauly ([EMAIL PROTECTED]) wrote:
 On Wed, 2004-01-14 at 13:14, Ryan A wrote:
  Hey,
  Ok, have added echo Ok,we are in show.php; and if you go to
  http://rizkhan.net/articles/show/category/1/2 or
  http://rizkhan.net/articles/show.php?category=poetrysid=1id=2
 
  you will see that its echoing that without a problem..so this is
  partly working.
 
  now what to do about the variables?

 Well, are any of them in $_GET? If so, are they getting assigned to the
 right place? How about putting a print_r($_GET) in show.php.

 - Brad

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



[PHP] alternative to protecting files through http auth.

2004-01-14 Thread Scott Taylor


Is there no other way to protect your (non PHP) files than through 
authentication?  I've been trying to set up a system that will protect 
files.  Those trying to access the files would only be able to do so 
after entering their email address.  So I set up a form that submits the 
email to my database.  But then the problem is: how to access the 
files?  I could just use http://username:password/test.com/test.jpg 
method, but then what would be the point of trying to protect the files 
in the first place?  It would simply be the same as with holding the 
link to begin with.   So is there an alternative to using http basic 
authentication to protect files?  Or is there a simple way to 
authenticate the pages themselves without using something like Manuel 
Lemos' PHP HTTP class?

Best Regards,

Scott Taylor

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


RE: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Williams, Olwen - SAL
I't the Word smart quotes.  A bit of experimenting suggests ASCII 145 and
146 for single quotes and 147 and 148 for double quotes.  I have the same
problem with my forms, and for me they display okay in IE, but not in
Mozilla.  I must put some editing in place for this :-)  

Olwen Williams
[EMAIL PROTECTED]


-Original Message-
From: Roger Spears [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 6:07 AM
To: PHP - General
Subject: [PHP] is ' or  different in MS-Word then ascII?


Hello,

This question may border on OT...

Some of my visitors create their text in Ms-Word and then cut and paste 
it into the text area and then submit the form.

When I retrieve it from the database, I do a stripslahses, htmlentities 
and nl2br in that order to preserve the format of the submitted test. 
When I view this text, single or double quotes show up as little white 
square blocks.  I've tested this out with MS-Word on a windows machine 
and a mac machine.  Same thing happens with either OS.  This only 
happens when they cut and paste from MS-Word into the text area.  If 
they type text into the text area directly, everything is fine...

I know I can search through their submitted text and swap out the 
unrecognized character and insert the proper one.  I just don't know 
what to look for as being the unrecognized character.


CAUTION - This message may contain privileged and confidential 
information intended only for the use of the addressee named above.
If you are not the intended recipient of this message you are hereby 
notified that any use, dissemination, distribution or reproduction 
of this message is prohibited. If you have received this message in 
error please notify Safe Air Ltd immediately. Any views expressed 
in this message are those of the individual sender and may not 
necessarily reflect the views of Safe Air.
_
For more information on the Safe Air Group, visit us online
at http://www.safeair.co.nz/ 
_

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



[PHP] Re: alternative to protecting files through http auth.

2004-01-14 Thread Paul Chvostek
On Wed, Jan 14, 2004 at 04:17:06PM -0500, Scott Taylor wrote:
 
 Is there no other way to protect your (non PHP) files than through 
 authentication?  I've been trying to set up a system that will protect 
 files.  Those trying to access the files would only be able to do so 
 after entering their email address.  So I set up a form that submits the 
 email to my database.  But then the problem is: how to access the files?

Put the files in a directory somewhere outside the DocumentRoot of the
web site in which the PHP code lives.  Have the PHP code do whatever
authentication you want (even if it's just collecting an email
address), and upon success, use file() or readfile() or include() or
file_get_contents() or equivalent to pull the file contents from their
location on the server.

Alternately, if you aren't able to create directories or access files
outside the DocumentRoot for your site, you can create an unbrowsable
storage directory protected with a .htaccess file.  If the filesystem
permissions are correct, your PHP script will be able to read content
from that directory, because PHP code isn't subject to .htaccess rules.

-- 
  Paul Chvostek [EMAIL PROTECTED]
  it.canadahttp://www.it.ca/
  Free PHP web hosting!http://www.it.ca/web/

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



[PHP] Re: alternative to protecting files through http auth.

2004-01-14 Thread Luke
there has been a discussion in this group recently about URL re-writing (see
URL rewriting...anybody done this? and replies)

That is a possibility, using a combination of

URL Re-Writing
PHP Sessions/Cookies
And the Location: header

So all requests go back to the index, then you decide from the index.php
page if they have to be redirected, or if they are already logged in, or if
they dont have permission

That might work

-- 
Luke
Scott Taylor [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]


 Is there no other way to protect your (non PHP) files than through
 authentication?  I've been trying to set up a system that will protect
 files.  Those trying to access the files would only be able to do so
 after entering their email address.  So I set up a form that submits the
 email to my database.  But then the problem is: how to access the
 files?  I could just use http://username:password/test.com/test.jpg
 method, but then what would be the point of trying to protect the files
 in the first place?  It would simply be the same as with holding the
 link to begin with.   So is there an alternative to using http basic
 authentication to protect files?  Or is there a simple way to
 authenticate the pages themselves without using something like Manuel
 Lemos' PHP HTTP class?

 Best Regards,

 Scott Taylor

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 05:01, Ryan A wrote:

 I put this in for testing:

 if(isset($_GET[id])){echo Got \$_GET[id]br;}else{echo No
 \$_GET[id]br;}
 if(isset($_GET[sid])){echo Got \$_GET[sid]br;}else{echo No
 \$_GET[sid]br;}

 and heres the output:
 No $_GET[id]
 No $_GET[sid]

 So the variables are not being passed
 Any idea why and what I can do about this?
 (Am a total newbie here)

As was previously suggested just do a 

  print_r($_GET)

to see what, if anything, you're getting.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Price's Advice:
It's all a game -- play it to have fun.
*/

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Oops sorry, missed that.

Heres whats on top of the page:

echo Ok,we are in show.phpbr;
if(isset($_GET[id])){echo Got \$_GET[id]br;}else{echo No
\$_GET[id]br;}
if(isset($_GET[sid])){echo Got \$_GET[sid]br;}else{echo No
\$_GET[sid]br;}
print_r($_GET);
print_r($_GET['id']);
print_r($_GET['sid']);

and heres the output:

Ok,we are in show.php
No $_GET[id]
No $_GET[sid]
Array ( )


Ideas?

Cheers,
-Ryan




On 1/14/2004 10:56:35 PM, Jason Wong ([EMAIL PROTECTED]) wrote:
 On Thursday 15 January 2004 05:01, Ryan A wrote:

  I put this in for testing:
 
  if(isset($_GET[id])){echo Got \$_GET[id]br;}else{echo
 No
  \$_GET[id]br;}
  if(isset($_GET[sid])){echo Got \$_GET[sid]br;}else{echo
 No
  \$_GET[sid]br;}
 
  and heres the output:
  No $_GET[id]
  No $_GET[sid]
 
  So the variables are not being passed
  Any idea why and what I can do about this?
  (Am a total newbie here)

 As was previously suggested just do a

 print_r($_GET)

 to see what, if anything,
 you're getting.

 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-general
 --
 /*
 Price's
 Advice:
 It's all a game -- play it to have fun.
 */

 --
 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] Missing Array Key with apache_request_headers()

2004-01-14 Thread Philip Pawley
Hello,

I don't get this at all.

I'm trying to use php to manipulate my HTTP headers. 

[ Background Info about HTTP headers.]
[ If an ETag header is sent by the server, then, next time a user-agent requests the 
same page, it sends back that header's value - in an If-None-Match header. ] 

The problem comes when I try to access the If-None-Match header using 
apache_request_headers(). 

With Mozilla (I'm using 1.6b) the If-Modified-Since header is in the array. 
With Internet Explorer 6, it isn't, even though the header is sent out. (I'm checking 
the header output with the Proxomitron).

Why is this happening and what can I do about it?

Here are all the details:
---
The page I'm testing this with:
?php
header(ETag: asdfghjkl);

$headers = apache_request_headers();
print_r(array_keys($headers));
exit;
?
-
The Mozilla output on reload:

Array ( [0] = Accept [1] = Accept-Charset [2] = Accept-Encoding [3] = 
Accept-Language [4] = Cache-Control [5] = Connection [6] = Host [7] = 
If-None-Match [8] = Keep-Alive [9] = User-Agent )

and from the Prox:
GET /test.php HTTP/1.1
Host: pc
User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6b) Gecko/20031208
Accept: 
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
If-None-Match: asdfghjkl
Cache-Control: max-age=0
Connection: keep-alive
---
The IE6 output on reload is:

Array ( [0] = Accept [1] = Accept-Encoding [2] = Accept-Language [3] = Connection 
[4] = Host [5] = Pragma [6] = User-Agent )

and from the Prox:
GET /test.php HTTP/1.1
Accept: */*
Accept-Language: en
Accept-Encoding: gzip, deflate
If-None-Match: asdfghjkl
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Host: pc
Pragma: no-cache
Connection: keep-alive

As you can see, in both cases, all the request headers shown by the Proxomitron are 
also in the array - with the exception, for IE6, of the If-None-Match header.

Thanks in advance for your responses,

Philip Pawley

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



[PHP] multi-table select?

2004-01-14 Thread Kirk Babb
I'm looking for a good way to do the following:

I have two tables, one named teams and one named divisions.
Divisions relates divisionID to the name of the division
(division_name).  In teams I have the divisionID stored
along with the team_name.  [BG info: teams can be relegated
or promoted so it's easier for me to store the divID in
the teams table] I'd like to populate a drop down menu with
the team_name and division_name and was wondering if I can 
do some kind of select statement that will get all the info
at once with the following details on the two tables:

mysql select * from teams;
++---+-++--++-+--+-+---+---+
| teamID | team_name | coachID | divisionID | paid | pmnt_notes | win | loss | tie | 
goals_for | goals_against |
++---+-++--++-+--+-+---+---+
|  1 | Metro |   0 |  1 | n| NULL   |   0 |0 |   0 |   
  0 | 0 |
++---+-++--++-+--+-+---+---+
1 row in set (0.00 sec)
 
mysql select * from divisions;
++--+
| divisionID | division_name|
++--+
|  1 | Premier  |
|  2 | Classic  |
|  3 | Recreational 7v7 |
++--+
3 rows in set (0.00 sec)

Thanks in advance!
Kirk

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Brad Pauly
On Wed, 2004-01-14 at 15:11, Ryan A wrote:

[snip]

 and heres the output:
 
 Ok,we are in show.php
 No $_GET[id]
 No $_GET[sid]
 Array ( )
 
 
 Ideas?

Seems like you are getting closer. You are going to the right place, but
none of your variables are making it. I am not sure what your rule looks
like now, but at one point it was:

RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetrysid=$2id=$3

I would recommend trying just one variable first. See if you can get
that to work, then add the others one at a time. Maybe something like
this to start with:

RewriteRule ^show/(.*) /show.php?foo=$1

And see what $_GET looks like.

- Brad

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



Re: [PHP] multi-table select?

2004-01-14 Thread Toby Irmer
Try

SELECT teams.*, divisions.id AS divisonid, divisions.name AS divisionname
FROM teams LEFT JOIN divisions ON teams.divisonID = divisions.divisionID

if the ids are the same you can actually also write

ON teams.divisonID

and omit

= divisions.divisionID

... I think.


hth

toby
 I'm looking for a good way to do the following:

 I have two tables, one named teams and one named divisions.
 Divisions relates divisionID to the name of the division
 (division_name).  In teams I have the divisionID stored
 along with the team_name.  [BG info: teams can be relegated
 or promoted so it's easier for me to store the divID in
 the teams table] I'd like to populate a drop down menu with
 the team_name and division_name and was wondering if I can
 do some kind of select statement that will get all the info
 at once with the following details on the two tables:

 mysql select * from teams;

++---+-++--++-+-
-+-+---+---+
 | teamID | team_name | coachID | divisionID | paid | pmnt_notes | win |
loss | tie | goals_for | goals_against |

++---+-++--++-+-
-+-+---+---+
 |  1 | Metro |   0 |  1 | n| NULL   |   0 |
0 |   0 | 0 | 0 |

++---+-++--++-+-
-+-+---+---+
 1 row in set (0.00 sec)

 mysql select * from divisions;
 ++--+
 | divisionID | division_name|
 ++--+
 |  1 | Premier  |
 |  2 | Classic  |
 |  3 | Recreational 7v7 |
 ++--+
 3 rows in set (0.00 sec)

 Thanks in advance!
 Kirk

 --
 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] multi-table select?

2004-01-14 Thread Martin Towell
This is a basic table join:

select * from teams, divisions where teams.divisionID = divisions.divisionID



 -Original Message-
 From: Kirk Babb [mailto:[EMAIL PROTECTED]
 Sent: Thursday, 15 January 2004 9:41 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] multi-table select?
 
 
 I'm looking for a good way to do the following:
 
 I have two tables, one named teams and one named divisions.
 Divisions relates divisionID to the name of the division
 (division_name).  In teams I have the divisionID stored
 along with the team_name.  [BG info: teams can be relegated
 or promoted so it's easier for me to store the divID in
 the teams table] I'd like to populate a drop down menu with
 the team_name and division_name and was wondering if I can 
 do some kind of select statement that will get all the info
 at once with the following details on the two tables:
 
 mysql select * from teams;
 ++---+-++--+--
 --+-+--+-+---+---+
 | teamID | team_name | coachID | divisionID | paid | 
 pmnt_notes | win | loss | tie | goals_for | goals_against |
 ++---+-++--+--
 --+-+--+-+---+---+
 |  1 | Metro |   0 |  1 | n| NULL 
   |   0 |0 |   0 | 0 | 0 |
 ++---+-++--+--
 --+-+--+-+---+---+
 1 row in set (0.00 sec)
  
 mysql select * from divisions;
 ++--+
 | divisionID | division_name|
 ++--+
 |  1 | Premier  |
 |  2 | Classic  |
 |  3 | Recreational 7v7 |
 ++--+
 3 rows in set (0.00 sec)
 
 Thanks in advance!
 Kirk
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 __ Information from NOD32 1.594 (20040107) __
 
 This message was checked by NOD32 for Exchange e-mail monitor.
 http://www.nod32.com
 
 
 
 

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



[PHP] Re: alternative to protecting files through http auth.

2004-01-14 Thread Scott Taylor
Paul Chvostek wrote:

On Wed, Jan 14, 2004 at 04:17:06PM -0500, Scott Taylor wrote:
 

Is there no other way to protect your (non PHP) files than through 
authentication?  I've been trying to set up a system that will protect 
files.  Those trying to access the files would only be able to do so 
after entering their email address.  So I set up a form that submits the 
email to my database.  But then the problem is: how to access the files?
   

Put the files in a directory somewhere outside the DocumentRoot of the
web site in which the PHP code lives.  Have the PHP code do whatever
authentication you want (even if it's just collecting an email
address), and upon success, use file() or readfile() or include() or
file_get_contents() or equivalent to pull the file contents from their
location on the server.
Alternately, if you aren't able to create directories or access files
outside the DocumentRoot for your site, you can create an unbrowsable
storage directory protected with a .htaccess file.  If the filesystem
permissions are correct, your PHP script will be able to read content
from that directory, because PHP code isn't subject to .htaccess rules.
 

Thank you very much.  That is exactly what I was looking for.

Best Regards,

Scott Taylor

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


Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
At least you remember what it used to look like, I dont!
Soo many modificatios in both .htaccess and httpd.conf and restarts...have
just lost track.

Will try your example one at a time and see what happens.

Thanks again.

Cheers,
-Ryan

 Seems like you are getting closer. You are going to the right place, but
 none of your variables are making it. I am not sure what your rule looks
 like now, but at one point it was:

 RewriteRule ^show/(.*)/(.*)/(.*) /show.php?category=poetrysid=$2id=$3

 I would recommend trying just one variable first. See if you can get
 that to work, then add the others one at a time. Maybe something like
 this to start with:

 RewriteRule ^show/(.*) /show.php?foo=$1

 And see what $_GET looks like.

 - Brad

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Matt Matijevich
I am a little late but I have used the method described on a list apart
http://www.alistapart.com/articles/succeed/ and it works really
well.
You might want to give it a try, I think it works a little bit
different than the way you are trying.

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



Re: [PHP] multi-table select?

2004-01-14 Thread Toby Irmer
i must overlooked that... no wonder my pages all take ages to load *g*  ;)
;)


- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: 'Kirk Babb' [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Wednesday, January 14, 2004 11:52 PM
Subject: RE: [PHP] multi-table select?


 This is a basic table join:

 select * from teams, divisions where teams.divisionID =
divisions.divisionID

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



[PHP] SOLVED= is ' or different in MS-Word then ascII?

2004-01-14 Thread Roger Spears
Hello Everybody,

I have found a solution and/or the root of the problem.  I googled on 
the topic of MS-Word + smart quotes.

That lead me to this site:
http://www.rpgtimes.net/rpgtimes/guide.php?guide=1
It seems that the default for Word is to have smart quotes to on. 
When you have smart quotes on it replaces the ordinary straight quotes 
with a left specific and right specific quote.

To correct this:
Go into TOOLSAUTO-CORRECTAUTO-FORMATremove checkmark from replace 
straight quotes with smart quotes.  Also in TOOLSAUTO-CORRECT you must 
remove the line in AUTO-REPLACE about replacing ... with three dots that 
are closer together.

Once I did that, my problem was solved  Thanks to all who have 
helped today.  I appreaciate it!!

BEFORE I changed these two Word settings, when writing to the database, 
the ord() (ordinate) value for the left quote was 147 and the right 
quote was 148.  When being retrieved from the database, the ord() 
(ordinate) value for the left quote was 17 and the right quote was 19.

Thanks again to everyone who offered help!

Roger

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


Re: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Tom Rogers
Hi,

Thursday, January 15, 2004, 3:07:02 AM, you wrote:
RS Hello,

RS This question may border on OT...

RS I have a web form where visitors must enter large amounts of text at one
RS time (text area).  Once submitted, the large amount of text is stored as
RS a CLOB in an Oracle database.

RS Some of my visitors create their text in Ms-Word and then cut and paste
RS it into the text area and then submit the form.

RS When I retrieve it from the database, I do a stripslahses, htmlentities
RS and nl2br in that order to preserve the format of the submitted test.
RS When I view this text, single or double quotes show up as little white
RS square blocks.  I've tested this out with MS-Word on a windows machine
RS and a mac machine.  Same thing happens with either OS.  This only 
RS happens when they cut and paste from MS-Word into the text area.  If
RS they type text into the text area directly, everything is fine...

RS I know I can search through their submitted text and swap out the 
RS unrecognized character and insert the proper one.  I just don't know
RS what to look for as being the unrecognized character.

RS I've googled all over looking at ascII charts and keyboard maps. 
RS Nothing mentions MS-Word specific information though.

RS Anyone out there dealt with this before?

RS Thanks,
RS R


The quotes are actually a sequence of three bytes with values like

226 128 156
226 128 157

for the 2 quotes

here is a bit of code to fix them and a few others, I would be
interested if anyone knew the complete set of these weirdos :)

$crap = 
array(chr(226).chr(128).chr(147),chr(226).chr(128).chr(156),chr(226).chr(128).chr(157),chr(226).chr(128).chr(153));
$clean = array('-','','',');
$content = str_replace($crap,$clean,$text);

-- 
regards,
Tom

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hi again,
I did a little pokeing around and installed this on 3 differient
serversand the results were identical...
so its not the servers fault but something with the directives...

got some interesting results with my testing

am using this:
echo Ok,we are in show.phpbr;
if(isset($_GET[id])){echo Got \$_GET[id]br;}else{echo No
\$_GET[id]br;}
if(isset($_GET[sid])){echo Got \$_GET[sid]br;}else{echo No
\$_GET[sid]br;}
print_r($_GET);

This is still not working:
http://rizkhan.net/articles/show/2/1
(output is:  )
Ok,we are in show.php
No $_GET[id]
No $_GET[sid]
Array ( )

This gives the exact expected results (working)
http://rizkhan.net/articles/show/?sid=1id=2 (note I dont have to write
show.php)

This gives me screwy results:
http://rizkhan.net/articles/show/?1/2
(output is:  )
Ok,we are in show.php
No $_GET[id]
No $_GET[sid]
Array ( [1/2] = )

in case you guys forgot, this is what i entered into my httpd.conf:

Directory /path/to/directory #of course i entered the correct path#
Options ExecCGI FollowSymLinks Includes MultiViews
AllowOverride all
/Directory

This is my htaccess file:

RewriteEngine On
RewriteRule ^show/(.*)/(.*) /show.php?sid=$1id=$2

incase i forgot to mention it...this #¤#¤# thing is not working.


ANY ideas?

Thanks,
-Ryan

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Justin Patrin
RewriteEngine On
RewriteRule ^show/(.*)/(.*) /show.php?sid=$1id=$2
Try:
RewriteRule ^show/([^/]*)/([^/]*) /show.php?sid=$1id=$2
--
paperCrane Justin Patrin
--
Question Everything, Reject Nothing
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Script Needed

2004-01-14 Thread Eric Belardo
Good evening all,
 
I am designing a website were different users will be posting their
portfolios and I am seeking a PHP Contact form script that will email
JUST the person on the profile and the profiled person's email will
remain anonymous. 
 
Does anyone know if this script exists??
 
Eric Belardo


Re: [PHP] Script Needed

2004-01-14 Thread Philip J. Newman
payme $80 a hour and i can write one ... (o;

- Original Message - 
From: Eric Belardo [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, January 15, 2004 2:33 PM
Subject: [PHP] Script Needed


 Good evening all,
  
 I am designing a website were different users will be posting their
 portfolios and I am seeking a PHP Contact form script that will email
 JUST the person on the profile and the profiled person's email will
 remain anonymous. 
  
 Does anyone know if this script exists??
  
 Eric Belardo
 

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Ryan A
Hey,
Thanks for replying.

Nope, does not work.

Looks like I got a problem that finally stumped the whole listlucky me
:-p

Cheers,
-Ryan

On 1/15/2004 2:28:33 AM, Justin Patrin ([EMAIL PROTECTED]) wrote:
  RewriteEngine On
  RewriteRule ^show/(.*)/(.*) /show.php?sid=$1id=$2

 Try:
 RewriteRule ^show/([^/]*)/([^/]*) /show.php?sid=$1id=$2

 --
 paperCrane Justin Patrin
 --
 Question Everything, Reject Nothing

 --
 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] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 09:28, Justin Patrin wrote:
  RewriteEngine On
  RewriteRule ^show/(.*)/(.*) /show.php?sid=$1id=$2

 Try:
 RewriteRule ^show/([^/]*)/([^/]*) /show.php?sid=$1id=$2

The original ought to work just fine -- I have it working here.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Don't put off for tomorrow what you can do today because if you enjoy it 
today,
you can do it again tomorrow.
*/

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



Re: [PHP] URL rewriting...anybody done this?

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 09:42, Ryan A wrote:

 Nope, does not work.

 Looks like I got a problem that finally stumped the whole listlucky me

This works fine for me:

RewriteEngine On
RewriteRule ^show/(.*)/(.*)/(.*) /show.php?a=$1b=$2c=$3

What version of Apache/PHP are you using?
Have you checked bugs.php.net?
You're not using some weirdo operating system like Windows are you?

If all else fails you can use the 'parse the URL' method that I outlined 
earlier.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
It is now 10 p.m.  Do you know where Henry Kissinger is?
-- Elizabeth Carpenter
*/

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



Re[2]: [PHP] is ' or different in MS-Word then ascII?

2004-01-14 Thread Tom Rogers
Hi,

Thursday, January 15, 2004, 10:41:57 AM, you wrote:
TR Hi,

TR Thursday, January 15, 2004, 3:07:02 AM, you wrote:
RS Hello,

RS This question may border on OT...

RS I have a web form where visitors must enter large amounts of text at one
RS time (text area).  Once submitted, the large amount of text is stored as
RS a CLOB in an Oracle database.

RS Some of my visitors create their text in Ms-Word and then cut and paste
RS it into the text area and then submit the form.

RS When I retrieve it from the database, I do a stripslahses, htmlentities
RS and nl2br in that order to preserve the format of the submitted test.
RS When I view this text, single or double quotes show up as little white
RS square blocks.  I've tested this out with MS-Word on a windows machine
RS and a mac machine.  Same thing happens with either OS.  This only
RS happens when they cut and paste from MS-Word into the text area.  If
RS they type text into the text area directly, everything is fine...

RS I know I can search through their submitted text and swap out the
RS unrecognized character and insert the proper one.  I just don't know
RS what to look for as being the unrecognized character.

RS I've googled all over looking at ascII charts and keyboard maps. 
RS Nothing mentions MS-Word specific information though.

RS Anyone out there dealt with this before?

RS Thanks,
RS R


TR The quotes are actually a sequence of three bytes with values like

TR 226 128 156
TR 226 128 157

TR for the 2 quotes

TR here is a bit of code to fix them and a few others, I would be
TR interested if anyone knew the complete set of these weirdos :)

TR $crap =
TR 
array(chr(226).chr(128).chr(147),chr(226).chr(128).chr(156),chr(226).chr(128).chr(157),chr(226).chr(128).chr(153));
TR $clean = array('-','','',');
TR $content = str_replace($crap,$clean,$text);

TR -- 
TR regards,
TR Tom

I am probably misleading you ... sorry
It seems scintilla is the one creating the 3 byte sequence for me from
a msword paste. Here is function to clean it to entities:

function clean_ms_word($text){
$crap = array(
Ox82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,
0x8a,0x8b,0x8c,0x91,0x92,0x93,0x94,0x95,
0x96,0x97,0x98,0x99,0x9a,0x9b,0x9c,9f
);
$clean = array(

'lsquor;','fnof;','ldquor;','ldots;','dagger;','Dagger;','','permil;','Scaron;',

'lsaquo;','OElig;','lsquo;','rsquo;','ldquo;','rdquo;','bull;','ndash;',
'mdash;','tilde;','trade;','scaron;','rsaquo;','oelig;','Yuml;'
);
$content = str_replace($crap,$clean,$text);
return $content;
}

-- 
regards,
Tom

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



RE: [PHP] Re: Ver 5.0 Questions ...

2004-01-14 Thread Mark Charette
If you read through the archives you'll find it isn't so much that PHP is
the problem per se, but many of the PHP modules. If you use the
multi-threading model of Apache 2 (the raison d'etre for using Apache 2 for
most people) then all the modules have to be thread-safe, and that's a
non-trivial matter for many of the module authors and maintainers. If you
use the pre-fork model of Apache 2 then you essentially have the regular
version of Apache.

 Don't expect it to be solved next few days.. There are some wierd
 problems I
 think... Kinda like you don't really know what could cause them or
 something...

 --
 // DvDmanDT
 MSN: dvdmandt¤hotmail.com
 Mail: dvdmandt¤telia.com
 Thomas Svenson [EMAIL PROTECTED] skrev i meddelandet
 news:[EMAIL PROTECTED]
  Hi Chris,
 
  Chris TenHarmsel wrote:
   Well, we're interested in stability.  I figured since php4 had
   been out for a while in stable form, it would be more stable
   than php5.  Is this the case, or is there a good feeling that
   php5 will be considered stable in the next couple months?
 
  I've been playing around with PHP5 since before beta 2 and haven't
 stumbled
  on any problems so far when coding using the new features
 (mainly the new
  oop model).
 
  However, I tried running a few PHP applications but they simply did not
 work
  properly in PHP5. It's not a big problem for me since I'm going to build
 my
  new project from scratch and have decided that, even if it
 isn't released
  yet, I'm going for PHP5 due to the new features in it.
 
  One thing that does disturb me a bit though is that very little is to be
  found about if the recommendation not to use Apache2 with PHP4
 still seems
  to apply for PHP5 as well. It's a bit  confusing since Apache2
 been stable
  for a long time. I am expecting that the issues not recommending it for
 PHP4
  will be solved for PHP5.
 
  /Thomas

 --
 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] Re: Script Needed

2004-01-14 Thread Ben Ramsey
The script should be easy enough to create on your own.  Just check the 
documentation on the mail() function at php.net.

-Ben

Eric Belardo wrote:

Good evening all,
 
I am designing a website were different users will be posting their
portfolios and I am seeking a PHP Contact form script that will email
JUST the person on the profile and the profiled person's email will
remain anonymous. 
 
Does anyone know if this script exists??
 
Eric Belardo

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


[PHP] upload picture: limit size problems

2004-01-14 Thread Matt Hedges
Hello,
with ya'lls help I've gotten a php that uploads only a jpg... now I'm trying
to add a constraint that limits the width and size...  I've been reading the
manual (don't understand the error_messages)... and can't figure it out...
this is what I have so far:

?
 $base_img_dir = images/;
 $uniq = uniqid();
 $extension=.jpg;
 $filename = $base_img_dir.$uniq.$extension;

if(isset( $Submit ))
{

if ($_FILES['imagefile']['type'] == image/pjpeg){

move_uploaded_file($_FILES[imagefile][tmp_name], $filename)
or die (Could not copy);

echo ;
echo Copy Done;
}

else {
echo ;
echo Could Not Copy, Wrong Filetype
(.$_FILES['imagefile']['name'].);
}
}


I know there's some easy way to do it...
thanks a lot,
Matt

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



RE: [PHP] Installing PHP on 2nd Windows Drive

2004-01-14 Thread Warren Vail
There is only one port 80 (the port used by your browser by default to
connect to apache), choose a different port for the second instance, and you
should be ok, but all url's will have to have a non-standard port number.

Same is true for MySQL (different port number, but same conflict).
Configure your 2nd MySQL to listen to a different port, and make sure that
all your PHP code connects to MySQL using the different (non-standard) port
number.

I'm guessing two things; 1) if there are other common dependencies, like
system registry (there is only one per machine) you will run into those and
2) other configuration dependencies (like things that need to be on the C:
drive) will pop up (like php.ini?).

My recommendation would be to get a 2nd cheap machine, and network them.  My
experience at doing this tells me machines are less expensive than the
headaches you are going to have with conflicts.  But you do stand to learn a
lot, or at the very least a lot of things that you will never use again.

good luck,

Warren Vail


-Original Message-
From: Freedomware [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 1:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Installing PHP on 2nd Windows Drive


I got a preconfigured package - Apache 2.0/PHP/MySQL - up and running,
then I installed Apache 1.3. Everything seems to be working fine, and
I'm ready to start tweaking it.

In the meantime, I bought a book about Apache, PHP and MySQL, which
includes tutorials on downloading the programs individually.

I don't want to mess up what I've already installed, but I have an
external hard drive that I use for backing up my documents. Could I
install new Apache, PHP and MySQL programs on that drive? They wouldn't
interfere with the equivalent programs on the C drive, would they?

In fact, is it possible to have PHP programs from two hard drives open
at the same time? After all, I can open up documents on both drives with
Windows Explorer.

Of course, I guess I'd have to install Dreamweaver on the second drive,
too, so I'd be able to test PHP and make sure it's working.

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] upload picture: limit size problems

2004-01-14 Thread Jason Wong
On Thursday 15 January 2004 12:03, Matt Hedges wrote:

 with ya'lls help I've gotten a php that uploads only a jpg... now I'm
 trying to add a constraint that limits the width and size...  I've been
 reading the manual (don't understand the error_messages)... and can't
 figure it out... this is what I have so far:

You can use getimagesize() to:

 i) determine whether uploaded file is a valid JPEG
ii) the (pixel) size of the image

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
QOTD:
Do you smell something burning or is it me?
-- Joan of Arc
*/

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



[PHP] Re: file writing question

2004-01-14 Thread Mehdi Achour
Please send your questions only to php-general ...

Mehdi Achour

Hello all,

Thanks in advance.  I have a quesetion about writing to files.  I am
successfully opening a file and writing to it, but I'm having problems
inserting text.  My file currently has the following structure:
***
[index]
24
1073946700
***
The second line in the file represents an incremented number.  And the third
line is a unix timestamp of when the incremented number was last
incremented.  I will have a script that will allow a user to decrement this
number, and revert back to the timestamp that goes along with the
decremented value.
Basically, my file will need the following structure:

***
[index]
3
1073946709
1073946704
1073946700
***
Since the incremented number is at 3, there should be 3 timestamps in a
stack order.  Overwriting the sole number for incrementing or decrementing
is no problem.  However, inserting a new timestamp is where I get stuck.
The current timestamp is over-written rather than inserting a new one.
Here is my code:

?
 function hitcount($pagename)
 {
  $ctrPos;
  $timeStampPos;
  $buffer = '';
  $formatName = '[' . $pagename . ']';
  $fileHandle = -1;
  //Make sure the file exists
  if(file_exists(Reports/hitcount.txt) == TRUE)
  {
   //Attempt to open the file with read AND write priveleges
   $fileHandle = fopen('Reports/hitcount.txt','r+');
   //Make sure we have a valid file pointer
   if($fileHandle)
   {
//Attempt to seek to the given page name section
$buffer = fgets($fileHandle, 1024);
while(!feof($fileHandle)  $buffer != $formatName . \r\n)
{
 $buffer = fgets($fileHandle, 1024);
}
//Make sure we are not EOF
if(feof($fileHandle) == FALSE)
{
 //get the current pointer position
 $ctrPos = ftell($fileHandle);
 //read the next line which is the current hit count
 $buffer = fgets($fileHandle, 1024);
 $timeStampPos = ftell($fileHandle);
 //increment the hit count
 $buffer = $buffer + 1;
 //seek to where we know the hit count is
 fseek($fileHandle, $ctrPos);
 //overwrite the hit count
 fwrite($fileHandle, $buffer . \r\n);
 //insert the new time stamp
 fwrite($fileHandle, time() . \r\n);
}
else
{
 //We ARE EOF so we need to add the new page name here and insert the
first hit count and timestamp
 fwrite($fileHandle, $formatName . \r\n);
 fwrite($fileHandle, 1\r\n . time());
}
   }
   rewind($fileHandle);
   echo(File Contents: BR***BR);
   while(!feof($fileHandle))
   {
$buffer = fgets($fileHandle, 1024);
echo($buffer . BR);
   }
   echo(***BR);
   fclose($fileHandle);
  }
 }
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Variable PHP Includes - Is there such a thing?

2004-01-14 Thread Freedomware
Suppose you design a standard banner for the top of your web pages and 
use an include to insert it into every page on your site, like this:

?php
include (../../../../includes/header.php);
?
But you later decide you'd like to change just one element on each page. 
For example, you might design a standard image banner, followed by a 
title and subtitle for each page, but you want to change the title to 
Alaska, Nebraska or Wyoming on each page.

Is there a way to do this with PHP? If it has a name, I can search for 
information online, but I don't even know what to call it.

I've played with something of this nature in Dreamweaver. You can design 
a template that turns out carbon copies of a page, but single out 
certain items by enclosing them with @@, which are somehow changed on 
individual pages, or something like that. I can't remember what it's 
called at the moment.

Another strategy would be to use a PHP include to insert an element on 
different pages, then modify each element with a unique style sheet on 
each page.

But I just wondered if PHP offers additional possibilities for similar 
experiments.

Thanks.

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


Re: [PHP] Having a bit of regex troubles

2004-01-14 Thread David OBrien
I just ran this on this line...

for ($x=0; $xstrlen($field);$x++) {
echo ( .ord($field{$x}) . ) ;
}
to see the ascii values to make sure nothing funky was there and it still 
stopped after the @@ (169)(169)

-Dave

At 12:50 AM 1/15/2004, David OBrien wrote:
Let's say i have a mysqldump type export script I wrote that someone 
screwed up (me) and I quoted every field even the
numeric ones. In this dump I have rows upon rows of this kind of data

INSERT INTO chd VALUES ( '80607fe5-00eb-f5c9-4d38-00ac10050a00' , 
'014d7fcd-00eb-f5c9-4d38-00ac10050a00' ,
 'Kenderick' , '1991-02-10' , 'Male' , '2002-02-28' , '576' , '' , '' , 
'Full-Time' , 'Summer Only' , '©After School©' ,
 '©Child Care Center©©(CCC) Summer Camp©' , '©Non-Smoking©' , '©English©' 
, '' , ''
 , '' , '' , '' , '' , '©CMS - Tuckaseegee©' , '©Transportation 
Provided©' , ''  );

The java programmer used @@ as internal field seperators (can't be changed)

I am reading this dump a line at a time stripping the data into an array 
and then writing back out to a new file
with the proper fields quoted or not quoted depending on the table and the 
db schema
ccncc would be char char num char char in the switch statement to tell 
the loop which ones to quote
or which ones not to.

ACTUAL SCRIPT AT THE END (kind of large)

In the example row above You see the @@(CCC) value?

Whenever It gets to a line with this combination it stops processing the 
rest of that line and terminates the field at the @@

Dump of the below program for the above row ( I put the *** before and 
after each field to see where it was dieing)

INSERT INTO chd VALUES  (
***80607fe5-00eb-f5c9-4d38-00ac10050a00***
***014d7fcd-00eb-f5c9-4d38-00ac10050a00***
***Kenderick***
***1991-02-10***
***Male***
***2002-02-28***
**
**
***Full-Time***
***Summer Only***
***©After School©***
***©Child Care Center©©***
Then it just skips to the next record when it hits the (CCC). I could just 
use a text editor to replace all the @@( to
something and then write them back out at the end of the script but it's 
really bugging me and I thought a fresh pair
of eyes looking over it would help.

I know I have trims out the wazoo but I just rushed to post this before it 
got real late.

Anyone know of a way I can replace the (CCC) or the @@ using str_replace 
I've tried \'ing it, not slashing just about
every combination
-Dave







SCRIPT

[EMAIL PROTECTED] bin]# cat escape_sql.php
#!/bin/php
?
if ($argc != 2 ) {
?
  Usage:
  ?php echo $argv[0]; ? filename
?
exit;
} else {
$handle = fopen( $argv[1] , r);
while (!feof($handle)) {
$count ++;
$start = 0;
$buffer = chop(fgets($handle, 100));
list($sql,$rest) = explode((,$buffer);
if (substr($sql , 0 , 2) == --) {
echo $sql .\n;
} else {
echo $sql ( ;
$rest = str_replace();, , $rest);
$rest = str_replace(\(CCC\),ZZZ,$rest);
$fields = explode(' , ' , $rest);
foreach ($fields as $field) {
$field = trim($field, ' );
$field = trim($field, \' );
$table = str_replace(INSERT INTO ,, 
$sql );
$table = str_replace(VALUES ,  , $table);
$table = trim($table);
switch ($table) {
case 'agc':
$schema = 
;
break;
case 'chd':
$schema = 
ccnc;
break;
case 'cli':
$schema = 
cncnncnncncn;
break;
case 'cliactionlog':
$schema = cc;
break;
case 'cliaddress':
$schema = nn;
break;
case 'clicensus':
$schema = c;
break;
case 'clifollow':
$schema = 
nn;
break;
case 

[PHP] Getting PHP to work with SQLite

2004-01-14 Thread gohaku
Hi everyone,
I'm currently trying to use SQLite databases with PHP 4.3.2
I downloaded the  SQLite-PHP module and tried './configure' but couldn't
get that to work.
Also, even If I could get './configure' to work, where would I install  
the
appropriate files and what do I have to modify in php.ini?
Thanks in advance,
-gohaku

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