[PHP] Re: Sorting parsed XML

2002-11-24 Thread Chris
I'm trying to write PHP code that will not only parse the XML but also
allow me to sort the parsed information by the values parsed.
 
Current code
==
class RSSParser {
 var $insideitem = false;
 var $tag = "";
 var $ServerName = "";
 var $ServerStatus = "";
 var $ServerType = "";
 var $ServerPopulation = "";
 
 function startElement($parser, $tagName, $attrs) {
  if ($this->insideitem) {
   $this->tag = $tagName;
  } elseif ($tagName == "SERVER") {
   $this->insideitem = true;
   while (list ($key, $val) = each($attrs)) {
switch ($key) {
 case "NAME":
  $this->ServerName .= $val;
  break;
 case "TYPE":
  $this->ServerType .= $val;
  break;
}
   }
  }
 }
 
 function endElement($parser, $tagName) {
  if ($tagName == "SERVER") {
   printf("\n");
   if ($this->ServerType) {
printf("%s (%s)\n", $this->ServerName,
$this->ServerType);
   } else {
printf("%s\n", $this->ServerName);
   }
   
   if ($this->ServerPopulation > 0) {
printf("%s\n", $this->ServerPopulation);
   } else {
printf("%s\n", $this->ServerStatus);
   }
   printf("\n");
  
   $this->ServerName = "";
   $this->ServerType = "";
   $this->ServerPopulation = "";
   $this->ServerStatus = "";
   $this->insideitem = false;
  }
 }
 
 function serverData($parser, $data) {
  if ($this->insideitem) {
   switch ($this->tag) {
case "POPULATION":
 $this->ServerPopulation .= $data;
 break;
case "STATUS":
 $this->ServerStatus .= $data;
 break;
   }
  }
 }
}
 
$xml_parser = xml_parser_create();
$rss_parser = new RSSParser();
xml_set_object($xml_parser,&$rss_parser);
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "serverData");
$fp = fopen("http://www.camelotherald.com/xml/servers.xml","r
 ")
 or die("Error reading RSS data.");
while ($data = fread($fp, 4096))
 xml_parse($xml_parser, $data, feof($fp))
 or die(sprintf("XML error: %s at line %d",
 xml_error_string(xml_get_error_code($xml_parser)),
 xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);

 
I've reviewed many online and book references and none have been helpful
in helping me to determine the way(s) in which I could do such a sort
from the parse code I have found to work very well.  I have tried
looking for a way to also append multiple XML RSS files in one (all
sharing the same structure) into one and then sort according by a value
there.  I am new to PHP and XML.
 
Any help and references would be greatly appreciated.
 
~PHP learner



[PHP] Re: Sorting parsed XML

2002-11-25 Thread Chris
Sorry, use to using to a listserv that auto-plants the listserv address,
not the responder's address on replies :P


> From: @ Edwin [mailto:[EMAIL PROTECTED]]
> If you'd like to sort these, then I think you might be able 
> to do something like this: 1. Instead of printf()'ing your 
> 's or 's inside the class/function, why don't you try 
> "putting" it inside an array? (Maybe with array_push() or
> something.) Then,
> 2. If you already have an array, perhaps you can use one of 
> the functions here for sorting:


Aye, this is essentially what I need help with, is making the array.

What I'm looking for is a way to put the data into an array and then
sort it based on the user's want and then print it out in a table
format.

I've already got the xml info working as intended:

http://www.rpgtimes.com/daoc/

But what I've tried with getting the data placed into an array so far
hasn't worked.  Not many parsed XML examples out there or anything the
10 odd books I have help me with this.  Books, I've found, in general,
can't help me with most of my array needs due to their very basic
examples and descriptions.

I am about to try doing an array as such:

Instead of:

function serverData($parser, $data) {
if ($this->insideitem) {
switch ($this->tag) {
case "POPULATION":
$this->ServerPopulation .= $data;
break;
case "STATUS":
$this->ServerStatus .= $data;
break;
}
}
}

Something to this affect:

function serverData($parser, $data) {
if ($this->insideitem) {
switch ($this->tag) {
case "POPULATION":

$ServerArray[$this->ServerName][$this->ServerPopulation] = $data;
break;
case "STATUS":

$ServerArray[$this->ServerName][$this->ServerStatus]= $data;
break;
}
}
}

Course, I'm unsure how this will work (but I'll try it out) since
$this->ServerName may not carry to the $this->insideitem check.  I would
then plan to use function endElement to determine the user's want and
then print the HTML out based on that, such as wanting the current data
sorted by population (default) or by server name, type, or status.

Sorry, I'm new to dynamic web page creation and especially to XML, but
I've got a love for programming and a head that just wants to learn more
of it, so I create tons of web sites based around my hobbies so that I
can practice and learn more.  I'm glad I found this listserv and hope
you guys don't mind my questions.

Thanks for any help you can provide.


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




RE: [PHP] Re: Sorting parsed XML

2002-11-25 Thread Chris
Unavailable as I am reading an XML file produced by another web site and
it dynamically updates the information on the sheet every 5 minutes or
so.  At least to my knowledge of what XSLT can do.

> From: Geoff Hankerson [mailto:[EMAIL PROTECTED]] 
> 
> This seems to me to be more easily handled by XSLT. (Not the 
> only option 
> but a good one).
> XSLT lets you select only the nodes you want and also sort 
> them as well.


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




RE: [PHP] Re: Sorting parsed XML

2002-11-26 Thread Chris
Okay, that's neat and I get what you're saying with xml_process() to
handle this.

>From what I'm reading, it would not allow this sort of procedure, but
please let me know otherwise:

==
echo "" . $ServerName;
if ($ServerType)
{
echo " (" . $ServerType . ")\n";
} else {
echo "\n";
}

if ($ServerStatus == "Down")
{
echo "" . $ServerStatus . "\n";
} else {
echo "" . $ServerPopulation . "\n";
}
==

So, what would print in the first and 2nd column would depend upon the
results of one of two variables (1st column relies upon if there's a
$ServerType or not, 2nd column relies upon the $ServerStatus not being
"Down").

My problem is still my own, I can't get it so that when I parse, the
information is placed into an array that can then be used for sorting.
This would be ideal for me as I plan on reading from more than one .xml
(different structures as well) on the same page if I can get this to
work.

I guess what I'm asking for is a method to parse information into an
array and then sort it by any part of the array.  I attempted the
$ServerArray[$this->ServerName][$this->ServerStatus] = $data in the
parse section (where $data = current node value), but it didn't work.

Again, thanks for all your help so far and in advance for any help you
can provide.

~Confused PHP user

> From: @ Edwin [mailto:[EMAIL PROTECTED]] 
> 
> "Geoff Hankerson" <[EMAIL PROTECTED]> wrote:
> 
> > You don't need to do client-side transformation (although you could 
> > check user agent and do it client-side if the browser supports it). 
> > You can use Php's XSLT functions see the manual for more info.
> >
> > I was just suggesting this as a potential option. It may not be 
> > appropriate in this situation. I don't really know enough about the 
> > programming challenge we are looking at  to say for sure
> 
> I see. I thought you were saying that use XSLT and access the 
> xml file directly--my apologies.
> 
> Anyway, _that_ is certainly a potential option... :)


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




[PHP] xslt_process problem

2003-02-14 Thread Chris
I am trying to figure out the whole XML/XSL thing and am experimenting with 
the Gentoo docs which have a simple XSL sheet. I downloaded the XML, XSL 
and DTD, and ran the files through the Sablotron module in php using:

$xp = xslt_create();
   xslt_set_base($xp, 'file://c:/shared/mywebs/beta/test/');
   $result = xslt_process($xp, 'rsync.xml', 'guide.xsl');
   echo $result;
   xslt_free($xp);

Everything worked like a champ except for one strange little problem: the 
XSL stylsheet defines anchors and links in a drop-down menu for each 
"chapter", sequentially... (as you can see here: 
http://www.gentoo.org/doc/en/rsync.xml) but in the PHP transformation with 
the local files, all of the chapter numbers and the numbers in the drop 
down are "1"! 

The guide.xsl I am using is online at: http://www.gentoo.org/xsl/guide.xsl 
and I am using a current rsync.xml from the CVS repository, so it has to be 
something in the local transformation with PHP.

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




[PHP] Array instead of Switch

2003-02-21 Thread Chris
Let's say I need to take one of 20 actions depending on a form selection. I 
could use a switch statement with 20 cases, but I could also do something 
like:

// Pretend this comes from a form
$formchoice = "mars";


$response = array(
 "mars" => "go_mars()",
 "mercury" => "go_mercury()",
 "earth" => "go_earth()");

foreach ($response as $choice => $action)
{
 if (strtoupper($formchoice) == strtoupper($choice))
  {
  eval("$action;");
  }
}

But are there even better ways? 

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



[PHP] PHP Job Opening

2003-02-21 Thread Chris
http://www.alaska.edu/hr/jobs/external/tmp19_3.xml

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



[PHP] Your script possibly relies on a session side-effect which existed until PHP 4.2.3

2003-03-07 Thread chris
We've been having a nightmare of a time with this IIS machine that was 
recently upgraded to 4.3.1 from 4.2.3.  Of course, using google to find out 
what the error means only brings up other sites that have the message 
displayed...

Warning: Unknown(): Your script possibly relies on a session side-effect 
which existed until PHP 4.2.3. Please be advised that the session extension 
does not consider global variables as a source of data, unless 
register_globals is enabled. You can disable this functionality and this 
warning by setting session.bug_compat_42 or session.bug_compat_warn to off, 
respectively. in Unknown on line 0

register_globals = off
(error reporting set to highest possible at runtime)
I found a few other people that were having this problem, but many of them 
were related to using session_register.  I'm using $_SESSION['variable'] = 
'whatever' to set all of my session variables and 
unset($_SESSION['variable']) instead of session_unregister, so I'm 
uncertain as to why this happens, and only on certain pages.

We've tried setting the php.ini settings described in the warning to every 
possible combination, and the warning still appears.  I'd rather know what 
is causing the warning and fix it, rather than just masking it.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Displaying few words from record in mySQL

2003-03-08 Thread chris
On Fri, 7 Mar 2003 10:22:01 -0800 (PST), Rahul.Brenda 
<[EMAIL PROTECTED]> wrote:

Glory & Supreme Power

What i'm looking to do is.. i want to display only the
first few words of the record in my mySQL database..
For example.. i have a table with a field "title"..
and let's say my last record has the value in title
field as
"This is going to be really cool"

What i want to display is

"this is going..."

Basically this is for News Headlines. I have a page
which displays news but on the first page of the site
i have to give the first few words of the last 4
articles in the news table..
How can i do this? I have seen this in a lot of places
but i dont know how to do this.
Thanks,
Rahul S. Johari
__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
Make mysql do the work for you.

select substring_index(title, ' ', 20), author from news order by date desc 
limit 4
// this particular string selects everything before the first 20 spaces of 
your title.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] What am i doing wrong? SQL Query in PHP

2003-03-09 Thread chris
On Sun, 9 Mar 2003 04:37:47 -0800 (PST), Rahul.Brenda 
<[EMAIL PROTECTED]> wrote:

I want to display the first 3 words of my record in
the my table and following is the code i'm using. When i use the SQL 
Query in mySQL.. it works great..
but when i try to implement it in my php page.. i'm
not getting anything.. no error, no display, no
result.. just blank.. why?



$db = mysql_connect("localhost","user","pass");
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT substring_index(title, '
', 3) from news order by ID desc limit 4",$db);
if ($myrow = mysql_fetch_array($result)) {
do {
echo(" $myrow[title] ");
} while ($myrow = mysql_fetch_array($result));
}
?>
Rahul S. Johari

Why not do it like this?

// fetch row is faster than fetch_assoc, which is faster than fetch_array
// fetch_result might even be a better choice here, though, with only one 
item...
if (!mysql_num_rows($result)) {
	print 'no results';
} else {
	while (list($title) = mysql_fetch_row($result)) {
		print $title; // don't quote variables if you only want to print them by 
themselves
	}
}

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Persistent values between executions

2003-03-10 Thread chris
On Mon, 10 Mar 2003 11:30:25 -0500, Mike Mannakee <[EMAIL PROTECTED]> 
wrote:

I have some sets of values that I have stored in several tables in a 
mySQL
database.  These don't often change, but are referenced on every single 
page
view.  While each call is quick, as a gross the load on the server is too
high.  I would like to know if there is a way to have these sets of 
values
remain persistent in the server's memory between calls from browsers, 
like
environment variables, to reduce the back and forth calls to mySQL.  As 
the
data from the calls are almost always the same, it would seem easier this
way.

Any thoughts?  Comments?  RTFM suggestions?

Mike

Happen to be on a unix system?  What you could do is have a particular 
script that will do your mysql call and output the variables in a another 
file.  Then, have a cron job run that script however often you need to have 
those variables updated.

Another way you could do it is initialize the variables you need as session 
variables if the user logs in (assuming you're using an authentication 
system), which will stay active as long as the user has a valid session.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Error in $_POST

2003-03-10 Thread chris
On Sun, 9 Mar 2003 20:01:33 +0530, Aspire Something <[EMAIL PROTECTED]> 
wrote:

Hi guys ,

I am getting this error in php
___What I am doing;
1. I am posting data from one form and collecting it for execution as 
follows
$_POST['cust_id[0]']; // cust_id is an array of length 1 which is 
selected form an drop down menu

2. register_globals is off
3. Also when i try to call an array element in to other array like
$first_array=[$second_array[the_index_value]];
I encounter the same problem.
___The error is:

Parse error: parse error, unexpected '[', expecting ']'

why am i getting this error am i doing some blunders ???

Loads of thanks in advance
Regards,
V Kashyap
Try $_POST['cust_id'][0]

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: help needed with code!!

2003-03-10 Thread chris
On Tue, 11 Mar 2003 01:14:09 -0500, Karl James <[EMAIL PROTECTED]> 
wrote:

Can anyone give me some pointers on why im note seeing Any output to the 
browser.

Thanks Karl

my link
http://66.12.3.67/webdb/webdb13/assignment_1.php
my code
http://nopaste.php-q.net/7560
ultimatefootballleague.com/index.php
[EMAIL PROTECTED]
You might have some sort of error message disabled in php.ini.  If you just 
copy and paste from that html file, it's riddled with invalid characters.  
You'll have to manually go through the copied source and replace all of the 
spaces and newlines.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: seperate streetname from number

2003-03-11 Thread chris
On Tue, 11 Mar 2003 17:17:52 +0100, André Sannerholt 
<[EMAIL PROTECTED]> wrote:

Hi everyone!

I wondered how to sepearate string variables that contain streetnames and
numbers:
If for example
$variable="Hauptstraße 15";
$variable_string[0] should be "Hauptstraße"
$variable_string[1] should be "15"
So I need a function that recognizes a number and explodes the variable 
at
that very position.
It's important that the thing also works when $variable="Hauptstraße15";
without any space. Else it would have been easy to do with the explode
function...

Regards

André

Try preg_split.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Checking for a Valid Email String.

2003-03-11 Thread chris
On Wed, 12 Mar 2003 14:42:04 +1300, Philip J. Newman 
<[EMAIL PROTECTED]> wrote:

how ever i don't think most ISPs let users pick names with the + sign in 
it

- Original Message -
From: "Paul Chvostek" <[EMAIL PROTECTED]>
To: "David E.S.V." <[EMAIL PROTECTED]>
Cc: "Philip J. Newman" <[EMAIL PROTECTED]>; 
Sent: Wednesday, March 12, 2003 2:37 PM
Subject: Re: [PHP] Checking for a Valid Email String.


> On Wed, 12 Mar 2003, Philip J. Newman wrote:
>
> > Required: Help for checking for a valid email string.
On Tue, Mar 11, 2003 at 08:19:36PM -0500, David E.S.V. wrote:
>
> you mean something like this?
>
> //checking if the email is valid
>
> if
(eregi("^[0-9a-z]([-_.]?[0-9a-z])[EMAIL PROTECTED]([-.]?[0-9a-z])*\\.[a- 
z]{2,3}$",
$email, $check))
>  {
>   if ( !getmxrr(substr(strstr($check[0], '@'), 1),
$validate_email_temp) )
> $mensaje="server not valid";
>
>   // checking DNS
>   if(!checkdnsrr(substr(strstr($check[0], '@'), 1),"ANY"))
>  $mensaje="server not valid";
>
>  }
Don't forget plus signs.  When providing email addresses to lists and
web sites, I regularly tag my address (as the From address on this
message demonstrates).  Using procmail for local delivery allows these
addresses to be delivered to my account, and I can more easily track
down the origin of "tagged" spam.  When I come across a web site or list
that doesn't allow my address with a plus sign, I find another site or
list.  So I use:
function isvalidemail($what) {
if
(!eregi('[a-z0-9][a-z0-9._=+-]*@([a-z0-9][a-z0-9-]*\.)+[a-z][a- 
z]+$',$what))
return(false);
list($user,$domain) = explode("@",$what);
if (!getmxrr($domain,$mxhosts)) return(false);
if (!count($mxhosts) > 0) return(false);
return(true);
}
--
Paul Chvostek <[EMAIL PROTECTED]>
Operations / Abuse / Whatever
it.canada, hosting and development   http://www.it.ca/

What about those of us who run our own mailservers?  A plus sign is a valid 
character in an email address.  Doesn't matter if places like AOL don't let 
their users put it in their user's email addresses.  There's no point in 
*not* allowing it, since it *is* a valid character.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Your script possibly relies on a session side-effect which existed until PHP 4.2.3

2003-03-12 Thread chris
On Thu, 13 Mar 2003 10:35:29 +1100, Justin French <[EMAIL PROTECTED]> 
wrote:

My *GUESS* is that you're using:

session_register('var')
session_unregister('var2')
rather than

$_SESSION['var'] = 'something';
unset($_SESSION['var2']);
Either that, or you're referring to session vars as $var instead of
$_SESSION['var']
Give that a go and see what happens.

Justin

on 13/03/03 8:40 AM, Dave Myron ([EMAIL PROTECTED]) wrote:

Warning: Unknown(): Your script possibly relies on a session
side-effect
which existed until PHP 4.2.3. Please be advised that the session
extension
does not consider global variables as a source of data, unless
register_globals is enabled. You can disable this functionality and
this
warning by setting session.bug_compat_42 or session.bug_compat_warn to
off,
respectively. in Unknown on line 0

register_globals = off
(error reporting set to highest possible at runtime)
I'd really like to know the cause of this too. I don't want to set
bug_compat_42 on... If there's a proper way of coding the PHP then
that's what I'd rather do, not just make PHP accept my buggy code. What
is the root cause of this problem?
-Dave

Justin apparently missed the message Dave replied to (which was mine).  You 
know what happens when you assume Justin?  You make an ass out of you and 
me.  So here's a repost for you:

1.  Registered globals are off.
2.  Using super globals ($_SESSION instead of $HTTP_SESSION_VARS)
3.  Setting via $_SESSION['var'] = $var instead of session_register('var')
4.  Always calling $_SESSION['var'] instead of $var (registered globals are 
off, so it really isn't an option, now is it?)
5.  Unsetting via unset($_SESSION['var']) instead of 
session_unregister('var')

Now, if any other geniouses would like to help me (or any other frustrated 
4.3.1 users) figure out a solution for this vague error message, don't 
follow Justin's very unhelpful footsteps.

Here's another odd tidbit:  I was able to get rid of the message on one 
page by taking out one of the selects in my MS SQL query.  It mattered 
specifically which column it was that I removed from the query and there 
are no other variables throughout the entire project that match the 
column's name.  The warning only pops up on very specific pages, despite 
the consistent coding style throughout the project.

Maybe I'll have better luck posting to bugs.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Parsing fgetcsv using tab (\t)

2003-07-01 Thread Chris
I'm trying to create an form where the user can upload a datafile to the
server. The datafile will be txt or csv and contain multiple records. I
would like the user to supply the field delimiter like (,) comma , (\t)
tab or something else. The data records are then parsed using fgetcsv.

The problem I'm having is trying to recover the tab character from the
form post. If I print out what is received from my form I see the
following \\t. I realize that the addition of the extra slash is
expected, but what I don't know how to do is prepair this varable to use
it in my fgetcsv argument.

I've tried using stripslash but nothing seems to work for me.

Strangely, if is set a variable in my processing script like:

$field_terminater = "\t";

Then supply this to: $newRecord = fgetcsv($f, $size,$field_terminater)
everything works fine. If I use the variable passed from my form the
records are not getting parsed.

Any suggestions would be appreciated.
Chris



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



Re: [PHP] Parsing fgetcsv using tab (\t)

2003-07-01 Thread Chris
Yea, that is what I'm going to do for a back up. After mucking with this for
a couple of days, I've about had it.



Jeff Harris wrote:

> On Jul 1, 2003, "Chris" claimed that:
>
> |I'm trying to create an form where the user can upload a datafile to the
> |server. The datafile will be txt or csv and contain multiple records. I
> |would like the user to supply the field delimiter like (,) comma , (\t)
> |tab or something else. The data records are then parsed using fgetcsv.
> |
> |The problem I'm having is trying to recover the tab character from the
> |form post. If I print out what is received from my form I see the
> |following \\t. I realize that the addition of the extra slash is
> |expected, but what I don't know how to do is prepair this varable to use
> |it in my fgetcsv argument.
> |
> |I've tried using stripslash but nothing seems to work for me.
> |
> |Strangely, if is set a variable in my processing script like:
> |
> |$field_terminater = "\t";
> |
> |Then supply this to: $newRecord = fgetcsv($f, $size,$field_terminater)
> |everything works fine. If I use the variable passed from my form the
> |records are not getting parsed.
> |
> |Any suggestions would be appreciated.
> |Chris
> |
> [Not PHP]
> Hard code the choices using radio buttons or a select on the form. There
> shouldn't be too many commonly used delimiters, and those that use
> uncommon delimiters will have to adjust.
> [/Not PHP]
>
> Then, use the value submitted to choose the delimiter in the php script.
>
> Jeff
> --
> Registered Linux user #304026.
> "lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
> Key fingerprint = 52FC 20BD 025A 8C13 5FC6  68C6 9CF9 46C2 B089 0FED
> Responses to this message should conform to RFC 1855.


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



Re: [PHP] small request

2003-07-27 Thread chris
Ryan,

I'm getting the PHPSESSID variable.

Chris

Quoting Ryan A <[EMAIL PROTECTED]>:

> Hi,
> I want to find out if this is my browsers fault or the settings in my
> php.ini, can you goto http://bestwebhosters.com/my.login.php then look at
> the page source and tell me if there is a hidden variable after the form tag
> with the name "PHPSESSID"
> 
> Thanks for helping.
> 
> Cheers,
> -Ryan
> 
> 
> -- 
> 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] deprecated function list?

2003-08-20 Thread Chris
How can I find a list of PHP functions that are deprecated? Also, how
can I print to the browser the Notice message that would indicate that a
function is depricated? Like: Notice: mysql(): This function is
deprecated; use mysql_query() instead

Thanks for input
Chris


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



Re: [PHP] Problem with the post variables.

2003-08-23 Thread chris
On Mon, 18 Aug 2003 18:35:09 +0200, Wouter Van Vliet <[EMAIL PROTECTED]> 
wrote:

The problem is probably in the 'enctype="multipart/form-data"'. You 
should
only use this enctype if you're gonna upload a file through the form. If
not, just leave it away or use text/plain

Wouter
Why would that be the problem?  Regardless of the enctype, it should still 
create POST/GET data for whatever else was in the form.  Yes, 
multipart/form-data *should* only be used if they are uploading a file.  
That doesn't mean PHP should ignore additional POST/GET data from the 
form, which it has had a history of doing, depending on which way the wind 
blows or the price of tea in China.

-Oorspronkelijk bericht-
Van: Klaus Kaiser Apolinário [mailto:[EMAIL PROTECTED]
Verzonden: maandag 18 augustus 2003 16:04
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Problem with the post variables.
Guys I have a problem here.
I'm using PHP 4.3.2 and httpd 1.3.28.
Look my exemple.
I have a page whith a Form method post, and I submit this page to
teste2.php, but I dont can request de data from the text box...
###
This is the test page








#
Teste2.php
";
echo "Var em get: ".$_GET['texto']."";
//phpinfo();
?>

Some one can help me...???

Klaus Kaiser Apolinário
Curitiba online



--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Retrieve values from checkboxes

2003-03-24 Thread chris
On Mon, 24 Mar 2003 13:06:45 -, Shaun <[EMAIL PROTECTED]> wrote:

Hi,

I have some checkboxes on my form and am using the following code to
populate it. The box will be checked if the user is allocated to the
project. My problem is if I uncheck a checkbox and send the form I don't
know what the $project_id is as it returns zero, so I cant delete the
corresponding record, is there a way around this?
while($j < $num){
$project_id = mysql_result($result, $j, Project_ID);
$project_name = mysql_result($result, $j, Project_Name);
echo   '
'.$project_name.':


';
$j++;
}


No.  Checkboxes *only* send information if they've been checked.  You might 
want to consider using a radio input instead and forcing one to be 
defaulted (for a short list of options) or a select box (for a long list of 
options).

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Help-- 255 characters limitation in .

2003-03-24 Thread chris
On Mon, 24 Mar 2003 16:11:00 +0800, Larry Li <[EMAIL PROTECTED]> wrote:

But MS SQL SERVER saved all characters. Only first 255 characters was 
shown
in . What's wrong?

Thanks for your input,
Larry


What does the html source look like?  Sounds like some sort of html closing 
tag prematurely ended your textarea.  If that's the case, try 
htmlspecialchars'ing it first.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: NewB Q on Arrays.

2003-03-25 Thread chris
On Tue, 25 Mar 2003 21:18:48 +1000, Inpho <[EMAIL PROTECTED]> wrote:

Hey All,

I'm still a newB in php and mysql so I'm asking for your patience up 
front.

i want to get a list of results from an array, which I can do with:

$result=mysql_query("select * from mvlogtbl",$db);
while ($row=mysql_fetch_array($result)){
echo "$row[uid] $row[mvid]";
}
basically what I have is a database of movies linked to .avi files that 
are
setup for streaming, the table mvlogtbl keeps a log of who has watched 
what.

What i want to be able to do is determine if a certain user has watched a
movie. But there are multiple entries for each user, a user may have 
watched
the movie more than once, I don't really care, I just want to be able to
tell if they have watched it or not...

any help?

Thanls

- paul -

// pseudo code starts here...
// use php to read the contents of the avi and set the header of the php 
doc
// to match headers necessary for an avi (check the fread/fwrite 
documentation)
// when it downloads, set the member_has_watched field for that member to
// true or 1 or whatever...

select count(*) from table where member_has_watched = TRUE and member_id = 
the_member's_id

if ($count > 0) {
// the member has watched it
} else {
// the member has not watched it
}
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: ho to remove an empty space

2003-03-25 Thread chris
On Mon, 24 Mar 2003 22:10:28 -0800, Webdev <[EMAIL PROTECTED]> wrote:

somehow when I have try to develop an application where I read five or 
six
values into an individual arrays the array who carries the emails has the
email and an additional empty field after the email somehow complex 
well
they way the information has been stored is that the email was the last
value in the line of arrays and somehow carries always an empty field or 
the
tab field I can see when I upload the data in binary mode however I tried
around for some time

how do remove an empty space in an erray I tried arround with

$E2= str_replace(" ", "", $Email);

and I tried as well
$E2= str_replace(" ", "", $Email); with no success it totally 
ignored
the empty space in the email  what is stored in this
way:|data1|data2|[EMAIL PROTECTED] |data3|etc...|||. when I phrased
the data file
any help and advice would be appreciated...


Are you certain it is a space and not something like a linebreak?  If it's 
at the end of the line, you might consider ltrim or rtrim, which would 
eliminate most whitespace characters from the beginning or ending of the 
string.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] get modification date of remote page

2003-06-01 Thread chris
I have a database full of links. I need to write a script to go to each one 
and check the modification date of the file.  My plan is, once that is 
logged, to do this every week and indicate which pages have "changed."

What is the simplest approach to this? Do I need to use CURL functions or 
remotely open the page with fopen? A pointer to the right place in the 
manual would be great...

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



Re: [PHP] Re: Difference between $_POST[foo] and $_POST['foo']?

2003-06-18 Thread chris
On 17 Jun 2003 09:37:12 -0500, Tom Woody <[EMAIL PROTECTED]> wrote:

On Tue, 2003-06-17 at 09:09, nabil wrote:
A side question along with  this ,,, how can I include $_POST['foo']  in 
the
:
$sql ="select * from db where apple = '$_POST['foo']'  ";

without getting an error ??
should I append it as $var= $_POST['foo']; before???
The rule of thumb I follow with these and other Associative Arrays is:

when setting the variable its $_POST['foo']
when accessing the variable its $_POST[foo]
so it your example it would be:
$sql = "select * from db where apple = '$_POST[foo]'";
print $_POST[foo]; // generates either E_WARNING or E_NOTICE (forget which)
print $_POST['foo']; // does not generate a warning
print "$_POST[foo]"; // does not generate a warning
print "$_POST['foo']"; // generates a warning
--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Is there an RTFM for 'use strict' ?

2003-06-27 Thread chris
On Mon, 23 Jun 2003 14:51:22 +0100, Dave Restall - System Administrator 
<[EMAIL PROTECTED]> wrote:

Hi,

Done a lot of Perl & PHP coding over the years and one thing I _really_
liked about Perl is its 'use strict;' directive.  For those of you not
familiar with Perl, this made the script die if you don't (among other
things) declare your variables before using them.
Once the fingers are flying, stupid typing mistakes often come in and
it is more often when a variable name is being typed.  It would be
interesting to see how many PHP coders out there have spent ages trying
to find a bug in their code that was due to them mis-spelling a variable
or method name.
Anyway, I can't find a reference to anything in the manual that will
force PHP to strictly check variable names etc. to see if they are
declared before use and if not throw up an error.
try set_error_handler()

On the error types it can catch (E_WARNING & E_NOTICE, as well as E_USER 
type errors), you can simply tell it to debug however you want and then 
exit.  I have a rather large site that emails me whenever any sort of non- 
E_USER error happens.  I usually get it fixed before the client realizes 
anything is wrong.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: sessions and browser back

2003-06-27 Thread chris
On Wed, 25 Jun 2003 18:56:13 +0530, Bibhas Kumar Samanta 
<[EMAIL PROTECTED]> wrote:

Hi,

I am trying to create restricted pages for my php/mysql/apache
server with sessions and passing session varibales to other pages for 
validation.

Eventually I am doinng session_start() at the begining and
checking whether logged in user is authorised to use this page
by a routine.
Now problem is, if filled in data in the form is incorrect, the forms 
gives an error. But when I press browser BACK button to get the
filled in form , the form seems to get reset with _no_ data.

When I try without session_start() at the begining  of form , things
seem to behave normally.
Does session_start() reset the form  and I guess browser should
have returned be by fiiled in page from cache ?
Please help

-Bibhas

This doesn't happen with every browser.  Opera never forgets the previous 
page's form contents.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] sessions nightmare

2002-09-11 Thread Chris

Greetings,

I am a new user to php and sessions and for the life of me I
cannot figure this out

I want to be able to have a user login (which is completed), they goto a
search page (completed), and search for a particular item (completed). A
page will display all the links for the items searched for (completed).
What I want out of sessions is to when they click on the link for a
particular item, the item number stay in a session so it can be called
through out each page they goto. What I have as a base of test code is the
following (this was taken from someone's example):

test1.php:



Goto next page


test2.php:





After you click the hyperlink on test1.php, test2.php will load and the
session ID is in the URL, but nothing is displayed in the echo for
$SESSION[item] in test2.php. What is going on?!#!#!$#


Thanks a million in advance!!
- Chris



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




Re: [PHP] Re: session_start function breaks flush function in 4.2.1

2002-09-25 Thread Chris

Michael,

Thanks for the detailed reply. After some tests of my own I'd realized it
was the trans-sid parameter that was giving me problems. In 4.2.1, php is
compiled with this parameter set by default - it would appear.

I'll give your idea a try - thou' I'll have to reinstate my script, since
I'd written a work around - basically I echo the message, and recall the
script with a meta refresh to do the actual processing.

Thanks again,
Chris

"Michael Sims" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>"Chris Andrew" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>> I use a script which initially sends a friendly message to a browser, and
>> then goes about some lengthy processing. The browser is IE and I am aware
>of
>> the 256 byte issue.
>>
>> The script worked nicely in php.4.1.1 but since installing 4.2.1, the
>flush
>> function doesn't do its job. However, it works if I ommit session_start()
>?

I can't speak for the differences between 4.1.1 and 4.2.1, but maybe
the following information will help you:

On my site I have a custom error handler than displays a "friendly"
error message screen and emails me an error report.  I use output
buffering because if an error occurs I don't want this friendly error
message screen to be rendered in the middle of whatever else was going
on when the error occured...I get the contents of the buffer and then
and then call ob_end_clean() to empty it before I display the friendly
error message.

I noticed that this was not working properly on one section of my site
that used sessions.  I noticed that if I called session_start() and
then an error occured, I got the error message in the middle of the
the page, just as if I hadn't cleared the buffer.

I then discovered why...  I am using trans sid support to perpetuate
the session id, and apparently this is implemented internally using an
output buffer.  Trans sid buffers the page output, then rewrites the
hrefs and insert the hidden form values before flushing the buffer to
the screen.  Apparently you can start multiple buffers, and they are
stacked.  If you call a buffer function such as ob_end_clean(), it
*automatically* operates on the last buffer in the stack...i.e. the
buffer that was most recently created.  In my case this buffer what
the trans sid one, and NOT the one that I started.

To make a long story short, I had to end up calling ob_end_clean()
TWICE...once to flush the trans sid buffer and once more to flush
mine.  Maybe something similar is at work with your problem.  Try
calling the flush function twice back to back and see if that makes
any difference...

If anyone knows of a way to determine how many output buffers have
been started or are currently active please let me know...



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




[PHP] is there a php version with curl already integrated?

2003-09-04 Thread Chris
hello,

i must admit, i'm quite a nub when it comes to compiling php myself, so 
i'm wondering if there is any version of php with curl already bein part 
of it? i'm running xp with apache 1.3.

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


[PHP] Cleaning up my messy code

2003-09-29 Thread Chris
I am working on a fairly large scale (for myself anyway) project using PHP 
and MySQL. I am victim of teaching myself to program, not separating 
presentation from my code-- all the things that lead to masses of spaghetti 
code so atrocious even I can't figure out what I was doing an hour ago.

I'm not looking for an IDE or code generator so much as some practical 
advice for organization and framework when developing a larger app. I know 
of PHP Fusebox, having programmed with Cold Fusion fusebox for a while, but 
it seems like that might be too much. Maybe I just need a sensical, 
practical approach to application layout. What do you all do? How can I 
learn to be a better PHP programmer in this regard?

c

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



RE: [PHP] Cleaning up my messy code

2003-09-29 Thread Chris
[EMAIL PROTECTED] (Warren Vail) wrote in
news:[EMAIL PROTECTED]: 

> My own experience has shown that separation of a presentation layer
> from an application layer, doesn't occur where we think it should. 
> HTML as a language has no capability to be dynamic, and if we are
> going to ask that the page be dynamic, we are going to need to make
> sure we don't attempt to split layers along language boundaries. 
> JavaScript, as we typically use it, adds some dynamic nature to our
> pages, but often is not based on database content.  This is where PHP
> comes in and the split becomes more vague.  If what the user sees, is
> controlled by database content, then splitting presentation and
> application layers becomes a frustrating exercise in theoretical
> purity, that often adds to response times of applications.  

Certainly. This is not a theoretical exercise but frustration with 
dealing with my own code, trying to implement revisions, and basically 
feeling like I need a map of some kind to know where I am.

That's why I'm interested in what other people really do rather than 
theoretical models they think might be the "purest." And it isn't just 
code and content separation, which isn't always practical as an 
absolute, but code separation. If I have a simple set of actions to 
perform, say a series of functions to enter data into a db, review the 
entry, edit the entry, etc. how can I organize my code so it is easy to 
maintain and so some things can be reused? Objects? Functions? Fuses? 
Switches? All of these have their adherents... I'm trying to find one 
that adheres to me-- i.e. that is usable without being so extensive and 
abstract that I spend more time trying to learn how to fit the framework 
than actually getting something done...

c

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



[PHP] mail(): can it reply with quoted text?

2003-10-01 Thread Chris
I wrote an ultra basic mail interface as a part of my client's customer 
administration area to handle emails.  Basically, the standard email form 
gets stored in a database, and when they respond to the help request, they 
fill out the form and PHP emails the message.

Now, they want to have the original email appear as a part of their 
reply.  I could use wordwrap() at around 70 characters and have every line 
appear with the traditional '>' to indicate the replied text.  It doesn't 
seem to be a very elegant solution for mail clients that reflow quoted 
text (not certain how to explain this, but Opera's mail client does it).

Is there a way to for mail() to include quoted text like it was actually 
replying to an actual mail client would?

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Variables not passed on localhost setup [FIXED]

2003-10-01 Thread Chris
On Wed, 01 Oct 2003 14:22:30 -0400, Greg Watson <[EMAIL PROTECTED]> 
wrote:

I'll check up on the security implications. Unfortunately for me, this
is the way I was taught PHP. I'll have to rethink things I suppose!
(and make sure you understand the security implications that may arise 
from
having globals on and poorly written code)

It would be best if you *do* get used to registered globals being off.  
It's gotten so that I can't even download premade PHP scripts anymore 
because 2 of the 3 webservers I work on have it turned off.  It's not fun 
having to sort through other people's code and making it work with 
registered globals being off (extract() is the easiest way, but I still 
have to sort through which include needs it).  It ends up being almost as 
much work as building a new one from scratch.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Creating a blogrolling/link management system

2003-10-08 Thread Chris
I'm looking at using PHP to create a link/bookmark system similar to 
blogrolling.com, but for many links both weblog and not. Basically the 
system would archive 3-500 links, display them hierarchically, etc. 
Standard stuff that I see a lot of PHP code for. 

What I am wondering is what is the best approach for detecting "recently 
changed" links? I could use various files put out by blogger.com or blo.gs, 
etc. to check sites that use those services, but while being much more 
efficient than actually checking myself, that would exclude many non blog 
sites.

I only want to indicate sites that were updated in the last 24 hours, so I 
am thinking that I could just cron a PHP script that checks each site for 
changes every day. Is there a reliable method for doing this using just the 
headers returned for a page? Is there a better way?

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



[PHP] Check for page change efficiently [was Re: Creating a blogrolling/link management system]

2003-10-08 Thread Chris
[EMAIL PROTECTED] (Paul Van Schayck) wrote in
news:[EMAIL PROTECTED]: 

 > First of all you need to check with the website you are going to check
> if they really enjoy all bandwith required. And people will not see
> their banners anymore.

I'm not sure I understand-- I want to check to see if their page has 
changed once each day and, if so, I will highlight that link in my list... 
I doubt most web sites would have a problem with one hit per day :)

I am not scraping and redisplaying content...

My question boils down to the most efficient method to detect whether a 
page has been modified recently...

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



[PHP] Image resize with background.

2003-11-02 Thread Chris
Hey guys. I have read a lot of different option to resize images.
 
What about a script that will resize an image, constrain proportions,
and add a background color to whatever is left.
 
For example, I have a picture that is 600 (width) by 300 (height) and I
want to constrain proportions, and resize this to 300 by 400 (width by
height). There would be an extra 250 pixels left in the height, so now
that gets filled in with some background color.
 
This way, the people that have to make any image fit in a certain
location can keep the same aspect ratio, and not have to have an 'out of
place' image.
 
Just a though. What do you guys think?
 
-Chris 
[EMAIL PROTECTED]


[PHP] can I license a php script?

2003-11-14 Thread Chris
I am planning on writing a program in PHP and, hopefully sell it for a few
dollars. Are there any licensing issues I should be concerned about when I
distribute the program. What confuses me is, I'm not distributing PHP only
code that uses PHP, so what am I to license, my intellectual property?

Thanks
Chris

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



Re: [PHP] can I license a php script?

2003-11-14 Thread Chris
Why wouldn't I be able to charge for the software?

Quoted from the GNU General Public License:
"When we speak of free software, we are referring to freedom, not price. Our
General Public Licenses are designed to make sure that you have the freedom
to distribute copies of free software (and charge for this service if you
wish), that you receive source code or can get it if you want it, that you
can change the software or use pieces of it in new free programs; and that
you know you can do these things."

Additionally from the Smarty FAQ:
Q: Can I create a proprietary software, and sell it with Smarty?
A: Yes, you can. Smarty is licensed under the [LGPL] and distributing an
unmodified smarty source as part of a commercial product is just fine.

Chris

"Chris W. Parker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Robert Cummings <mailto:[EMAIL PROTECTED]>
on Friday, November 14, 2003 1:34 PM said:

> Be careful though, if your code incorporates other peoples code, for
> instance Smarty, or PEAR::DB then it may fall under their license. For
> instance if your code "depends" and I believe the key here is depends,
> on GPL code, then it falls under the GPL, even if you don't package
> GPL code with it. Feel free to correct me if I'm wrong.

Ok so let's assume this is true (which it sounds like it is). So if you
wanted to make a profit (or break even, whatever the case may be) you
wouldn't necessarily be able to charge for the software itself but you
*could* charge for support and stuff like that right? I guess that's
like what RedHat and other vendors do?

So let's say, the code if free to download, but you could offer (1)
packaged versions with documentation, (2) a support contract, (3) a
setup fee (if the customer doesn't feel they are technically capable of
installing the software), (4) and whatever else you can come up with.


Sound about right?



Chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/

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



[PHP] Is PHP License GPL?

2003-11-17 Thread Chris
I was looking for license information on the PHP site and only found "The
PHP License, version 3.0" http://www.php.net/license/3_0.txt

1 - Is this license information only applicable to PHP version 3.0?
2 - Is there no license for Version 4+ or is this now covered by GPL?

>From the PHP web site:
Q. Why is PHP 4 not dual-licensed under the GNU General Public License (GPL)
like PHP 3 was?

A. GPL enforces many restrictions on what can and cannot be done with the
licensed code. The PHP developers decided to release PHP under a much more
loose license (Apache-style), to help PHP become as popular as possible.

3 - What is dual-licensed mean?

4 - Where can I find this "loose license (Apache-style)" agreement?


Thanks
Chris

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



RE: [PHP] Re: Unicode translation

2003-12-02 Thread Chris
I'm not quite following this and I'm not sure what exactly you're having a
problem with, but I'll try to explain some stuff that it looks like will
help.

Unicode(UTF-8) is a variable multi-byte format. Each character is
represented by 1 to 4 bytes, UTF-8 character number 0x108(264) happens to
require 2 bytes.

So, if anything is trying to read UTF-8 characters with the rules for a
single byte character set you will see the C Circumflex as two separate
characters. UTF-8 should display fine on web page if you set the charset
(like the previous emails incstructed you too) and the users OS supports
UTF-8 (Windows 2000 and XP do, probably the recent flavors of linux as
well).

ISO-8859-1 (Which is the most prevalent character set on the internet) is
single-byte. UTF-8 and ISO-8859-1 do share  characters, Every character from
0x00(0) to 0x7f(127) in ISO-8859-1 is a single byte character in UTF-8, with
the same nubmer. So if you are trying to display one of these characters in
the other format, it will appear normal, while all UTF-8 characters
0x80(128) and above will be different and not display correctly.

Are you just trying to store data to be able to retrieve it later?

A block of text submitted to a webform maintains the character set of the
webpage that submitted it (at least in my experience, there may be some
exceptions to this though it is dependant on the browser). So you shouldn't
have any problems displaying the data if the character set on the submitting
page and displaying page are identical.

If a character doesn't fall into a particular character set, there is no way
to store it. UTF-8 is a good catch all because it can handle just about any
character out there.


Plenty of information about Unicode can be found here:
http://www.unicode.org/

Chris

-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 9:21 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Unicode translation


Yes, i just learned that windows uses a decimal code and there is a hex
value too.
Well, since some unicode characters dont have a decimal value, its really
getting harder to solve this kind of problems. :(


-- -
Louie Miranda
http://www.axishift.com


- Original Message -
"Luke" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> no, but on windows, you should be able to access most of them (depending
on
> the font) by using ALT+(number pad code)
> eg ALT+(num pad)0169 gives you -> ©
>
> Luke
>
> --
> Luke

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

2003-12-03 Thread Chris
The only problem I see with that is that you're using the constants E_ALL
and E_NOTICE in the .htaccess file. You can't use constants there, you need
to use the actual number. (2047 & ~8) == 2039:

php_flag register_globals 1
php_flag error_reporting  "2039"

Chris

-Original Message-
From: Bogdan Albei [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 4:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] register_globals problem


I have a webpage that needs to use some specific php.ini settings
different from other php applications on my web server. I have created a
.htaccess file with the following content:

php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"

It works fine, but only on Mozilla and Netscape. Internet explorer
cannot process the content of this web page. The URL is
http://e-technics.com/dorna/ .

Anyone knows the remedy for this strange behaviour?

Bogdan Albei
eTechnics
www.e-technics.com

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

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



RE: [PHP] register_globals problem

2003-12-03 Thread Chris
Heh, sorry about that.. one more thing, php_flag is only for bollean values,
this should work:

php_flag register_globals on
php_value error_reporting  "2039"

-Original Message-----
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 9:10 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] register_globals problem


The only problem I see with that is that you're using the constants E_ALL
and E_NOTICE in the .htaccess file. You can't use constants there, you need
to use the actual number. (2047 & ~8) == 2039:

php_flag register_globals 1
php_flag error_reporting  "2039"

Chris

-Original Message-
From: Bogdan Albei [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 4:43 AM
To: [EMAIL PROTECTED]
Subject: [PHP] register_globals problem


I have a webpage that needs to use some specific php.ini settings
different from other php applications on my web server. I have created a
.htaccess file with the following content:

php_flag register_globals 1
php_flag error_reporting  "E_ALL & ~E_NOTICE"

It works fine, but only on Mozilla and Netscape. Internet explorer
cannot process the content of this web page. The URL is
http://e-technics.com/dorna/ .

Anyone knows the remedy for this strange behaviour?

Bogdan Albei
eTechnics
www.e-technics.com

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

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

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



RE: [PHP] PHP - Oracle - BLOBs - Display BLOB data in a table

2003-12-03 Thread Chris
You would need to have two separate pages, theimage.php and
displayimage.php.

theimage.php will just return the image data in a readable format the
browser knows is an image.:



displayimage.php will be a normal php page with an image tag like this:



Chris
-Original Message-
From: Ahbaid Gaffoor [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 2:46 PM
To: PHP General Mailing List
Subject: [PHP] PHP - Oracle - BLOBs - Display BLOB data in a table


I have written the first half of my application which stores images in
BLOB fields of an oracle database.

This part of my app. works fine.

I am now trying to download the database stored blob and display it in
my web page.


I am able to get the blob data into a variable called $blobdata.

If I just throw up a fresh page and issue the following code, the image
displays fine:



Assume that I have a function which when given an image id it returns
the blob data as follows:

$blobdata = get_image_data(2); // Get the blob data for image as stored
in the database with id = 2

However, I would like to be able to place the blobdata say in a  table
cell as follows:


 


only problem is that I am getting gobbledygook charcaters in the cell as
the raw data is being printed, what sort of HTML or PHP functions
should I use to do this?

many thanks,

Ahbaid.

--
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] Cannot Use Database

2003-12-10 Thread Chris
I'm fairly sure database names are only restricted by characters allowed in
a filename on whatever OS MySQL is on.

USE `anime-soup_com_-_chatting`

(note: those are backticks [top left key on most keyboards], not
single-quotes)

That should work fine, and is probably exactly what mysql_use_db() is doing
for you.

Chris

-Original Message-
From: Stephen Craton [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 7:41 PM
To: Jason Wong
Cc: PHP List
Subject: Re: [PHP] Cannot Use Database


Found the problem. I was using the query of "use database_name" rather then
the defined function given out by PHP. Some systems don't have the
permission to do the use command I suppose.


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 10, 2003 7:34 PM
Subject: Re: [PHP] Cannot Use Database


> On Thursday 11 December 2003 06:17, Stephen Craton wrote:
>
> > I am having an issue connecting to a MySQL database. I've made a script
> > that installs itself to a MySQL database (creates all the tables and
such)
> > and then the script uses the tables to store information and whatever
else
> > it may have to do.
> >
> > The problem is, the install works just fine,
>
> Are you sure?
>
> > but when I try to access the
> > database through the script later on, it outputs the following:
> >
> > Database error: cannot use database anime-soup_com_-_chatting
>
> AFAIK, you cannot use hyphens in the database name.
>
> --
> 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
> --
> /*
> I just had a NOSE JOB!!
> */
>
> --
> 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



RE: [PHP] How to use anchor with php post string to jump to a page???

2003-12-12 Thread Chris
PHP never sees the #RowNum3 part. That is used exclusively by the browser as
it is not parsing instructions, just tells you what part of the parsed page
to look at.

Chris

> > > http://www.yourserver.com/yourpage.htm?color=red#RowNum3
> > > target="doc">Jump

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



RE: [PHP] can't access a GET variable on function?

2003-12-15 Thread Chris
$emailto is in the global scope, so it's not accessible like that.

You can do it one of three ways:

$emailto = $_GET['EmailTO'];

function wtemp_mainbody() {
global $emailto;
print "Contact (";
echo $emailto;
print ") Info";
}
 or

$emailto = $_GET['EmailTO'];

function wtemp_mainbody() {
print "Contact (";
echo $GLOBALS['emailto'];
print ") Info";
}
or (recommended)

function wtemp_mainbody() {
print "Contact (";
echo $_GET['EmailTO'];
print ") Info";
}
-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED]
Sent: Monday, December 15, 2003 8:32 PM
To: [EMAIL PROTECTED]
Subject: [PHP] can't access a GET variable on function?


$emailto = $_GET['EmailTO'];

function wtemp_mainbody() {
print "Contact (";
echo "$emailto";
print ") Info";
}

Why can't i display a GET variable from a function? Or should i registered
it on global session?




-- -
Louie Miranda
http://www.axishift.com

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

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



RE: [PHP] mail question (mime)

2003-12-16 Thread Chris
I see 3 problems with your final output (though there still could be more)

1) Each header has to end in \r\n, \n usually works but it's supposed to be
\r\n

2) This:
$headers .="Content-Type: multipart/alternative;
boundary=\"--i0o9u8h7g65v\"";

should be this:
$headers .="Content-Type: multipart/alternative;
boundary=\"--i0o9u8h7g65v\"";

or this:
$headers .="Content-Type: multipart/alternative;
  boundary=\"--i0o9u8h7g65v\"";

A header can continue on the next line for readability, but it has to start
with whitespace (space or a tab), otherwise it trys to create the boundary
as a new header.

3) The final boundary must end in -- as well as start with it
so:
$message .="--i0o9u8h7g65v";

should be

$message .="--i0o9u8h7g65v--";

Chris


-Original Message-
From: Bill Green [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 8:19 AM
To: [EMAIL PROTECTED]
Subject: [PHP] mail question (mime)


Greetings all. (hope this isn't a second post, first try seemed to fail)

In an effort to understand more about mime mail, I'm writing a
little function to send a multipart/alternative encoded mime mail from a
browser interface. I know you guys have answered these types of questions
many times, but I've googled and research til I'm blue. I'm still somewhat
new to php so I apologize. I'm on a shared hosting environment running
Apache 1.3.29 (Unix), magic_quotes_gpc = on, path to sendmail =
/usr/sbin/sendmail -t -i, smtp is localhost on port 25 (and I don't know
much about Unix permissions). My client platform is Mac, my email client is
Outlook Express (might as well be testing to the lowest common denominator).
I've found lots of php classes on mime mail but have not tried them because
I want to understand the code.

I can use this code to send plain text email or html email just fine, but
not multipart/alternative or mixed. Here's the relevant code. Can someone
point out the error of my ways?

browser interface: 5 fields (3 input of type=text, 2 input of type=textarea)
names:
$from
$to
$subject
$text_msg
$html_msg

On submit, I trim all and stripslashes on the textarea inputs (interesting
that magic quotes seems to add slashes to textarea inputs automatically),
then set my email headers:

$headers ="From: {$from}\n";
$headers .="Reply-To: {$from}\n";
$headers .="Return-Path: {$from}\n";
$headers .="Subject: {$subject}\n";
$headers .="X-Sender: {$from}\n";
$headers .="X-Mailer: PHP\n";
$headers .="X-MSMail-Priority: High\n";
$headers .="MIME-Version: 1.0\n";
$headers .="Content-Type: multipart/alternative;
boundary=\"--i0o9u8h7g65v\"";
$message ="--i0o9u8h7g65v\n";
$message .="Content-Type: text/plain; charset=iso-8859-1\n";
$message .="Content-Transfer-Encoding: 7bit\n";
$message .="Content-Disposition: inline\n";
$message .=$text_msg."\n";//plain text message here
$message .="--i0o9u8h7g65v\n";
$message .="Content-Type: text/html; charset=iso-8859-1\n";
$message .="Content-Transfer-Encoding: 7bit\n";
$message .="Content-Disposition: inline\n";
$message .=$html_msg."\n";//html message here
$message .="--i0o9u8h7g65v";

mail($to,$subject,$message,$headers);

The email is sent successfully, but with no message in the message body.
Looking at the message source I see that all of the headers are set and I
see the boundaries and I see both versions of the messages as one would
expect. It all looks correct, even as compared to other mime encoded email I
receive and read just fine. I've tried many variations on these variables.
FYI, if I change the $header = "Content-Type: multipart/alternative; ";
to $message = "Content-Type: ..."; then I see the raw code in the message
body, but of course that does no good. Same results when message is viewed
in a browser based hotmail or yahoo account.

I simply do not understand what I don't understand, so I don't know how to
ask my question. Is this a coding problem, sendmail, permissions, a server
issue???

Thanks for your help.


--
Bill
--

--
Bill
--

--
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] Internal Searches on Windows 2000 Server / Apache

2003-12-16 Thread Chris
Hi.

I am trying to implement a search feature for a corporate website, but
haven't found anything that is viable.

My main problem seems to be that there are fewer options out there for
PHP/Apache/Windows.

ht://dig is not available for Windows.

The Google Web API has several limitations which we wouldn't want(Such as:
only 10 results per query, Limit of 1000 requests per day, possibly buggy
code as it's still in beta)

I've also considered writing my own code to index all the pages and put them
in a DB for the search. I feel confident I could do it, but it would take a
long time and would be much better if there was another solution out there.

Are there any other options out there for me? I'm open to just about
anything.

Thanks,
Chris

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



RE: [PHP] Internal Searches on Windows 2000 Server / Apache

2003-12-16 Thread Chris
Thanks for the response.

I can't seem to find ASPSeek available for Windows at all. Did you say they
had one?

The windows version of mnoGoSearch looks like it could be suitable. Do any
of you have any experience with it? This isn't a large website (maybe a few
hundred pages), but it needs to work reliably and quickly.

Thanks once again,
Chris

-Original Message-
From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 4:42 PM
To: Chris; PHP List
Subject: Re: [PHP] Internal Searches on Windows 2000 Server / Apache


Try mnogosearch or aspseek both these are open source. aspseek does not
have a PHP front but it's template based with C back end. However i do
belive the windows version may not be free.

Chris wrote:

>Hi.
>
>I am trying to implement a search feature for a corporate website, but
>haven't found anything that is viable.
>
>My main problem seems to be that there are fewer options out there for
>PHP/Apache/Windows.
>
>ht://dig is not available for Windows.
>
>The Google Web API has several limitations which we wouldn't want(Such as:
>only 10 results per query, Limit of 1000 requests per day, possibly buggy
>code as it's still in beta)
>
>I've also considered writing my own code to index all the pages and put
them
>in a DB for the search. I feel confident I could do it, but it would take a
>long time and would be much better if there was another solution out there.
>
>Are there any other options out there for me? I'm open to just about
>anything.
>
>Thanks,
>Chris
>
>
>


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.

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

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



RE: [PHP] PHP: remote file open problem

2003-12-17 Thread Chris
I suggest you read http://www.php.net/manual/en/features.file-upload.php

The GET method shouldn't work (though it may be possible). In all likelihood
your browser is just sending the local filename as a string and not
attempting to upload the file at all.

You need to use the Array $_FILES['Filename'] to access the various bits of
data about the file. Try doing print_r($_FILES); in upload.php to see if
it's there.

I would guess that a host that does not allow the POST method would not
allow file uploads at all.

CHris
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 16, 2003 9:37 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP: remote file open problem



Hello,
I have a HTML form through which I upload a file from the user's PC to the
server.  But my PHP script gives  the error:
Warning: fopen(C:\local path to\filename): failed to open stream: No such
file or directory
Note:  I cannot use the POST method in HTML is because my webhost supports
only GET method. Also I do not want to use FTP.

My observations: The $_FILES does not get populated also.

Somebody please help.  Thanks a lot.

 HTML SCRIPT /
My HTML script:








/// PHP SCRIPT ///
My PHP script upload.php:
Go BACK");
exit;
}

?>

/ end of php script 

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

2003-12-17 Thread Chris
That should be $_POST['dowork'] , $_POST[dowork] will attempt to use dowork
as a constant

-Original Message-
From: manoj nahar [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 10:51 AM
To: Tom Holton
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] strange!


Change this line

if($dowork) {

to


if($_POST[dowork]) {

it should work the. In your php.ini the variable register_gloabal seem
to be off.

Manoj Nahar

Tom Holton wrote:

>Hello everyone,
>I looked through the FAQs and documentation and I cannot find this
>anywhere:
>
>We have a new Redhat server with this kernal: 2.4.20-20.9smp #1 SMP
>We used redhat itself to install apache and php (I used to always do it by
>hand)
>apache: Server version: Apache/2.0.40
>PHP Version 4.2.2
>
>I found the PHP version out by making a file containing: 
>
>I also can get statements like
>
>print "something"
>
>and even
>
>$TT =TRUE;
>if($TT) print "something else";
>
>to work.
>But, incredibly to me, I cannot get form variables to be sent and "seen".
>See the end of the email for the example script.
>
>I can take this very simple script that does not work on this new server
>and have it work on my current server which is running PHP Version 4.1.2
>and Apache Server version: Apache/1.3.22 (Unix)
>
>I saw that there were incompatibility issues with PHP's prior to version
>4.2.3 with Apache 2.0, but, since I can get some statements to work, and
>it is only because the form variables are not recognized, I thought it
>must be some new directive in httpd.conf of php.ini
>
>Any help or info on this is much appreciated!
>
>
>
>$TT=TRUE;
>if($TT) print "TT worked";
>
>if($dowork) {
>  print "These statements do not print when the dowork button is
>pushed";
>  print "Field 1: $fld1";
>  print "Field 2: $fld2";
>  print "Field 3: $fld3";
>}
>
>
>print "this statement prints";
>
>?>
>
>
>
>
>
>
>
>
>?>
>
>
>

--
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] html or php to pdf whith pdflib?

2003-12-20 Thread Chris
Hi Reicardo,
This can't be done by using the pdf_* functions in php without reading the
whole source file, parsing the HTML and then working the $x and $y for each
line.

There are some alternatives. If you don't really care to much about
formatting you could try this:

$pdf = pdf_new();

pdf_open_file($pdf);
pdf_begin_page($pdf, 595, 842);
$font = pdf_findfont($pdf, "Times-Roman", "winansi", 0);
if ($font) {
   pdf_setfont($pdf, $font, 10);
}else{
 die("Font Error");
}
pdf_set_value($pdf, "textrendering", 1);
PDF_show_wraped($pdf,strip_tags(implode("",file($filename))), 50,750,500);

pdf_end_page($pdf);
pdf_close($pdf);   

$data = pdf_get_buffer($pdf);

header("Content-type: application/pdf");
header("Content-disposition: inline; filename=test.pdf");
header("Content-length: " . strlen($data));
echo $data;



function PDF_show_wraped(&$pdf, $text, $left, $top, $width){
$fontsize = pdf_get_value($pdf,'leading');
$length = pdf_stringwidth($pdf,$text);
$textHeight = ceil($length/$width)*$fontsize;
$h_align='left';
while(pdf_show_boxed($pdf,$text,
$left,$top,$width,$textHeight,$h_align,'blind') > 1){
$textHeight += $fontsize;
}
$top-=$textHeight;
pdf_show_boxed($pdf,$text,$left,$top,$width,$textHeight,$h_align);
return $top-$textHeight;
}

Of course you would need to do something about page wrapping but that should
be quite easy.


Also you could exec() an external programme like txt2pdf
(<http://www.codecuts.com/mainpage.asp?WebPageID=156>). I have seen a
html2pdf as well but can't remember where right now.



Chris 

> -Original Message-
> From: E. Ricardo Santos [mailto:[EMAIL PROTECTED] 
> Sent: 20 December 2003 02:22
> To: [EMAIL PROTECTED]
> Subject: [PHP] html or php to pdf whith pdflib?
> 
> Hello, somebody knows like turning a file HTML or php to pdf 
> by means of pdflib but without having to write  line  to  line?
> 
> 
> 
> that is, a file already existing php or HTML, can be turned 
> with pdflib?
> 
> 
> 
> This  I ask it because to where it studies pdflib, exit pdf 
> is due to write line  by  line  and coordinate by coordinate. 
> A pdf  already  created can also be mattered and to combine 
> it with the new exit. But what  I did not find  he is all 
> this is the particularitity that I raise.
> 
> 
> 
> I hope  has explained to me correctly
> 
> --
> 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] mysql load_file retreival

2003-12-20 Thread Chris
LOAD_FILE() shouldn't be escaping the data. Are you actually calling : echo
header()? the header function should not be echoed.

header('Content-type: application/pdf');
echo result[0];

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 9:29 AM
To: PHP List
Subject: [PHP] mysql load_file retreival


I have set up a script to recieve a pdf file and store it in a mysql db
using "update db set field=load_file('fileIncludingFile') where id=$id".
Afterwards I can see the file has been uploaded into the blob field
successfully and without errors.  Now I want to get the file back out.  I
set up a script with "select field from db where id=$id" and used
mysql_query followed by mysql_fetch_row and did echo header("Content-type:
application/pdf"); and then echo result[0]; where result was the row
fetched.  I get the prompt to open with pdf but pdf fails.  I have
magicquotes on but I understand that the load_file() function within mysql
does the escaping etc.  How can I "un-escape" the data?  The only thing I
saw on the mysql manual is on how to use load_file_infile/load_file_outfile
which does not apply to this.  Can someone lend a hand here?

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

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



RE: [PHP] mysql load_file retreival

2003-12-20 Thread Chris
Try looking at the data that's supposed to be outputing the pdf. Something
may be failing somewhere and you might see an error message. If you don't
see any error messages and are apparently seeing gthe pdf data, check for
whitespace outside php tags and any extraneous echo's or print's, that would
very likely cause the pdf to not be able to be read properly.

Chris

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 10:36 AM
To: Chris; PHP List
Subject: RE: [PHP] mysql load_file retreival


Oops, my bad on the post.  I am not sending echo header...just header(...

I thought, based on reading from mysql that it did escape certain
characters.  I'll start looking at other possibilities...

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 1:24 PM
To: PHP List
Subject: RE: [PHP] mysql load_file retreival


LOAD_FILE() shouldn't be escaping the data. Are you actually calling : echo
header()? the header function should not be echoed.

header('Content-type: application/pdf');
echo result[0];

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 9:29 AM
To: PHP List
Subject: [PHP] mysql load_file retreival


I have set up a script to recieve a pdf file and store it in a mysql db
using "update db set field=load_file('fileIncludingFile') where id=$id".
Afterwards I can see the file has been uploaded into the blob field
successfully and without errors.  Now I want to get the file back out.  I
set up a script with "select field from db where id=$id" and used
mysql_query followed by mysql_fetch_row and did echo header("Content-type:
application/pdf"); and then echo result[0]; where result was the row
fetched.  I get the prompt to open with pdf but pdf fails.  I have
magicquotes on but I understand that the load_file() function within mysql
does the escaping etc.  How can I "un-escape" the data?  The only thing I
saw on the mysql manual is on how to use load_file_infile/load_file_outfile
which does not apply to this.  Can someone lend a hand here?

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

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

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



RE: [PHP] mysql load_file retreival

2003-12-20 Thread Chris
Gald to hear it works now. Are you base64 encoding it for any particular
reason? Seems to me that it would waste a lot of db space as base64 encoding
adds quite a bit to the filesize.

Chris

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 2:16 PM
To: Chris; PHP List
Subject: RE: [PHP] mysql load_file retreival


Thanks for the help.  I went through a troubleshooting phase that started
with writing the raw data from the mysql client to disk.  Checking the size
it was apparent that it was much too small.  I tried running my script with
a smaller pdf and it worked.  It turns out that blob has a max of 64k.  A
tad small for general use for holding graphics.  I changed to a mediumblob
which is either 12 or 16 meg, I'm not sure off the top of my head now but,
that is plenty for my needs.  I did end up changing the behaviour of my
script though.  Instead of writing to a file and using load_file, I recieved
the file on upload, base64 encoded it and stored it directly to the db.
Then on retrieval, unencoded and handed it off with content type, size,
name, and application information in the header.  It works very nicely.

Thanks again...

Larry

-Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 3:49 PM
To: PHP List
Subject: RE: [PHP] mysql load_file retreival


Try looking at the data that's supposed to be outputing the pdf. Something
may be failing somewhere and you might see an error message. If you don't
see any error messages and are apparently seeing gthe pdf data, check for
whitespace outside php tags and any extraneous echo's or print's, that would
very likely cause the pdf to not be able to be read properly.

Chris

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 10:36 AM
To: Chris; PHP List
Subject: RE: [PHP] mysql load_file retreival


Oops, my bad on the post.  I am not sending echo header...just header(...

I thought, based on reading from mysql that it did escape certain
characters.  I'll start looking at other possibilities...

-----Original Message-
From: Chris [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 1:24 PM
To: PHP List
Subject: RE: [PHP] mysql load_file retreival


LOAD_FILE() shouldn't be escaping the data. Are you actually calling : echo
header()? the header function should not be echoed.

header('Content-type: application/pdf');
echo result[0];

-Original Message-
From: Larry Brown [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 20, 2003 9:29 AM
To: PHP List
Subject: [PHP] mysql load_file retreival


I have set up a script to recieve a pdf file and store it in a mysql db
using "update db set field=load_file('fileIncludingFile') where id=$id".
Afterwards I can see the file has been uploaded into the blob field
successfully and without errors.  Now I want to get the file back out.  I
set up a script with "select field from db where id=$id" and used
mysql_query followed by mysql_fetch_row and did echo header("Content-type:
application/pdf"); and then echo result[0]; where result was the row
fetched.  I get the prompt to open with pdf but pdf fails.  I have
magicquotes on but I understand that the load_file() function within mysql
does the escaping etc.  How can I "un-escape" the data?  The only thing I
saw on the mysql manual is on how to use load_file_infile/load_file_outfile
which does not apply to this.  Can someone lend a hand here?

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

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

--
PHP 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] List values

2003-12-21 Thread Chris


$value){
?>
>



   

> -Original Message-
> From: Chakravarthy Cuddapah [mailto:[EMAIL PROTECTED] 
> Sent: 21 December 2003 12:47
> To: [EMAIL PROTECTED]
> Subject: [PHP] List values
> 
> Can anyone pls tell me how to dynamically list values in a 
> ListMenu. The values do not come from any database. They are 
> stored in php variables. Sample code will be highly appreciated.
> 

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



[PHP] Re: File Upload on a MAC-Browser didn't work

2003-12-22 Thread Chris
I had a similar problem, but never found an answer. In my situation, the
browser hung when I uploaded a file greater than 800 records. I found a post
that said I should echo something to the browser on a regular basis during
the upload, but that didn't work.

This is still of interest to me to solve. Perhaps we can together find a
solution

Chris

"Volker DåHn" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi,

The following script works on any browser on windows xp. But not on a mac
(osx)
It simply shows the temp-directoryname.
Is anybody out there who could help me to fix this problem?
How will the upload work with Safari?

Thanks for your help.

This is the form for the upload:







The following site checks the uplad and copies the file to a specific
folder:

// if the Picture was uploaded
if ($BildDatei!="" AND
is_uploaded_file($_FILES['BildDatei']['tmp_name'])) {
// Check for JPG
if ($_FILES['BildDatei']['type']=='image/pjpeg') {
// Move File
$TestFile=$UserCoverDir.$ISBNFeld.".jpg";
move_uploaded_file($_FILES['BildDatei']['tmp_name'], "$TestFile");
}
} else {
echo "Save unsuccesfull";
}

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



[PHP] Can't upload file greater than 11kb

2003-12-22 Thread Chris
I've got a situation where I want to upload a file to a server then enter
the data in that file into mysql. I have used this well documented upload
form


Send this file: 





script on many php servers. However I am on one now which is not allowing me
to upload a file greater than 12kb.

I know the upload_max_filesize is 2M but something else is stopping the
upload and I don't have a clue what it is. I know you should include  in the above form but that
is only a convenience for the user.

This particular server is running php as a cgi module.

Thanks

Chris

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



Re: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread Chris
I don't believe that the MAX_FILE_SIZE needs to be there. It will only
terminate the upload process at the client, rather than wait for the upload
to complete.

Anyway with or without MAX_FILE_SIZE the upload process is being terminated
after the file is uploaded.

When the form is submitted, the selected file is uploaded to the server's
temp directory then copied to the maps dir.  For some reason, when the file
size exceeds 11kb (very small) the process
gets aborted (with or without MAX_FILE_SIZE). I've put in diagnostic
messages and the POST script throws an error message if it can't find the
file
in the temp directory. I've uploaded several file sizes up to the max of 2MB
and it appears the file is being uploaded. I base this assumption on the
fact the upload time is proportional to the file size. When the file size is
greater than 11kb it appears that the file is deleted from the temp dir.

Still no idea what is going on.
Chris

"Larry Brown" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The  must be before the ...type="file"... tag and after  Mozilla Firebird as the client) If you have it in there and remember it is
> in bytes not kb and set it to a size large enough the script accepting the
> file will show $_FILE['name'] and it will show $_FILE['tmp_name'] having
the
> temporary file.  Then you take that hidden tag out and do the same the
> $_FILE['tmp_name'] variable will be empty since it did not recieve the
file.
> So I know at least in my case that the hidden field has to be there.
>
> Larry
>
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]
> Sent: Monday, December 22, 2003 8:55 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Can't upload file greater than 11kb
>
>
> I've got a situation where I want to upload a file to a server then enter
> the data in that file into mysql. I have used this well documented upload
> form
>
> 
> Send this file: 
>
> 
>
> 
>
> script on many php servers. However I am on one now which is not allowing
me
> to upload a file greater than 12kb.
>
> I know the upload_max_filesize is 2M but something else is stopping the
> upload and I don't have a clue what it is. I know you should include
 type="hidden" name="MAX_FILE_SIZE" value="3"> in the above form but
that
> is only a convenience for the user.
>
> This particular server is running php as a cgi module.
>
> Thanks
>
> Chris
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



Re: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread Chris
post_max_size: 8M
upload_max_filesize: 10M

what quota and disk space affect the web server process and temp dir

This site is hosted by a third party:
Disk space is 400MB only a fraction is used.
temp dir -- unknown


Chris --

...and then Chris said...
%
% script on many php servers. However I am on one now which is not allowing
me
% to upload a file greater than 12kb.

What does phpinfo() say for

  post_max_size
  upload_max_filesize

and what quota and disk space affect the web server process and temp dir?


HTH & HAND

"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: [PHP] Can't upload file greater than 11kb

2003-12-23 Thread Chris
It has been my experience that max_file_size does terminate the upload
process if you include it in the form.
But you are right, if it gets to the upload, your stuck.

LimitRequestBody is beyond my control as the site is hosted by a third
party.

Thanks
Chris


"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> It's often said in many newsgroups and articles that the max_file_size
> is next to useless. It's also said that once IE starts uploading it will
> not stop even if you keep you foot on the stop button!
>
> If i remembers the earlier messages you have said the php.ini settings
> are correct. If so it could well be that you might be having
> misconfigured proxy server or firewall in the way.
>
> Apache also has a setting (LimitRequestBody) that could effect your
upload.
>
> all the best
>
> Chris wrote:
>
> >I don't believe that the MAX_FILE_SIZE needs to be there. It will only
> >terminate the upload process at the client, rather than wait for the
upload
> >to complete.
> >
> >Anyway with or without MAX_FILE_SIZE the upload process is being
terminated
> >after the file is uploaded.
> >
> >When the form is submitted, the selected file is uploaded to the server's
> >temp directory then copied to the maps dir.  For some reason, when the
file
> >size exceeds 11kb (very small) the process
> >gets aborted (with or without MAX_FILE_SIZE). I've put in diagnostic
> >messages and the POST script throws an error message if it can't find the
> >file
> >in the temp directory. I've uploaded several file sizes up to the max of
2MB
> >and it appears the file is being uploaded. I base this assumption on the
> >fact the upload time is proportional to the file size. When the file size
is
> >greater than 11kb it appears that the file is deleted from the temp dir.
> >
> >Still no idea what is going on.
> >Chris
> >
> >"Larry Brown" <[EMAIL PROTECTED]> wrote in message
> >news:[EMAIL PROTECTED]
> >
> >
> >>The  >>
> >>
> >It
> >
> >
> >>must be before the ...type="file"... tag and after  >>Mozilla Firebird as the client) If you have it in there and remember it
is
> >>in bytes not kb and set it to a size large enough the script accepting
the
> >>file will show $_FILE['name'] and it will show $_FILE['tmp_name'] having
> >>
> >>
> >the
> >
> >
> >>temporary file.  Then you take that hidden tag out and do the same the
> >>$_FILE['tmp_name'] variable will be empty since it did not recieve the
> >>
> >>
> >file.
> >
> >
> >>So I know at least in my case that the hidden field has to be there.
> >>
> >>Larry
> >>
> >>-Original Message-
> >>From: Chris [mailto:[EMAIL PROTECTED]
> >>Sent: Monday, December 22, 2003 8:55 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP] Can't upload file greater than 11kb
> >>
> >>
> >>I've got a situation where I want to upload a file to a server then
enter
> >>the data in that file into mysql. I have used this well documented
upload
> >>form
> >>
> >>
> >>Send this file: 
> >>
> >>
> >>
> >>
> >>
> >>script on many php servers. However I am on one now which is not
allowing
> >>
> >>
> >me
> >
> >
> >>to upload a file greater than 12kb.
> >>
> >>I know the upload_max_filesize is 2M but something else is stopping the
> >>upload and I don't have a clue what it is. I know you should include
> >>
> >>
> > >
> >
> >>type="hidden" name="MAX_FILE_SIZE" value="3"> in the above form but
> >>
> >>
> >that
> >
> >
> >>is only a convenience for the user.
> >>
> >>This particular server is running php as a cgi module.
> >>
> >>Thanks
> >>
> >>Chris
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress bar.

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



RE: [PHP] How do I make these two MySQL queries into one line?

2003-12-24 Thread Chris
You should *really* consider yourself lucky, because this is a PHP list, not
MySQL.

"SELECT members.email FROM groups LEFT JOIN members USING(member_id) WHERE
'$chosenGroup'=group_id AND 'yes'=active"

You should really find a tutorial on Joins, jsut search on `SQL tutorial
joins`

Chris

-Original Message-
From: Dave G [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 23, 2003 10:45 PM
To: 'PHP General'
Subject: [PHP] How do I make these two MySQL queries into one line?


PHP Gurus,
I'll consider myself lucky to get a response so close to
Christmas, but here goes.

I have two tables. One contains member information, and one
lists which groups the members belong to. I want to select the email
address of active members from the member information table, and I want
to select only the members which belong to a particular group. Right now
I can only think to accomplish this in two lines:
$query1 = "SELECT member_id FROM groups WHERE group_id =" .
$chosenGroup
Then, take the results and do another query:
$query2 = "SELECT email FROM members WHERE active = yes AND
member_id =" . $query1Results

But surely there's a way to collapse this into one MySQL line.

--
Yoroshiku!
Dave G
[EMAIL PROTECTED]

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

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



RE: [PHP] newbie mysql and php

2003-12-28 Thread Chris
It looks like mysql_query is failing, add these two lines to your code, and
see what message pops up:

...
$dbdo = mysql_query($query,$dbconnect);
if(false === $dbdo) echo mysql_errno(),': ',mysql_error();
else echo 'The query worked, $dbdo value is:',$dbdo;
while($row= mysql_fetch_array($dbdo)){
...


Chris

-Original Message-
From: tony [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 27, 2003 4:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP] newbie mysql and php


hello

I'm new with php just learning and i have just a problem with the following
code

$dbconnect = mysql_connect("localhost", "prog_tony","PASSWORD");
mysql_select_db("prog_dealer", $dbconnect);
$stop = 0;
$counter = 1;
while(!$stop){
$query = "SELECT name FROM category WHERE id = $counter";
$dbdo = mysql_query($query,$dbconnect);
while($row= mysql_fetch_array($dbdo)){
if($row[0]){
$counter++;
}else{
$stop=1;
}
$row[0] = "";
}

}



I'm getting an error with mysql_fetch_array() which is line 14 because I
didn't show the other lines since it is not relevant.
here is the error
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
resource in /home/prog/public_html/php/cateadded.php on line 14

Thank you

--
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] Can't upload file greater than 11kb

2003-12-28 Thread Chris
Unfortunately, creating/editing .htaccess is not an operational requirement.

Thanks anyway.
Chris

"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> if you are lucky LimitRequestBody could go into a .htaccess file (not
> sure though  been a couple of months since i last read the manual)
>
> Chris wrote:
>
> >It has been my experience that max_file_size does terminate the upload
> >process if you include it in the form.
> >But you are right, if it gets to the upload, your stuck.
> >
> >LimitRequestBody is beyond my control as the site is hosted by a third
> >party.
> >
> >Thanks
> >Chris
> >
> >
> >"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
> >news:[EMAIL PROTECTED]
> >
> >
> >>Hi,
> >>
> >>It's often said in many newsgroups and articles that the max_file_size
> >>is next to useless. It's also said that once IE starts uploading it will
> >>not stop even if you keep you foot on the stop button!
> >>
> >>If i remembers the earlier messages you have said the php.ini settings
> >>are correct. If so it could well be that you might be having
> >>misconfigured proxy server or firewall in the way.
> >>
> >>Apache also has a setting (LimitRequestBody) that could effect your
> >>
> >>
> >upload.
> >
> >
> >>all the best
> >>
> >>Chris wrote:
> >>
> >>
> >>
> >>>I don't believe that the MAX_FILE_SIZE needs to be there. It will only
> >>>terminate the upload process at the client, rather than wait for the
> >>>
> >>>
> >upload
> >
> >
> >>>to complete.
> >>>
> >>>Anyway with or without MAX_FILE_SIZE the upload process is being
> >>>
> >>>
> >terminated
> >
> >
> >>>after the file is uploaded.
> >>>
> >>>When the form is submitted, the selected file is uploaded to the
server's
> >>>temp directory then copied to the maps dir.  For some reason, when the
> >>>
> >>>
> >file
> >
> >
> >>>size exceeds 11kb (very small) the process
> >>>gets aborted (with or without MAX_FILE_SIZE). I've put in diagnostic
> >>>messages and the POST script throws an error message if it can't find
the
> >>>file
> >>>in the temp directory. I've uploaded several file sizes up to the max
of
> >>>
> >>>
> >2MB
> >
> >
> >>>and it appears the file is being uploaded. I base this assumption on
the
> >>>fact the upload time is proportional to the file size. When the file
size
> >>>
> >>>
> >is
> >
> >
> >>>greater than 11kb it appears that the file is deleted from the temp
dir.
> >>>
> >>>Still no idea what is going on.
> >>>Chris
> >>>
> >>>"Larry Brown" <[EMAIL PROTECTED]> wrote in message
> >>>news:[EMAIL PROTECTED]
> >>>
> >>>
> >>>
> >>>
> >>>>The  >>>>
> >>>>
> >>>>
> >>>>
> >>>It
> >>>
> >>>
> >>>
> >>>
> >>>>must be before the ...type="file"... tag and after  >>>>
> >>>>
> >with
> >
> >
> >>>>Mozilla Firebird as the client) If you have it in there and remember
it
> >>>>
> >>>>
> >is
> >
> >
> >>>>in bytes not kb and set it to a size large enough the script accepting
> >>>>
> >>>>
> >the
> >
> >
> >>>>file will show $_FILE['name'] and it will show $_FILE['tmp_name']
having
> >>>>
> >>>>
> >>>>
> >>>>
> >>>the
> >>>
> >>>
> >>>
> >>>
> >>>>temporary file.  Then you take that hidden tag out and do the same the
> >>>>$_FILE['tmp_name'] variable will be empty since it did not recieve the
> >>>>
> >>>>
> >>>>
> >>>>
> >>>file.
> >>>
> >>>
> >>>
> >>>
> >>>>So I know at least in my case that the hidden field has to be there.
> >>>>
&

Re: [PHP] Can't upload file greater than 11kb

2003-12-29 Thread Chris
Since this install of PHP is a CGI module, the server limits any execution
to 30 seconds. Why should upload_max_filesize be greater than post_max_size?
Why would this have any effect on a file size of 11kb?

"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> post_max_size should be greater than upload_max_filesize.
>
> What is the setting for max_input_time?
>
> Chris wrote:
> > post_max_size: 8M
> > upload_max_filesize: 10M
> >
> > what quota and disk space affect the web server process and temp dir
> >
> > This site is hosted by a third party:
> > Disk space is 400MB only a fraction is used.
> > temp dir -- unknown
> >
> >
> > Chris --
> >
> > ...and then Chris said...
> > %
> > % script on many php servers. However I am on one now which is not
allowing
> > me
> > % to upload a file greater than 12kb.
> >
> > What does phpinfo() say for
> >
> >   post_max_size
> >   upload_max_filesize
> >
> > and what quota and disk space affect the web server process and temp
dir?
> >
> >
> > HTH & HAND
> >
> > "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: [PHP] Can't upload file greater than 11kb

2003-12-29 Thread Chris
The application is going to being supplied to a number of customers who may
not know how to or don't have the ability to create/modify a .htaccess file.

I tend to agree with Raditha about this being an Apache issue. Upon
complaint to the hosting provider about this issue the did something that
increased the upload file size to several hundred kilobytes. They claimed it
has something to do with the temp dir where the file is being uploaded to.
My suspect now is this issue has nothing to do with php. I'll bet I could
write a cgi script as an action to the form and would encounter the same
problem.

Chris


"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> Both Marek and Asegu have raised a very valid point about
> upload_max_filesize < post_max_size
> hower Chris seems to have set this in megabytes  but the limit kicks in
> to place at 11 KILO bytes. That's why i am convinced it's either an
> apache setting or a proxy getting in the way.
>
> Chris, in an earlier message you have said using .htaccess is not part
> of the requirement!? can you explain what you mean by that?
>
> To answer your other question on timing the max execution time is not
> considered important for handling file uploads but max input time is
> very important.
>
>
> Asegu wrote:
>
> >your file is sent through post.
> >
> >If your post upload max size is smaller then your upload max size, then
> >the file wouldn't all fit within the post data that PHP will accept. Your
> >upload would then get blocked.
> >Therefore, post_max_size should be set to a larger value then
> >upload_max_filesize to allow the upload to work in the first place.
> >
> >Andrew.
> >
> >
> >
> >
> >>Since this install of PHP is a CGI module, the server limits any
execution
> >>to 30 seconds. Why should upload_max_filesize be greater than
> >>post_max_size?
> >>Why would this have any effect on a file size of 11kb?
> >>
> >>"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
> >>news:[EMAIL PROTECTED]
> >>
> >>
> >>>post_max_size should be greater than upload_max_filesize.
> >>>
> >>>What is the setting for max_input_time?
> >>>
> >>>Chris wrote:
> >>>
> >>>
> >>>>post_max_size: 8M
> >>>>upload_max_filesize: 10M
> >>>>
> >>>>what quota and disk space affect the web server process and temp dir
> >>>>
> >>>>This site is hosted by a third party:
> >>>>Disk space is 400MB only a fraction is used.
> >>>>temp dir -- unknown
> >>>>
> >>>>
> >>>>Chris --
> >>>>
> >>>>...and then Chris said...
> >>>>%
> >>>>% script on many php servers. However I am on one now which is not
> >>>>
> >>>>
> >>allowing
> >>
> >>
> >>>>me
> >>>>% to upload a file greater than 12kb.
> >>>>
> >>>>What does phpinfo() say for
> >>>>
> >>>>  post_max_size
> >>>>  upload_max_filesize
> >>>>
> >>>>and what quota and disk space affect the web server process and temp
> >>>>
> >>>>
> >>dir?
> >>
> >>
> >>>>HTH & HAND
> >>>>
> >>>>"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
> >>
> >>
> >>
> >>
> >>
> >
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 150 KB | with progress bar.

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



[PHP] Re: Can't upload files > then 400K to MySQL

2003-12-29 Thread Chris
Have you taken a look at the post below: Can't upload files Greater than
11KB?
We may have the same problem.


"Ahmetax" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> I have the following PHP code to upload files to a MySQL table.
>
> It works fine, but, I can't upload any files greater then 400K.
>
> What might be the problem?
>
> TIA
>
> ahmet
>
>  if (isset($_POST["submit"]))
> {
> $fname= $_FILES["user_file"]["name"];
> $tmp= addslashes($_FILES["user_file"]["tmp_name"]);
> $size= $_FILES["user_file"]["size"];
> $type=$_FILES["user_file"]["type"];
> $tanim=$_FILES["user_file"]["file_desc"];
> $fd=fopen($tmp,"r") or die("Can't open file!");
> $fdata=urlencode(fread($fd,filesize($tmp)));
> $size=filesize($tmp);
> $tanim=$descript;
> include("baglan.inc");
>
> mysql_select_db("dosyalar");
> $sql="INSERT INTO files (name,file_type,file_desc,file_data,file_size)".
> " VALUES('$fname','$type','$descr','$fdata','$size')";
> mysql_query($sql);
> }
> ?>
> 
> 
> 
> AxTelSoft-Uploading a file 
> 
> 
> 
> 
> 
> 
> 
> 
>
> " method="post">
> 
>
> Send this file: 
> Explanations :  echo($descr);
> ?>
> 
> 
>
> 
> 

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



RE: [PHP] Optional Vars in Functions

2004-01-02 Thread Chris
http://www.php.net/functions

-Original Message-
From: Jason Williard [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 1:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Optional Vars in Functions


Is there a way to make a variable of a function optional?

 

Thank You,

Jason Williard

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



RE: Re[2]: [PHP] End slash, small problem.

2004-01-02 Thread Chris
You forgot to double slash the windows slash like: '\\'

I would write that same functionality as follows:

$sep = (PHP_OS == 'Windows')? '\\':'/';
if(substr($template_path,-1) == $sep)) $template_path .= $sep;

-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]
Sent: Friday, January 02, 2004 7:24 PM
To: Ryan A
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re[2]: [PHP] End slash, small problem.


Hi,

Saturday, January 3, 2004, 11:23:00 AM, you wrote:
RA> Hi,
RA> Thanks for replying.

RA> Basically after that path I am adding a file "ryanFile.php" so I need
that
RA> ending slash to always be in the path

RA> My question was exactly that...how do I "grab" the last character?

RA> Thanks,
RA> -Ryan


I do it like this:

$sep = (PHP_OS == 'Windows')? '\':'/';
$template_path .= (substr($template_path,-1) == $sep)? '':$sep;



--
regards,
Tom

--
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] replacing null characters

2001-01-09 Thread Chris

Hi all,

I'm trying to work out how to replace '^@' characters with 0's. I've even 
tried replacing them with another character, and back to 0's again.. it 
still comes out as '^@' (which I'm guessing is null). The '^@'s only appear 
when a 0 is the first character in $value, the rest are ok.

I've tried like this.. -
$value = str_replace(0,"",$value);
$value = str_replace("","0",$value);
this -
$value = str_replace(0,"0",$value);

no luck.
any suggestions?

Thanks,

Chris Smith
http://www.squiz.net


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




[PHP] Warning

2001-01-10 Thread Chris

For those of you using Interbase:
Chris

CERT Advisory CA-2001-01 Interbase Server Contains Compiled-in Back Door
Account

   Original release date: January 10, 2001
   Last revised: --
   Source: CERT/CC

   A complete revision history is at the end of this file.

Systems Affected

 * Borland/Inprise Interbase 4.x and 5.x
 * Open source Interbase 6.0 and 6.01
 * Open source Firebird 0.9-3 and earlier

Overview

   Interbase is an open source database package that had previously been
   distributed in a closed source fashion by Borland/Inprise. Both the
   open and closed source verisions of the Interbase server contain a
   compiled-in back door account with a known password.

I. Description

   Interbase is an open source database package that is distributed by
   Borland/Inprise at http://www.borland.com/interbase/ and on
   SourceForge. The Firebird Project, an alternate Interbase package, is
   also distributed on SourceForge. The Interbase server for both
   distributions contains a compiled-in back door account with a fixed,
   easily located plaintext password. The password and account are
   contained in source code and binaries previously made available at the
   following sites:

  http://www.borland.com/interbase/
  http://sourceforge.net/projects/interbase
  http://sourceforge.net/projects/firebird
  http://firebird.sourceforge.net
  http://www.ibphoenix.com
  http://www.interbase2000.com

   This back door allows any local user or remote user able to access
   port 3050/tcp [gds_db] to manipulate any database object on the
   system. This includes the ability to install trapdoors or other trojan
   horse software in the form of stored procedures. In addition, if the
   database software is running with root privileges, then any file on
   the server's file system can be overwritten, possibly leading to
   execution of arbitrary commands as root.

   This vulnerability was not introduced by unauthorized modifications to
   the original vendor's source. It was introduced by maintainers of the
   code within Borland. The back door account password cannot be changed
   using normal operational commands, nor can the account be deleted from
   existing vulnerable servers [see References].

   This vulnerability has been assigned the identifier CAN-2001-0008 by
   the Common Vulnerabilities and Exposures (CVE) group:

  http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2001-0008

   The CERT/CC has not received reports of this back door being exploited
   at the current time. We do recommend, however, that all affected sites
   and redistributors of Interbase products or services follow the
   recommendations suggested in Section III, as soon as possible due to
   the seriousness of this issue.

II. Impact

   Any local user or remote user able to access port 3050/tcp [gds_db]
   can manipulate any database object on the system. This includes the
   ability to install trapdoors or other trojan horse software in the
   form of stored procedures. In addition, if the database software is
   running with root privileges, then any file on the server's file
   system can be overwritten, possibly leading to execution of arbitrary
   commands as root.

III. Solution

Apply a vendor-supplied patch

   Both Borland and The Firebird Project on SourceForge have published
   fixes for this problem. Appendix A contains information provided by
   vendors supplying these fixes. We will update the appendix as we
   receive more information. If you do not see your vendor's name, the
   CERT/CC did not hear from that vendor. Please contact your vendor
   directly.

   Users who are more comfortable making their own changes in source code
   may find the new code available on SourceForge useful as well:

  http://sourceforge.net/projects/interbase
  http://sourceforge.net/projects/firebird

Block access to port 3050/tcp

   This will not, however, prevent local users or users within a
   firewall's adminstrative boundary from accessing the back door
   account. In addition, the port the Interbase server listens on may be
   changed dynamically at startup.

Appendix A. Vendor Information

Borland

   Please see:

  http://www.borland.com/interbase/

IBPhoenix

   The Firebird project uncovered serious security problems with
   InterBase. The problems are fixed in Firebird build 0.9.4 for all
   platforms. If you are running either InterBase V6 or Firebird 0.9.3,
   you should upgrade to Firebird 0.9.4.

   These security holes affect all version of InterBase shipped since
   1994, on all platforms.

   For those who can not upgrade, Jim Starkey developed a patch program
   that will correct the more serious problems in any version of
   InterBase on any platform. IBPhoenix chose to release the program
   without charge, given the nature of the problem and our relationship
   to the community.

   At th

[PHP] Easy Path ?

2001-01-11 Thread Chris

if I have a dir like this
root\main\test.php

how could I access this: from that script
root\test\test.php

basicly I mean how do I access a path before the current one



[PHP] Dir Help PLEASE

2001-01-11 Thread Chris

2 things, first how do I give something the filepath of a folder that proceeded it?

Also, how can I set up subdomains like sub.domain.com?



[PHP] Apache Problem

2001-01-13 Thread Chris

I was always using pws until recently when I got Apache for windows. Unfortunately 
when apache gets to a php file it doesnt parse it, it thinks its a file to download. I 
uncommented the php lines in the http.conf file but still no use. Does anyone know how 
to fix this?



[PHP] MySQL + PWS Problems

2001-01-16 Thread Chris

Whenever I try to connect with ANY Mysql code on my cpu, I get an error saying it 
can't connect. I installed usingthe 4.04 win32 installer(heresey I know) which has 
mysql built in. Do I have to edit anything to all me to try the scripts on my personal 
cpu?



Re: [PHP] MySQL + PWS Problems

2001-01-18 Thread Chris

i downloaded the binaries but when I compiled it said I was missing
string.obj
- Original Message -
From: "Phil Driscoll" <[EMAIL PROTECTED]>
To: "Chris" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 4:44 AM
Subject: Re: [PHP] MySQL + PWS Problems


> >Whenever I try to connect with ANY Mysql code on my cpu, I get an error
> saying it can't connect.
> >I installed usingthe 4.04 win32 installer(heresey I know) which has mysql
> built in. Do I have to edit
> >anything to all me to try the scripts on my personal cpu?
>
> Chris
>
> Reading between the lines, I suspect you haven't installed mysql. The php
> binaries have support for mysql built in (ie the ability to talk to mysql)
> but not the database itself.
>
> You can get mysql from www.mysql.com
>
> Cheers
> --
> Phil Driscoll
> Dial Solutions
> +44 (0)113 294 5112
> http://www.dialsolutions.com
> http://www.dtonline.org
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] MySQL + PWS Problems

2001-01-18 Thread Chris

i downloaded the binaries but when I compiled it said I was missing
string.obj
- Original Message -
From: "Phil Driscoll" <[EMAIL PROTECTED]>
To: "Chris" <[EMAIL PROTECTED]>; "PHP" <[EMAIL PROTECTED]>
Sent: Wednesday, January 17, 2001 4:44 AM
Subject: Re: [PHP] MySQL + PWS Problems


> >Whenever I try to connect with ANY Mysql code on my cpu, I get an error
> saying it can't connect.
> >I installed usingthe 4.04 win32 installer(heresey I know) which has mysql
> built in. Do I have to edit
> >anything to all me to try the scripts on my personal cpu?
>
> Chris
>
> Reading between the lines, I suspect you haven't installed mysql. The php
> binaries have support for mysql built in (ie the ability to talk to mysql)
> but not the database itself.
>
> You can get mysql from www.mysql.com
>
> Cheers
> --
> Phil Driscoll
> Dial Solutions
> +44 (0)113 294 5112
> http://www.dialsolutions.com
> http://www.dtonline.org
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




[PHP] Post without submit?

2001-01-25 Thread Chris

is there anyway to post without clicking a submit button?



[PHP] Help Please, MySQL is driving me insane

2001-01-26 Thread Chris

I've installed PHP using the 4.04 win32 installer. I recently downloaded the 
mysql(latest version) win32 installer and used that. But STILL mysql doesnt work. Can 
someone give a code snipet i can use to see if it is working?



Re: [PHP] Help Please, MySQL is driving me insane

2001-01-26 Thread Chris

But i installed it to the default c:\mysql.
How can I set a username and such to allow me to use it on my cpu?
- Original Message -
From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 4:12 PM
Subject: RE: [PHP] Help Please, MySQL is driving me insane


> I just installed mySQL yesterday from mysql.com (or .net or whatever it
> was). It installed fine, there was a note about what to do if you didn't
> install it to c:\mysql properly - I installed mine to a different
directory,
> followed the instructions and all went fine. Might be one place to start.
>
> HTH,
> jb
>
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 8:21 PM
> To: PHP
> Subject: [PHP] Help Please, MySQL is driving me insane
>
>
> I've installed PHP using the 4.04 win32 installer. I recently downloaded
the
> mysql(latest version) win32 installer and used that. But STILL mysql
doesnt
> work. Can someone give a code snipet i can use to see if it is working?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] Help Please, MySQL is driving me insane

2001-01-26 Thread Chris

Ahh, thank you everyone...now I just have to figure this beast out
- Original Message -
From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Friday, January 26, 2001 4:23 PM
Subject: RE: [PHP] Help Please, MySQL is driving me insane


> Ummm try going into c:\mysql\bin and running winmysqladmin.exe or
> MySqlManager.exe - I can't remember which one I ran.
>
> HTH,
> jb
>
> -Original Message-
> From: Chris [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 26, 2001 8:29 PM
> To: Jason Bouwmeester; PHP
> Subject: Re: [PHP] Help Please, MySQL is driving me insane
>
>
> But i installed it to the default c:\mysql.
> How can I set a username and such to allow me to use it on my cpu?
> - Original Message -
> From: "Jason Bouwmeester" <[EMAIL PROTECTED]>
> To: "PHP" <[EMAIL PROTECTED]>
> Sent: Friday, January 26, 2001 4:12 PM
> Subject: RE: [PHP] Help Please, MySQL is driving me insane
>
>
> > I just installed mySQL yesterday from mysql.com (or .net or whatever it
> > was). It installed fine, there was a note about what to do if you didn't
> > install it to c:\mysql properly - I installed mine to a different
> directory,
> > followed the instructions and all went fine. Might be one place to
start.
> >
> > HTH,
> > jb
> >
> > -Original Message-
> > From: Chris [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, January 26, 2001 8:21 PM
> > To: PHP
> > Subject: [PHP] Help Please, MySQL is driving me insane
> >
> >
> > I've installed PHP using the 4.04 win32 installer. I recently downloaded
> the
> > mysql(latest version) win32 installer and used that. But STILL mysql
> doesnt
> > work. Can someone give a code snipet i can use to see if it is working?
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




[PHP] Encryption

2001-02-21 Thread Chris

Hi,
I am trying to do a simple encryption on a credit card number to store in a mysql text 
field.
I also have to de-crypt the number after exporting to an access db.
I tried to use xor encryption, but it seems to only work half the time, the other 
half, I can't seem to de-crypt the # properly, some of the numbers end up screwed. 
Is this because of the way mysql is storing the field? Mabye it can't recognize some 
of the characters that are generated from the xor encryption?

Ex: 123456789123 may end up 1 YdR  and then de-crypts to 1234(*$8912#

Is it the  that are the problem?  Or is the the access database that isn't properly 
storing the   ?

Is there a better way to do this?

Thanks,
Chris




[PHP] PHP not proccessing input?

2001-02-23 Thread Chris

Help!
I am trying to post some info to my php script using the microsoft internet control:

strurl = http://www.myserver.com/test.asp
strdata = "lah=sd&dta=test
Inet1.Execute strurl, "POST", strdata

PHP returns HTTP_POST_VARS as being empty.
Yet, if I use PERL, I can read the posted info just fine.

PHP does work fine with normal php forms.

Why can PERL recognize my data, but PHP not, how are they handling the posted info 
differently?

Is there a way I can get PHP to display the raw data that the script receives so I can 
see what is happening?

Thanks for any help, 
Chris




[PHP] Help, Perl can, Php can't !

2001-02-26 Thread Chris


I am trying to post some info to my php script using the microsoft internet control:

strurl = http://www.myserver.com/test.asp
strdata = "lah=sd&dta=test
Inet1.Execute strurl, "POST", strdata

PHP returns HTTP_POST_VARS as being empty.
Yet, if I use PERL, I can read the posted info just fine.

PHP does work fine with normal php forms.

Why can PERL recognize my data, but PHP not, how are they handling the posted info 
differently?

Is there a way I can get PHP to display the raw data that the script receives so I can 
see what is happening?

Thanks for any help, 
Chris




Re: [PHP] Help, Perl can, Php can't !

2001-02-26 Thread Chris


Unfortuanetly, phpinfo is not telling me anything.
It returns all the normal info, but it still seems to act like there was no
data posted.


> Put phpinfo() in the script to see what is going on..
>
>
> On Monday, 26 February 2001, at 09:12:11 (-0800),
> Chris wrote:
>
> >
> > I am trying to post some info to my php script using the microsoft
internet control:
> >
> > strurl = http://www.myserver.com/test.asp
> > strdata = "lah=sd&dta=test
> > Inet1.Execute strurl, "POST", strdata
> >
> > PHP returns HTTP_POST_VARS as being empty.
> > Yet, if I use PERL, I can read the posted info just fine.
> >
> > PHP does work fine with normal php forms.
> >
> > Why can PERL recognize my data, but PHP not, how are they handling the
posted info differently?
> >
> > Is there a way I can get PHP to display the raw data that the script
receives so I can see what is happening?
> >
> > Thanks for any help,
> > Chris
> >
>
> --
> David Raufeisen <[EMAIL PROTECTED]>
> Cell: (604) 818-3596
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Help, Perl can, Php can't !

2001-02-26 Thread Chris

Strange,
phpinfo is showing this:
POST /members/plurp.asp HTTP/1.1
and a content length of 16, which is exactly right forlah=sd&dta=test
but I can't seem to get to the actual data.
Is there a way to see the acutal content data, like you can with perl:

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});


> Put phpinfo() in the script to see what is going on..
>
>
> On Monday, 26 February 2001, at 09:12:11 (-0800),
> Chris wrote:
>
> >
> > I am trying to post some info to my php script using the microsoft
internet control:
> >
> > strurl = http://www.myserver.com/test.asp
> > strdata = "lah=sd&dta=test
> > Inet1.Execute strurl, "POST", strdata
> >
> > PHP returns HTTP_POST_VARS as being empty.
> > Yet, if I use PERL, I can read the posted info just fine.
> >
> > PHP does work fine with normal php forms.
> >
> > Why can PERL recognize my data, but PHP not, how are they handling the
posted info differently?
> >
> > Is there a way I can get PHP to display the raw data that the script
receives so I can see what is happening?
> >
> > Thanks for any help,
> > Chris
> >
>
> --
> David Raufeisen <[EMAIL PROTECTED]>
> Cell: (604) 818-3596
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] File sending?

2001-02-27 Thread Chris

Hi,
Is it possible to send a file to a browser?
I would like to allow people to download a file, but I don't want to give away the 
path to the file, so a normal link wouldn't work.
I am hoping there is a way to use php to send the file using code, rather than trying 
to first copy the file to a temp dir then give them the link, then worry about 
deleting the temp dir again.

Thanks,
Chris



[PHP] File downloading?

2001-02-27 Thread Chris

Hi,
Is it possible to send a file to a browser?
I would like to allow people to download a file, but I don't want to give away the 
path to the file, so a normal link wouldn't work.
I am hoping there is a way to use php to send the file using code, rather than trying 
to first copy the file to a temp dir then give them the link, then worry about 
deleting the temp dir again.

( I am not sure if my first email went through, I got an error back about the mailbox 
being full)

Thanks,
Chris





Re: [PHP] Help, Perl can, Php can't !

2001-02-27 Thread Chris

Strange,
phpinfo is showing this:
POST /members/plurp.asp HTTP/1.1
and a content length of 16, which is exactly right forlah=sd&dta=test
but I can't seem to get to the actual data.
Is there a way to see the acutal content data, like you can with perl:

read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});


> Put phpinfo() in the script to see what is going on..
>
>
> On Monday, 26 February 2001, at 09:12:11 (-0800),
> Chris wrote:
>
> >
> > I am trying to post some info to my php script using the microsoft
internet control:
> >
> > strurl = http://www.myserver.com/test.asp
> > strdata = "lah=sd&dta=test
> > Inet1.Execute strurl, "POST", strdata
> >
> > PHP returns HTTP_POST_VARS as being empty.
> > Yet, if I use PERL, I can read the posted info just fine.
> >
> > PHP does work fine with normal php forms.
> >
> > Why can PERL recognize my data, but PHP not, how are they handling the
posted info differently?
> >
> > Is there a way I can get PHP to display the raw data that the script
receives so I can see what is happening?
> >
> > Thanks for any help,
> > Chris
> >
>
> --
> David Raufeisen <[EMAIL PROTECTED]>
> Cell: (604) 818-3596
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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



Re: [PHP] File downloading?

2001-02-27 Thread Chris


Great, thanks.
I looked at the file(), but it sounded like is was just for local file use.


> > Is it possible to send a file to a browser?
> 
> Sure. 
> 
> file();
> 
> > I would like to allow people to download a file, but I don't 
> > want to give away the path to the file, so a normal link 
> > wouldn't work.
> 
> In that case:
> 
> Header("Content-type: application/octet-stream");
> file("whatyouwanttosend");
> 
> > ( I am not sure if my first email went through, I got an 
> > error back about the mailbox being full)
> 
> I didn't see it ...
> 
> Jason
> 
> -- 
> Jason Murray
> [EMAIL PROTECTED]
> Web Design Team, Melbourne IT
> Fetch the comfy chair!


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




[PHP] Help, looking for.

2001-02-27 Thread Chris

Hi again,
Has anyone here come accross a Rich Text Format to HTML converted based on PHP?

Thanks,
Chris




[PHP] Info needed

2001-02-28 Thread Chris

Hi again,
Has anyone here come accross a Rich Text Format to HTML converted based on PHP?

Thanks,
Chris



Re: [PHP] regex frustration

2001-02-28 Thread Chris

Try the perl compatible one, you can set a limit of how many times to
replace:

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


> I've tried and tried to no avail, can someone assist
> I need to select the first space in a line like the following
> Nelson Bob and Mary, 123 Street st., Ashton, 555-1212
>
> I need to replace the space between Nelson and Bob with
> a comma so I can separate the first and last names in my DB
> ^\D*\s will select the first name and the space, but I just
> need the space. any ideas?
>
> Jerry Lake- [EMAIL PROTECTED]
> Web Designer
> Europa Communications - http://www.europa.com
> Pacifier Online - http://www.pacifier.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Munging hidden/form variables

2001-03-01 Thread Chris

Would it not be possible to have both the form page and the script page that
handles the form be generated o the fly with random filenames?

The form page would point to the random generated script page, and the
script page could delete itself after it is proccessed. You would also want
a cron to delete any files in case they never bothered to submit the form.

Can anyone see a problem with this?



> > I can think of one way that you can take in an attempy to prevent
> > this. It is not totally fool proof but it will make it more difficult
> > to send spoof data:
> > 1) Check your HTTP refereer when the form is submitted. If the
> > referer is not from your host then don't process the form.
> > Of course this can be faked quite easily if this person knows
> > what (s)he doing.
>
> Well, this was part of what I was going to do.  I was going to check
> to see if the request method was post and if the referer was from
> our host (not just the form/page).  If all that was true, then process
> the form.  If not, don't.
> However, I know that the $HTTP_REFERER variable is not at all
> reliable.  On that note, what browsers/versions would not send this
> information for Apache/PHP to set?  I know it is because of the browser
> that the client is using that this variable is unreliable.  But what those
> browsers/versions are, I don't know and am hoping someone can
> answer.
>
> Chris
>


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




Re: [PHP] Munging hidden/form variables

2001-03-01 Thread Chris

Not really,
because the script filename is deleted and changed all the time, it doesn't
matter if they paste the name into the form, since the file will no longer
exist.


> From: "Chris" <[EMAIL PROTECTED]>
>
> > Would it not be possible to have both the form page and the script page
> that
> > handles the form be generated o the fly with random filenames?
> >
> > The form page would point to the random generated script page, and the
> > script page could delete itself after it is proccessed. You would also
> want
> > a cron to delete any files in case they never bothered to submit the
form.
> >
> > Can anyone see a problem with this?
> >
> >
>
>
>
> That is not going to solve the problem, because a cracker can just copy
and
> paste the random filename of the script page into their form page.
>
> Bogus form data is a problem for everyone working with html forms. You're
> trying to find an esoteric solution to the problem, while overlooking the
> obvious: just check if the data is valid.
>
>
> Regards
>
> Simon Garner
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Munging hidden/form variables

2001-03-01 Thread Chris

No wait,
I see what you mean. You're right, sometimes the obvious is missed, but it
sounded cool.


> From: "Chris" <[EMAIL PROTECTED]>
>
> > Would it not be possible to have both the form page and the script page
> that
> > handles the form be generated o the fly with random filenames?
> >
> > The form page would point to the random generated script page, and the
> > script page could delete itself after it is proccessed. You would also
> want
> > a cron to delete any files in case they never bothered to submit the
form.
> >
> > Can anyone see a problem with this?
> >
> >
>
>
>
> That is not going to solve the problem, because a cracker can just copy
and
> paste the random filename of the script page into their form page.
>
> Bogus form data is a problem for everyone working with html forms. You're
> trying to find an esoteric solution to the problem, while overlooking the
> obvious: just check if the data is valid.
>
>
> Regards
>
> Simon Garner
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP] MySQL - Problem with multiple INSERTs?

2001-03-05 Thread Chris

Howdy,

I'm getting weird problems trying to INSERT to two different tables, in 
consecutive mysql_queries. Before, I had 3 queries going, and only 2 would 
work at any time. It seemed like it was 'rotating' the bad query - first 
the 1st query would fail (the other two were fine), then I'd empty all my 
tables and refresh, and this time the 2nd query was the problem, and if I 
did it again the 3rd was. All queries worked fine in phpMyAdmin, both 
individually and when executed en masse.

I've boiled it down to just two queries that don't work. I've included 
everything below (including table schemata), to enable reproduction. It 
seems like a bug to me - the question is, is the bug in PHP, MySQL, or my 
brain?

This is driving me CRAZY
  - Chris

mysql_connect("localhost", "myusername", "mypassword");
mysql_db_query("DocCountry", "INSERT INTO projects (idCreator, name, 
comment) VALUES (1, 'sysmsg9.txt', 'Some file')");
mysql_db_query("DocCountry", "INSERT INTO files (idProject, name, comment) 
VALUES (1, 'sysmsg9.txt', 'Some file')");

CREATE TABLE projects ( id int(11) NOT NULL auto_increment, timestamp 
timestamp(14), idCreator int(11) DEFAULT '0' NOT NULL, name varchar(80) NOT 
NULL, comment text NOT NULL, authLevel varchar(32) NOT NULL, PRIMARY KEY 
(id) );

CREATE TABLE files ( id tinyint(4) NOT NULL auto_increment, idProject 
tinyint(4) DEFAULT '0' NOT NULL, name tinyint(4) DEFAULT '0' NOT NULL, 
comment text NOT NULL, PRIMARY KEY (id) );

(P.S. I've tried things like using SET syntax, using mysql_query instead of 
mysql_db_query, etc. Nothing helps.)


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




  1   2   3   4   5   6   7   8   9   10   >