[PHP] RH7 4.0.4pl1 RPMs

2001-04-04 Thread maatt

Anyone else started getting problems after upgrading to these?

Seem to get getting whitespace prepended to my post vars. Wondering if it's
the RPMs or 4.0.4pl1 itself.

Matt

--
Matt Kynaston
remove the green eggs before replying



-- 
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] scramble the code

2001-04-05 Thread maatt

Save yourself the scramble, use sessions:
http://www.php.net/manual/en/ref.session.php

--
Matt Kynaston
remove the green eggs before replying

""Scott Fletcher"" <[EMAIL PROTECTED]> wrote in message
9ai09g$9d$[EMAIL PROTECTED]">news:9ai09g$9d$[EMAIL PROTECTED]...
>   I see it!  The login page when use the html form, the action is the
> $PHP_SELF, allowing hte page to refresh itself and then the following
script
> elsewhere check for the variable to see if it is true or not.  If true
then
> the script use the php header();.  The header contain the data, so that
> explain why it display the data in the URL.  The data in the URL doesn't
> include the data from the login page.
>
>   Thanks for the clarification! Now I'll give it a shot in scrambling one
of
> the variable data that come with the header and then unscramble it on the
> next page.
>
> Scott
>
> ""Scott Fletcher"" <[EMAIL PROTECTED]> wrote in message
> 9ahvj6$m67$[EMAIL PROTECTED]">news:9ahvj6$m67$[EMAIL PROTECTED]...
> > Um, well, it show up on Internet Explorer and Netscape Navigator and
> > Netscape.  Oh well.
> >
> > Scott
> >
> > ""Scott Fletcher"" <[EMAIL PROTECTED]> wrote in message
> > 9ahuft$612$[EMAIL PROTECTED]">news:9ahuft$612$[EMAIL PROTECTED]...
> > > Well, mine does!!!
> > >
> > > Scott
> > >
> > > ""Joe Sheble (Wizaerd)"" <[EMAIL PROTECTED]> wrote in
> > message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > This isn't quite accurate.  WHen a form's method is set to "GET"
> (which
> > > BTW
> > > > is the form's default method) the variables and their values are
> passed
> > > > along the URL.  If your form's method is set to "POST" then nothing
> > should
> > > > get passed along on the URL.  If you see all your data in the URL,
> > you're
> > > > not using a POST method or the forms action is specified as a url
with
> > > > parameters.
> > > >
> > > > At 09:06 AM 4/5/01 -0400, Scott Fletcher wrote:
> > > > >For the data in the "post", when the user type in the data and
press
> > the
> > > > >submit button, the data is then carry over to the nextpage.html.
In
> > the
> > > URL
> > > > >bar, I can clearly see the data, so is there to scramble hte data
> where
> > > > >anyone won't see it in the URL box at the top of the web browser?
> > > > >Thanks,
> > > > >  Scott
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >--
> > > > >PHP General Mailing List (http://www.php.net/)
> > > > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > >For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP 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] Nearly all (1755) PHP functions in a text file

2001-04-06 Thread maatt

Dammit, that's great Plutarck.

Been wanting to write a documentating script for ages, that basically took
the output from show_source() and added links to all the functions in the
online manual, as well as any functions defined in the script or includes.
Will be handy for a tutorial series I'm doing: users could then just
point-and-click at the bits of the script they don't understand.

All I needed to get going with it was a list of all the pre-defined
functions. And here it is!

Matt

""Plutarck"" <[EMAIL PROTECTED]> wrote in message
9ajqk2$ll4$[EMAIL PROTECTED]">news:9ajqk2$ll4$[EMAIL PROTECTED]...
> First of all I use Edit Plus, which uses a list of PHP functions to know
> what words to highlight in the code.
>
> Well now that I have a seriously throbbing headache, I've done it.
Finally.
>
> If you use a program that needs a list of functions for syntax
highlighting,
> I've finally got one that has every function according to PHP
> get_defined_functions (includes quite a few undocumented functions), the
PHP
> manual, and quite a few others it failed to mention but should be
> highlighted. unset() is a good example, along with print/echo, I managed
to
> put it together. Every entry on it's own line (so it's seperated by "\n").
>
> My head feels like it is being used as the repository for Anna Nichole
> Smith's silicone breast implants (both failed and spare parts for future
> use).
>
> In any case, there are 1755 entries in the blasted thing. If it's in the
PHP
> manual or get_defined_functions, it's in there. And damn is that alot.
>
> Here is the link to the text file:
> http://crazyoddball.hypermart.net/php.stx.txt
>
>
> However I learned so many cool things with so many functions I'd like to
> use, but I have a severe headache and have to go to work (I'll be in a car
> the whole time, so no computer) in one hour, and I haven't slept.
>
> And I'm not getting paid for this either.
>
> Ah yes, this is GeekLife. But I have no caffiene in my system. So this is
> the GranolaGeekLife...GGL...giggle?
>
>
>
> Well whatever I end up doing/not-doing, enjoy! Hopefully the thing will be
> useful.
>
> I certainly hope so, because compiling the whole thing was overkill if I'm
> the only one that will use it :)
>
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
>
> --
> 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] TTF Support

2001-04-11 Thread maatt

> Is there something that I can check to see if the FreeType
> library is there when I only have a virtual server?

Put phpinfo() on a page - look under the gd library section.

> And if it wasn't installed, is there any way that I can do this
> locally without having root access?

Don't think so.

Matt



-- 
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] www.php.net - gateway timeout?

2001-04-12 Thread maatt

Anyone else having probs getting through? Or is it just me? Been trying
since the wee hours (GMT).

--
Matt Kynaston
remove the green eggs before replying



-- 
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] Editors ... calling them, or PHP-based one?

2001-04-12 Thread maatt

What you're trying to do sounds a lot like content management. I'm no
expert, but you should be able to do all this through the browser serverside
(no need to download/upload). Have you checked out www.midgard-project.org,
www.dotvoid.com/firesite.php, or http://phpwebsite.appstate.edu/?

Matt

"The Hermit Hacker" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> Sorry for vague subject, only so many things you can put in there ...
>
> I'm looking for someone way, in PHP4, to take a "form/template" for a
> letter on the server side, pass it to the client, let them edit it
> (including markup tags like bold and underline) and then pass it back to
> the server ...
>
> It has to be relatively transparent to the end user ... I don't want to
> have to teach them to put  tags around where they want bold ...
>
> I'm not particular on editor ... right now, if I have to force the client
> to install StarOffice for commonality across platforms, I'll do that and
> expand from that ... but some way of 'click here, download doc to
> computer, open up file with , save back to server
> (if possible)' ...
>
> Ideas?
>
> thanks ...
>
> Marc G. Fournier   ICQ#7615664   IRC Nick:
Scrappy
> Systems Administrator @ hub.org
> primary: [EMAIL PROTECTED]   secondary:
scrappy@{freebsd|postgresql}.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] www.php.net - gateway timeout?

2001-04-12 Thread maatt

> 208.247.106.187, running Apache/1.3.12 (Unix) DAV/0.9.18-dev
PHP/4.0.5-dev.

Dearly hope it's not 4.0.5-dev that's the prob! Been wanting to try it,
which is why I can't use uk.php.net!

> The site loads fine now, but last time I did it it was all being rejected
on
> that hop. The server was refusing packets.

Yup, fine for me too.

Matt



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




Re: [PHP] file upload

2001-04-13 Thread maatt

> Is there any way not to write those line into the uploaded file?

It's a bug in 4.0.4pl1 on (AFAIK) RH7 and Apache. Will be fixed in 4.0.5.
You can't avoid them, but use something like the following to strip them
out:

/* void fix_broken_header(reference file)
 * Incorporates fix for problem with Apache & PHP 4.0.4p1
 * on Red Hat 7, where the content-type header is appended to the image
data,
 * corrupting it. See www.php.net/bugs.php?id=9298 - it took me a *long*
time to
 * figure out what the fsck was going on!
 *
 * 02/04/2001 - oddly enough it doesn't happen w/NS4.74 on Win or Linux only
IE5 & NS6
*/
function fix_broken_header(&$image) {

  $new_image = "$image.new";

  // Open the file for the copy
  $infile=fopen($image,"rb");
  $outfile=fopen($new_image,"w");

  // test for broken header
  $header=fgets($infile,255);
  if (eregi("content-type:", $header)) {
   $header=fgets($infile,255); // ditch next line
  }
  else {
   return; // do nothing
  }

  // Loop through the remaining file
  while(!feof($infile)) {
$temp = fread($infile,128);
fwrite($outfile,$temp,strlen($temp));
  }
  fclose($outfile);
  fclose($infile);
  unlink($image);
  $image = $new_image;
}



-- 
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] ng working? - ignore

2001-07-05 Thread maatt

Just trying to see...

--
Matt



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




[PHP] Re: mysql_insert_id()

2001-07-07 Thread maatt

> I have been reading about this function and I have a question. The PHP
> manual warns about using it if your AUTO_INCREMENT ID field is a BIGINT.
I
> am using type INTEGER.  Am I okay with this one, or should I use the MySQL
> function.

Works just fine in everything I do.

Maatt



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




[PHP] Re: eregi replace help

2001-07-07 Thread maatt

ereg_replace("> <[^<]*", "", $string);

or

ereg_replace("&.*\n", "", $string) if the unwanted bits end in new-lines

??

"Richard van Leeuwen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I want to delete some lines
>
> original:
>
> http://www.example.com/1.html"; >ABCD
> > Football
> http://www.example.com/2.html"; >BCDE
> > Tennis
> http://www.example.com/3.html"; >CDEF
> > Football
> http://www.example.com/4.html"; >DEFG
> > Basketball
> http://www.example.com/5.html"; >EFGH
> > Tennis
> http://www.example.com/6.html"; >FGHI
>
> after:
>
> http://www.example.com/1.html"; >ABCD
> http://www.example.com/2.html"; >BCDE
> http://www.example.com/3.html"; >CDEF
> http://www.example.com/4.html"; >DEFG
> http://www.example.com/5.html"; >EFGH
> http://www.example.com/6.html"; >FGHI
>
> I tryed eregi replace with (.*)
> but that does not seem to work
>
> Thanks if you can help me
>
> Richard van Leeuwen
>
>
>
>
>



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




Re: [PHP] passing variables from forms to the same page repetatively

2001-07-17 Thread maatt

I was doing something similar just yesterday. Ended up with a little
function to automatically write hidden s for every variable that's
submitted, whether posted or thru the url. Goes like this...

// put this somewhere in your form


// the function itself
function get_param_inputs() {
  global $HTTP_GET_VARS, $HTTP_POST_VARS;
  $ret_str = "";
  $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS);
  foreach ($params as $k=>$v) {
   if (is_array($v)) {
foreach($v as $kk=>$vv) {
 $ret_str .= '';
}
   }
   else {
$ret_str .= '';
   }
  }
  return $ret_str;
}

I also needed to append the variables to links on the same page (for page 1,
page 2, page 3... type thing) so did this:

link

function get_param_query() {
  global $HTTP_GET_VARS, $HTTP_POST_VARS;
  $ret_str = "";
  $params = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS);
  $j = "?";
  foreach ($params as $k=>$v) {
   if (is_array($v)) {
foreach($v as $kk=>$vv) {
 $ret_str .= $j.urlencode("$k[$kk]=$vv");
 $j = "&";
}
   }
   else {
$ret_str .= $j.urlencode("$k=$v");
$j = "&";
   }
  }
  return $ret_str;
}

Won't work if you're nesting arrays within arrays, but I'm not a recursive
type. Hope it helps,

Matt

"David Robley" <[EMAIL PROTECTED]> wrote in message
01071716134101.29979@www">news:01071716134101.29979@www...
> On Tue, 17 Jul 2001 15:41, Tim Olsen wrote:
> > People,
> > I have 4 forms in four seperate html pages included directly (no links
> > to includes) in the same .php file, i have it so all the form actions
> > is php.self, so when each form is submitted it goes on to display the
> > next form in line, using if and else statements, of course. I want to
> > be able to use variables created by the first form in the html part of
> > the last form. What is the best way to do this?
> >
> > So far, I can only use variables on the next page (form) that is
> > written out. After that those variables have no value.  Is there some
> > way to submit all variables present and assigned with the submission of
> > each form?  If I make the forms a seperate include file, instead of
> > having them in-line, how does this change the ways variables are passed
> > or submitted by each form? Thanks, - Tim
> > _
>
>
> If I understand what you are saying: those variables don't exist until
> you SUBMIT the form. You can demonstrate this by looping through and
> displaying your POST or GET vars at the beginning of the form and see
> what happens when you first open the page, and when it calls itself.
>
> And re-reading, I think what you may want is hidden fields. You want part
> one to call part 2, and retain values from part 1, etc? Echo the values
> into hidden fields in each step of the process.
>
> 
>
> --
> David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
> CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA
>
>I always lie. In fact, I'm lying to you right now!



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




[PHP] Re: regex for cleaning up username

2001-07-23 Thread maatt

> thinking it may be easier to parse for only allowed characters.

*much* better idea. Try:

preg_match('/[^\w]/', $string)

to find all non-alphanumeric+underscore



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




Re: [PHP] include ("foo.php") not working

2001-07-25 Thread maatt

Errr... feel embaressed asking but I've done the same...

You do have  tags around your code? Easy to leave off when there's
no HTML in the page.

Matt

"Ilari Kaartinen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > when I include the statement  then rather than
> > parsing the file and displaying the results the whole file is just
dumped to
> > screen as a text file.  Interesting the same problem occurs whatever the
> > file extension so the same thing happens for foo.htm, foo.html and
foo.txt!
>
> From PHP manual:
>
> The require() statement replaces itself with the specified file, much like
the C preprocessor's #include works.
>
> --
>  - Castus Ilarius, Magister Ludi Machinationis



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




[PHP] Re: Help with regular expresions! [ASAP]

2001-07-25 Thread maatt

$tag_name = "input";
$new_class = "yourclass";
eregi_replace("(<$tag_name)", "\\1 class=\"$yourclass\"", $yourstring);

will work for simple cases, but isn't going to give you much more power than
just applying a style to the tag iself  - 'input  { border : 1px }' say). If
the design is consistent, you can usually find longer blocks of unique text
for replacing headers, subheads, etc.

I'd run the scripts over your templates (backup first), not do output
buffering - manually tweaking a couple of exceptions is a hell of a lot
faster than building re's to catch them.

Matt

"Psychosphere2k" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi!

I have a fairly large PHP based website.
Unfortuantely, I didn't make extensive use of stylesheets.

I'm hoping for some help with regular expressions matching ( and =
replacing ) some tags.
I use output buffering, so it would be a simple case of adding some =
lines to my
output hanlder.

eg:
replacing  < input  > with < input   class =3D "something " >
and < body  > with < body  class =3D "something_else" >

Some code, with comments would be really great.

Thanks in advance.

Peter Gibson






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