php-general Digest 15 Sep 2003 13:41:11 -0000 Issue 2298

Topics (messages 162591 through 162631):

htmlentities -- can it skip tags
        162591 by: Justin French
        162592 by: John W. Holmes
        162602 by: Justin French
        162603 by: Justin French

Re: How are variables called in current php?
        162593 by: Jason Sheets
        162597 by: Raditha Dissanayake

User Access
        162594 by: Ryan Stagg
        162596 by: Raditha Dissanayake
        162598 by: Ryan Stagg
        162601 by: Raditha Dissanayake

Branching to a page
        162595 by: Todd Cary
        162611 by: chris.neale.somerfield.co.uk

Re: more details about previous email
        162599 by: Raditha Dissanayake

Re: XML Reading, Writing
        162600 by: Raditha Dissanayake

Re: (Conclusion) Re: [PHP] Program works only when there are records :-(
        162604 by: Eugene Lee

Re: HTTP_REFERER
        162605 by: Eugene Lee

Security of php_auth_pw ?
        162606 by: Neale Yates
        162620 by: Javier Tacon

browser detector (php side)
        162607 by: Louie Miranda

Re: space sensitive?
        162608 by: Jason Wong

navigation question
        162609 by: Andre
        162610 by: Petre Agenbag
        162631 by: Andre

Re: php sockets was Re: [PHP] socket_write eats data - solved
        162612 by: Daniel Souza

Yikes! Strange Occurrence of ! in mail
        162613 by: Nicole

Re: passthru loses php posted variables
        162614 by: Nicole

Sessions doubt
        162615 by: Ryan A
        162621 by: Jay Blanchard
        162622 by: Javier Tacon

Re: Header and dfile download bug???
        162616 by: Tristan.Pretty.risk.sungard.com
        162617 by: Marek Kilimajer

Need to refresh a dozen times for php pages to load
        162618 by: Karan R.

Re: Using PHP to generate Acrobat PDF...
        162619 by: Jay Blanchard

File Types
        162623 by: Ed Curtis
        162624 by: Raditha Dissanayake
        162626 by: Javier Tacon
        162627 by: Ed Curtis
        162629 by: Ed Curtis
        162630 by: Raditha Dissanayake

Re: php generate thumbnails
        162625 by: David Robley

Re: Verifying E-mail Addresses
        162628 by: David Robley

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Hi all,

I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands (&) are giving me grief. the obvious answer is to apply htmlspecialchars(), BUT this also converts all < and > into &lt; and &gt; signs, which destroys the html mark-up within the text.

Is there a non-tag equivalent of htmlspecialchars(), or do I need to build one?


TIA Justin

--- End Message ---
--- Begin Message --- Justin French wrote:

Hi all,

I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands (&) are giving me grief. the obvious answer is to apply htmlspecialchars(), BUT this also converts all < and > into &lt; and &gt; signs, which destroys the html mark-up within the text.

Is there a non-tag equivalent of htmlspecialchars(), or do I need to build one?

You'll have to build one.


If you know what characters are causing trouble, you could just use str_replace on them. Or you could use htmlspecialchars() and then run str_replace to convert &lt; and &gt; back into brackets.

You could also use get_html_translation_table() to get the conversions, remove the < and > conversion elements of the array and then use strtr() to do the conversion.


-- ---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message --- On Monday, September 15, 2003, at 12:58 PM, John W. Holmes wrote:

Justin French wrote:

Hi all,
I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands (&) are giving me grief. the obvious answer is to apply htmlspecialchars(), BUT this also converts all < and > into &lt; and &gt; signs, which destroys the html mark-up within the text.
Is there a non-tag equivalent of htmlspecialchars(), or do I need to build one?

You'll have to build one.


If you know what characters are causing trouble, you could just use str_replace on them. Or you could use htmlspecialchars() and then run str_replace to convert &lt; and &gt; back into brackets.

Which is what I just did as a 'patch' :)



You could also use get_html_translation_table() to get the conversions, remove the < and > conversion elements of the array and then use strtr() to do the conversion.

I like that idea a LOT.


Thanks John!


Justin

--- End Message ---
--- Begin Message --- On Monday, September 15, 2003, at 12:58 PM, John W. Holmes wrote:

Justin French wrote:

Hi all,
I need to convert some text from a database for presentation on screen... as per usual, characters like quotes and ampersands (&) are giving me grief. the obvious answer is to apply htmlspecialchars(), BUT this also converts all < and > into &lt; and &gt; signs, which destroys the html mark-up within the text.
Is there a non-tag equivalent of htmlspecialchars(), or do I need to build one?

You'll have to build one.


If you know what characters are causing trouble, you could just use str_replace on them. Or you could use htmlspecialchars() and then run str_replace to convert &lt; and &gt; back into brackets.

Which is what I just did as a 'patch' :)



You could also use get_html_translation_table() to get the conversions, remove the < and > conversion elements of the array and then use strtr() to do the conversion.

I like that idea a LOT.


Thanks John!


Justin

--- End Message ---
--- Begin Message --- Looks like that code depends on register globals being enabled which have been off for some time. You can either turn register globals on in php.ini (not recommended) or with an .htaccess file (better than using php.ini not as good as changing the code if that is possible).

Information about all three of these is available at http://www.php.net/manual/en

If you own the code you can use $_SERVER['REQUEST_METHOD'].

Jason

Wei Wang wrote:

hi, all,

I have a piece of code stuck at the point of "if (($REQUEST_METHOD=='post'))". "var_dump($REQUEST_METHOD);" shows that the variable doesn't exist. Since I grabbed the code from a 2001 update, is there any chance that this is already obsolete? I checked the documentation but didn't find anything relevant.
Any advice would be highly appreciated. ;-)




The following is the complete code that I got stuck at


if (($REQUEST_METHOD=='post')) {


////////////////////////////////
// This loop removed "dangerous" characters from the posted data
// and puts backslashes in front of characters that might cause
// problems in the database.
////////////////////////////////
 for(reset($HTTP_POST_VARS);
           $key=key($HTTP_POST_VARS);
           next($HTTP_POST_VARS)) {
   $this = addslashes($HTTP_POST_VARS[$key]);
   $this = strtr($this, ">", " ");
   $this = strtr($this, "<", " ");
   $this = strtr($this, "|", " ");
   $$key = $this;
 }
else
{ print ('Boo, I never got executed'); }//apparently the script never make it to this 
point

And add appriopriate
assigments at the top of your script.



--- End Message ---
--- Begin Message --- Wei Wang wrote:

hi, all,

I have a piece of code stuck at the point of "if (($REQUEST_METHOD=='post'))". "var_dump($REQUEST_METHOD);" shows that the variable

should be $REQUEST_METHOD == 'POST'
why don't you just use the $_REQUEST array instead?



--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
How would one go about allowing editable access to only the entry creator

For example:
If I added an entry to the site and only wanted myself to be able to edit /
delete it, likewise with other users how would I go about setting this up in
DW MX on PHP4 and mysql??

Cheers

Ryan

--- End Message ---
--- Begin Message --- Sorry but your problem isn't very clear.

If you are talking of dreamweaver problem you are better off using their support forums. Or are you talking about a wiki site?


Ryan Stagg wrote:


How would one go about allowing editable access to only the entry creator

For example:
If I added an entry to the site and only wanted myself to be able to edit /
delete it, likewise with other users how would I go about setting this up in
DW MX on PHP4 and mysql??

Cheers

Ryan





--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
No it's not a Dreamweaver problem....

I have a site where users can insert data via a PHP form, I want to be able
to set up a system where the user can login and edit their entries only, in
other words they cant edit another users data.

Ryan


"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Sorry but your problem isn't very clear.
>
> If you are talking of dreamweaver problem you are better off using their
> support forums. Or are you talking about a wiki site?
>
>
> Ryan Stagg wrote:
>
> >How would one go about allowing editable access to only the entry creator
> >
> >For example:
> >If I added an entry to the site and only wanted myself to be able to edit
/
> >delete it, likewise with other users how would I go about setting this up
in
> >DW MX on PHP4 and mysql??
> >
> >Cheers
> >
> >Ryan
> >
> >
> >
>
>
> -- 
> http://www.radinks.com/upload
> Drag and Drop File Uploader.

--- End Message ---
--- Begin Message --- Sounds like a wiki in it's simplest form. Please do a search for php wiki in sourceforge or hotscripts you will be able to find lots of scripts that let you achieve just this.

all the best

Ryan Stagg wrote:

No it's not a Dreamweaver problem....

I have a site where users can insert data via a PHP form, I want to be able
to set up a system where the user can login and edit their entries only, in
other words they cant edit another users data.

Ryan


"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


Sorry but your problem isn't very clear.

If you are talking of dreamweaver problem you are better off using their
support forums. Or are you talking about a wiki site?


Ryan Stagg wrote:




How would one go about allowing editable access to only the entry creator

For example:
If I added an entry to the site and only wanted myself to be able to edit


/


delete it, likewise with other users how would I go about setting this up


in


DW MX on PHP4 and mysql??

Cheers

Ryan





--
http://www.radinks.com/upload
Drag and Drop File Uploader.







--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message --- Back in the earlier days of PHP, pages were not cached so I developed a method of "branching to a page" by opening a new socket. Since it has worked over the years in quite a variety of applications, I have not changed...but maybe I should. Are there any glaring deficiencies with doing this:

 // Verify the Session ID
 if ($session_id) {
 ...
 } else {
   bounce_post($server, $path, $url, "abort.php", "");
   exit;
 }

Where "bounce" is defined as

 function bounce_post($server, $path, $url, $page, $info) {
   $http = new http;

   $fp = $http->http_fpost($server, $path . $page, $info);
   if($fp) {
     print '<BASE HREF="' . $url . $page . '"><p>';
     fpassthru($fp);
   };
 }

Todd

--
--- End Message ---
--- Begin Message ---
I don't understand what this achieves? Tell me more...

C

-----Original Message-----
From: Todd Cary [mailto:[EMAIL PROTECTED]
Sent: 15 September 2003 03:30
To: [EMAIL PROTECTED]
Subject: [PHP] Branching to a page


Back in the earlier days of PHP, pages were not cached so I developed a 
method of "branching to a page" by opening a new socket.  Since it has 
worked over the years in quite a variety of applications, I have not 
changed...but maybe I should.  Are there any glaring deficiencies with 
doing this:

  // Verify the Session ID
  if ($session_id) {
  ...
  } else {
    bounce_post($server, $path, $url, "abort.php", "");
    exit;
  }

Where "bounce" is defined as

  function bounce_post($server, $path, $url, $page, $info) {
    $http = new http;

    $fp = $http->http_fpost($server, $path . $page, $info);
    if($fp) {
      print '<BASE HREF="' . $url . $page . '"><p>';
      fpassthru($fp);
    };
  }

Todd

-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

--- End Message ---
--- Begin Message ---
Wei Wang wrote:
if you are asking questions about specific scripts you will always be
better off in the message boards / mailings lists maintained by the
script owner.
However i will hazard a guess that you have not created the tables in
the db.

>CREATE TABLE guests (
>  guest_id
>    int(4)
>    unsigned
>    zerofill
>    DEFAULT '0000'
>    NOT NULL
>    auto_increment,
>  guest_name varchar(50),
>  guest_email varchar(50),
>  guest_time timestamp(14),
>  guest_message text,
>  PRIMARY KEY (guest_id)
>);
>
>  
>

-- 
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message --- Hi,

The php xml modules are installed by default with recent versions of php. This requires that you have libexpat on your machine. They are available on most linux distributions cds. If you are on windows you can dwonload from the site (forgotton the url)

From the type of questions you have asked i get the impression that youa re total newby to xml. Please head off the w3c.org you will find the specs there. You will find some good tutorials at w3schools.com

all the best


ps:
The next time you ask a question you might want to start a new thread instead of replying to an exisiting message.




Jeff Fitzgerald wrote:


I need to use PHP to read, modify and write xml files. I have seen something called expat which I am having trouble installing. Is that the only way to do this? Any help greatly appeciated...




--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
On Mon, Sep 15, 2003 at 02:15:56AM +0200, Ryan A wrote:
: 
: Its a version problem, UNION was not implempted till V4, and my host has
: V3.23
: Anybody know of a work around with my code? I have found some work arounds
: on google but its too advanced for me...i dont really understand left joins,
: right joins etc

The user notes in the MySQL documentation includes some suggestions that
work around UNION-less MySQL 3.x systems.

        http://www.mysql.com/doc/en/UNION.html

--- End Message ---
--- Begin Message ---
On Mon, Sep 15, 2003 at 07:58:25AM +0800, Louie Miranda wrote:
: Eugene Lee mentioned:
: > On Fri, Sep 12, 2003 at 04:21:16PM +0800, Louie Miranda wrote:
: > : Eugene Lee mentioned:
: > : > On Fri, Sep 12, 2003 at 03:53:22PM +0800, Louie Miranda wrote:
: > : > : "Eugene Lee" mentioned:
: > : > : >
: > : > : > Several Windoze firewalls also filter out HTTP_REFERER.
: > : > :
: > : > : what can you suggest, im trying to do a referer email program on a
: > : > : website and i think HTTP_REFERER will be my first approach, but
: > : > : limited on some browsers and firewall.
: > : >
: > : > It depends on what exactly you are trying to accomplish.
: > : 
: > : no, im making a "send this page to a friend program"
: > : when the users click the button a small pop-up window will come out
: > : and the http_referer will work and catch the previous page.
: > 
: > Since it's a button, you could always send the SCRIPT_FILENAME to the
: > pop-up window via a GET or POST method.
:
: SCRIPT_FILENAME, sorry but i didnt get this part.

On URL A, $_SERVER['SCRIPT_FILENAME'] reports URL A.  And on that page,
if you click on a link that takes you to URL B, then in URL B you'll get
$_SERVER['HTTP_REFERER'] that also says URL A.

--- End Message ---
--- Begin Message ---
Is anyone able to advise me on the security of the password when using
PHP authentication.  My specific concern is whether the password can be
intercepted between the browser and server when submitted.

thanks

Neale

--- End Message ---
--- Begin Message ---
If you want this type of level security, you should work under SSL connection, that 
works with crypted data between browser and server.

Javier Tacón


-----Mensaje original-----
De: Neale Yates [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 7:47
Para: [EMAIL PROTECTED]
Asunto: [PHP] Security of php_auth_pw ?
Importancia: Baja


Is anyone able to advise me on the security of the password when using
PHP authentication.  My specific concern is whether the password can be
intercepted between the browser and server when submitted.

thanks

Neale

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

--- End Message ---
--- Begin Message ---
Im looking for a browser detector and can redirect to a certain page if its
match something. So far phpsniff is the only thing i found.

But i didnt got it to work d redirection part.

any ideas?


-
Louie


--- End Message ---
--- Begin Message ---
On Monday 15 September 2003 06:55, Stevie D Peele wrote:
> Is PHP space sensitive??

No. Statements are terminated by a semi-colon.

This:

-----------------------------
  echo
       "This is the same"
  ;
-----------------------------

is the same as

-----------------------------
  echo "This is the same";
-----------------------------

-- 
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
------------------------------------------
/*
Writing about music is like dancing about architecture.
                -- Frank Zappa
*/

--- End Message ---
--- Begin Message ---
Hello,

For my website I use some PHP code for navigation. Therefore I use a
directory structure which contains some navigation files the visitor can
open. The directory structure looks like this:

my_domain
     |
     - /navigation
     |              - file_1.html
     |              - file_2.html
     |              - file_3.html
     |
     -/images
     :
     :

The name of the files the visitor can open (file_1....file_3) I detect from
reading the files in the directory "navigation". The function I use is this:

$handle=opendir("./navigation/");
$counter=0;

while ($file = readdir($handle)) {

 $the_type = strrchr($file, ".");
 $is_html = eregi("htm",$the_type);
 if ($file != "." and $file != ".." and $is_html) {
   $newsflash[$counter] = $file;
   $counter++;

 }
}
closedir($handle);
rsort($newsflash);
reset($newsflash);

With some other code I can echo the different files, this code works on the
same server. Now I want to read the navigation files from a different server
(my_domain2), then I get an error and the name of the files are not shown.
When I try it with Apache on my local computer an error is shown on the
first line
 $handle=opendir("http://domain2/navigation/";);

Is there an other way of getting the filenames from a different server? The
directory structure at my_domain is equal to my_domain2. Apparently the
function opendir is not correct, can someone help me?

Thanks in advance,

André

--- End Message ---
--- Begin Message ---
The function is correct, BUT, it looks like you are trying to run this
script off one server and then attempting to "feed" the function a
directory structure off another server.

Your code will work "as-is" if you run the script off my_domain2, but it
won't work if you run it off my_domain asking for a directory structure
located on my_domain2.

I am not sure that opendir() can work like this, and you would probably
need to look at some remote file functions like the ftp functions...

 
On Mon, 2003-09-15 at 08:38, Andre wrote:
> Hello,
> 
> For my website I use some PHP code for navigation. Therefore I use a
> directory structure which contains some navigation files the visitor can
> open. The directory structure looks like this:
> 
> my_domain
>      |
>      - /navigation
>      |              - file_1.html
>      |              - file_2.html
>      |              - file_3.html
>      |
>      -/images
>      :
>      :
> 
> The name of the files the visitor can open (file_1....file_3) I detect from
> reading the files in the directory "navigation". The function I use is this:
> 
> $handle=opendir("./navigation/");
> $counter=0;
> 
> while ($file = readdir($handle)) {
> 
>  $the_type = strrchr($file, ".");
>  $is_html = eregi("htm",$the_type);
>  if ($file != "." and $file != ".." and $is_html) {
>    $newsflash[$counter] = $file;
>    $counter++;
> 
>  }
> }
> closedir($handle);
> rsort($newsflash);
> reset($newsflash);
> 
> With some other code I can echo the different files, this code works on the
> same server. Now I want to read the navigation files from a different server
> (my_domain2), then I get an error and the name of the files are not shown.
> When I try it with Apache on my local computer an error is shown on the
> first line
>  $handle=opendir("http://domain2/navigation/";);
> 
> Is there an other way of getting the filenames from a different server? The
> directory structure at my_domain is equal to my_domain2. Apparently the
> function opendir is not correct, can someone help me?
> 
> Thanks in advance,
> 
> Andr

--- End Message ---
--- Begin Message ---
Thanks for your reaction,

You are right about your conclusion how I think the code should work. I am
indeed trying to run the script off one server (my_domain1) and then
attempting to "feed" the function a directory structure off another server
(my_domain2).

I suppose the function opendir() only work for a directory at the same
server. When someone can tell me what I can do best. Because I just started
with PHP and I read this code in an example, I realy need some help if you
tell me to use ftp.

Andre



"Petre Agenbag" <[EMAIL PROTECTED]> schreef in bericht
news:[EMAIL PROTECTED]
> The function is correct, BUT, it looks like you are trying to run this
> script off one server and then attempting to "feed" the function a
> directory structure off another server.
>
> Your code will work "as-is" if you run the script off my_domain2, but it
> won't work if you run it off my_domain asking for a directory structure
> located on my_domain2.
>
> I am not sure that opendir() can work like this, and you would probably
> need to look at some remote file functions like the ftp functions...
>
>
> On Mon, 2003-09-15 at 08:38, Andre wrote:
> > Hello,
> >
> > For my website I use some PHP code for navigation. Therefore I use a
> > directory structure which contains some navigation files the visitor can
> > open. The directory structure looks like this:
> >
> > my_domain
> >      |
> >      - /navigation
> >      |              - file_1.html
> >      |              - file_2.html
> >      |              - file_3.html
> >      |
> >      -/images
> >      :
> >      :
> >
> > The name of the files the visitor can open (file_1....file_3) I detect
from
> > reading the files in the directory "navigation". The function I use is
this:
> >
> > $handle=opendir("./navigation/");
> > $counter=0;
> >
> > while ($file = readdir($handle)) {
> >
> >  $the_type = strrchr($file, ".");
> >  $is_html = eregi("htm",$the_type);
> >  if ($file != "." and $file != ".." and $is_html) {
> >    $newsflash[$counter] = $file;
> >    $counter++;
> >
> >  }
> > }
> > closedir($handle);
> > rsort($newsflash);
> > reset($newsflash);
> >
> > With some other code I can echo the different files, this code works on
the
> > same server. Now I want to read the navigation files from a different
server
> > (my_domain2), then I get an error and the name of the files are not
shown.
> > When I try it with Apache on my local computer an error is shown on the
> > first line
> >  $handle=opendir("http://domain2/navigation/";);
> >
> > Is there an other way of getting the filenames from a different server?
The
> > directory structure at my_domain is equal to my_domain2. Apparently the
> > function opendir is not correct, can someone help me?
> >
> > Thanks in advance,
> >
> > Andr

--- End Message ---
--- Begin Message ---
Probably your problems about "i can send about seven messages per second"
may be relationed to
OS's tcp connection stream buffering... try to flush every fd after write to
it. I wrote a multi-threaded (pcntl_fork())
application in phpcli using many sockets and they worked well... array
iterations are fast and easy too, as they have
only one level... so I believe that this is really relationed to socket
flushing stuffs...you can also use select() to determine
when a fd is ready for write and implement a "write spool"... only a ideia,
but probably will spent more time with the same
results... well.. flush then may resolve it.

Daniel Souza

"Raditha Dissanayake" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
> Hi thomas,
>
> Thomas Weber wrote:
>
> >IMAP? We were talking about IRC,
> >
> Used imap as an example.
>
> > the Internet Relay Chat.
> >In detail, my problems doesn't even refer to IRC directly, as i am
> >developing a server for a html-based webchat, but the server-structure
and
> >the messages are nearly the same.
> >
> Yes my questions was how are you going to maintain the connection
> between two different connectsion. As far as i know sockets cannot be
> serialized in php4.
>
> >Once you realize the basics of socket-multicasting, it is no problem to
> >maintain hundreds of simultanous TCP-connects via arrays of sockets, also
> >called descriptor-sets. PHP seems to directly use the underlying C-
> >libraries, so everything you can imagine is possible.
> >
> Thanx i am aware of it
>
> >
> >
>
> --
> http://www.radinks.com/upload
> Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
Has anyone experienced exclamation points ! in their emails from no where?
This is a really strange thing I have been noticing lately in emails I send
to myself via PHP.  When I send an email from 2 different machines using 2
different smtp servers, I still get the exclamations in the email.

Any ideas what on earth is causing that?

Example:

the!ir is an ex!clamation in my e!mail that I did not pu!t there.

Why??

Thanks!

--
Nicole

--- End Message ---
--- Begin Message ---
Hi,

Did you try using the system() command instead and skip using exec and
passthru?

--
Nicole


"Exasperated" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Anyone come across something like this before?
>
> I have made a little test script as follows:
> <?
>         header ("Content-Type: application/pdf");
>         $command_line = "/usr/bin/pdflabelseries " .
>                 escapeshellcmd($_POST['labelstart']) . " " .
>                 escapeshellcmd($_POST['labelend']);
>         exec ("echo \"$command_line\" >/opt/specs/labels.txt");
>         //passthru($command_line);
> ?>
>
> The form takes input from a posted form with two variables, labelstart and
> labelend.  In the above test, if I put in 'start' and 'end' as the posted
> variable data, the output from /opt/specs/labels.txt (writable by the http
> server) is:
> /usr/bin/pdflabelseries start end
> All is well and good.  Now is where it heads South.  I uncomment the
> passthru command above.  The output from the script in
/opt/specs/labels.txt
> from the same posted form with the same data entered is now:
> /usr/bin/pdflabelseries
> pdflabelseries is a C program that I have confirmed works perfectly on the
> command line (i.e. generates the requisite pdf file to stdout).
> Even if the C program fails (which it does not appear to do from the
output
> in the httpd logs as it outputs its command line to stderr), surely php
> should not lose its own internal variables, especially, for a command that
> is executed BEFORE the passthru command.
>
> I am truly baffled.
>
> Any help appreciated.
> Regards
>
> Mark
>
> I am running vanilla Mandrake 9.1 with the following PHP rpms:
> libphp_common430-430-11mdk
> php-pear-4.3.0-3mdk
> apache2-mod_php-2.0.44_4.3.1-2mdk
> php-xml-4.3.0-2mdk
> php-dba_bundle-4.3.0-4mdk
> php-pgsql-4.3.0-4mdk
> php-xmlrpc-4.3.0-2mdk
> php-manual-en-4.3.0-2mdk
> php430-devel-430-11mdk
> php-gd-4.3.0-2mdk

--- End Message ---
--- Begin Message ---
Hi,
I have a small (simple?) doubt, if you know the answer kindly reply.

I have a top.php and bottom.php template files so that the whole site has
pretty much the same look and feel, then I have around 150 scripts that call
this files such as index.php or something.php like so:

<?php
session_start();
include "top.php";
subject or page matter here
include "bottom.php";
?>

I am relying heavily on sessions, right now its become an habit for me to
have session_start(); on every page as I start to write it, but have started
seeing some funny results as I have a session_start(); in both the calling
file and the top.php....

do I really need to have it in both or just one?
or does it really matter at all?
 if just one it should be the file that is calling top.php right?

Thanks,
-Ryan A



We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com

--- End Message ---
--- Begin Message ---
[snip]
do I really need to have it in both or just one?
or does it really matter at all?
 if just one it should be the file that is calling top.php right?
[/snip]

Just one, the calling page/script

--- End Message ---
--- Begin Message ---
In PHP >= 4.3.3 versions, start a session when you have a session started already, 
causes a notice error and the second call is ignored.

In older versions, the second call is ignored without errors (assumes the first 
session started)

Put this to your top.php:

@session_start();

And then, remove all the session_start from the others php files, when you are done, 
remove the eat '@' in the session_start() (isn't smart)


-----Mensaje original-----
De: Ryan A [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 11:11
Para: [EMAIL PROTECTED]
Asunto: [PHP] Sessions doubt
Importancia: Baja


Hi,
I have a small (simple?) doubt, if you know the answer kindly reply.

I have a top.php and bottom.php template files so that the whole site has
pretty much the same look and feel, then I have around 150 scripts that call
this files such as index.php or something.php like so:

<?php
session_start();
include "top.php";
subject or page matter here
include "bottom.php";
?>

I am relying heavily on sessions, right now its become an habit for me to
have session_start(); on every page as I start to write it, but have started
seeing some funny results as I have a session_start(); in both the calling
file and the top.php....

do I really need to have it in both or just one?
or does it really matter at all?
 if just one it should be the file that is calling top.php right?

Thanks,
-Ryan A



We will slaughter you all! - The Iraqi (Dis)information ministers site
http://MrSahaf.com

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

--- End Message ---
--- Begin Message ---
Well, I'm on IE V6.0.2800
My boss, has the same version.
Yet.. when she hits the link, she get's the error, (unable to open file) 
However, I didn't say before, that it's Acrobat reader, that's giving the 
error.
The file is downloaded etc...
yet on my machine, I can see the file, and on hers, she cannot...?
Stumpt...






Curt Zirzow <[EMAIL PROTECTED]>
13/09/2003 18:54
 
        To:     [EMAIL PROTECTED]
        cc: 
        Subject:        Re: [PHP] Header and dfile download bug???


* Thus wrote [EMAIL PROTECTED] 
([EMAIL PROTECTED]):
> Hi all,
> I have a download for that collects data from a user (name, e-mail etc) 
> The $bu variable and others are from the previous form too.
> [...]
> 
> So, it works great on my desktop here at work, but I just got a few 
mails 
> from random users, who complained that they saw an error screen after 
> trying to download pdf's.

Well did they supply any information like what the error was or
what browser they were using?


> Dunno if this is a PDF problem, or if my script is bad?
> 
> So, here is my code... (that site at the very top of my page.)
> The headers after the else statement are simply to avoid page caching, 
so 
> we can ignore them in this example.....
> So, why does this work for me and many others, but not all?

I'm unable to answer that. Some knowlege of what exactly the error
is might help. The headers shouldn't cause error.

> 
> *********************************************************************
> The information contained in this e-mail message is intended only for 
> the personal and confidential use of the recipient(s) named above. 

am I the intended person? the email wasn't addressed to me, so I
feel like I'm breaking the policy...

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

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




*********************************************************************
The information contained in this e-mail message is intended only for 
the personal and confidential use of the recipient(s) named above.  
If the reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are hereby 
notified that you have received this document in error and that any
review, dissemination, distribution, or copying of this message is 
strictly prohibited. If you have received this communication in error, 
please notify us immediately by e-mail, and delete the original message.
***********************************************************************


--- End Message ---
--- Begin Message --- There are issues with acrobat and IE combination. Sometimes it just does not work and you have to close all IE windows so it starts working again. You should provide a download link for these cases.

[EMAIL PROTECTED] wrote:
Well, I'm on IE V6.0.2800
My boss, has the same version.
Yet.. when she hits the link, she get's the error, (unable to open file) However, I didn't say before, that it's Acrobat reader, that's giving the error.
The file is downloaded etc...
yet on my machine, I can see the file, and on hers, she cannot...?
Stumpt...







Curt Zirzow <[EMAIL PROTECTED]>
13/09/2003 18:54
To: [EMAIL PROTECTED]
cc: Subject: Re: [PHP] Header and dfile download bug???



* Thus wrote [EMAIL PROTECTED] ([EMAIL PROTECTED]):


Hi all,
I have a download for that collects data from a user (name, e-mail etc) The $bu variable and others are from the previous form too.
[...]


So, it works great on my desktop here at work, but I just got a few

mails


from random users, who complained that they saw an error screen after trying to download pdf's.


Well did they supply any information like what the error was or
what browser they were using?



Dunno if this is a PDF problem, or if my script is bad?

So, here is my code... (that site at the very top of my page.)
The headers after the else statement are simply to avoid page caching,

so


we can ignore them in this example.....
So, why does this work for me and many others, but not all?


I'm unable to answer that. Some knowlege of what exactly the error
is might help. The headers shouldn't cause error.


*********************************************************************
The information contained in this e-mail message is intended only for the personal and confidential use of the recipient(s) named above.


am I the intended person? the email wasn't addressed to me, so I
feel like I'm breaking the policy...

Curt

--- End Message ---
--- Begin Message ---
hello people,
i have apache2, php 4.3.2, win XP, mysql4, fairly fast
comp.

i'm hosting phpBB 2.0.6(latest) forums on my comp for
the college LAN
the speeds r very good so that's not a problem

problem is that people have to refresh their pages
somehitng like a dozen times before the page shows
up...other times, just a blank page shows up.
php is properly installed coz the forums work
perfectly when they finaly load.

barely 5-6 ppl post on it right now so flooding cant
be a problem...

i've tried asking this in the phpBB and apache forums
but they can't think of a fix. all that's left is
PHP,.
i hope u guys can help
i've spent 4 consecutive nights reading manuals and
mining the net for a solution but all i found was 1
other person wiht a similar problem on google's usenet
thingie...who also got no answer

im not sure when this started coz no one told me about
it before...
HELP! my exams start in 4 days and i can't get any
sleep coz of this ...

did i miss out any info?


thnx
Karan Rawat

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

--- End Message ---
--- Begin Message ---
[snip]
Ooohhh!  Neat website!  Here's the other info send to me by someone from
email.  Thanks for all of the feedback.  Now i have something to get
start....

--snip--
http://ca3.php.net/manual/en/ref.pdf.php
[/snip]

Don't forget the FPDF class at http://www.fpdf.org

--- End Message ---
--- Begin Message ---
 I currently limit file types in an upload script by using an allowed
types array

$allowed_types = array("image/jpeg", "image/gif");

 I also need to allow files of with the following extentions.

 .tif, .pm7, .p65, .pdf, .qxp, .pmd, .eps

Is there a site out there anywhere that gives the mime types of theses
files?

Thanks,

Ed

--- End Message ---
--- Begin Message --- You don't need to look any further than mime.types files included in your apache distro.


Ed Curtis wrote:


I currently limit file types in an upload script by using an allowed
types array

$allowed_types = array("image/jpeg", "image/gif");

I also need to allow files of with the following extentions.

.tif, .pm7, .p65, .pdf, .qxp, .pmd, .eps

Is there a site out there anywhere that gives the mime types of theses
files?

Thanks,

Ed





--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
You could use the function exif_imagetype() to see what type of file has been uploaded.

http://es.php.net/manual/en/function.exif-imagetype.php


-----Mensaje original-----
De: Ed Curtis [mailto:[EMAIL PROTECTED]
Enviado el: lunes, 15 de septiembre de 2003 15:02
Para: [EMAIL PROTECTED]
Asunto: [PHP] File Types
Importancia: Baja



 I currently limit file types in an upload script by using an allowed
types array

$allowed_types = array("image/jpeg", "image/gif");

 I also need to allow files of with the following extentions.

 .tif, .pm7, .p65, .pdf, .qxp, .pmd, .eps

Is there a site out there anywhere that gives the mime types of theses
files?

Thanks,

Ed

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

--- End Message ---
--- Begin Message ---
On Mon, 15 Sep 2003, Raditha Dissanayake wrote:

> You don't need to look any further than mime.types files included in
> your apache distro.

Did that as well as googled for the list of extensions. Still can't seem
to find the mime type for .pm7, .p65, .qxp and .pmd.

--- End Message ---
--- Begin Message ---
On Mon, 15 Sep 2003, Javier Tacon wrote:

>
> You could use the function exif_imagetype() to see what type of file
> has been uploaded.
>

 The filetypes are not all images types.

Ed

--- End Message ---
--- Begin Message --- Having done some coding for the print industry i can tell you that pm7 may be adobe page maker 7 and p65 could be pagemaker 6.5 no idea about qxp and .pmd though.



Ed Curtis wrote:

On Mon, 15 Sep 2003, Raditha Dissanayake wrote:



You don't need to look any further than mime.types files included in
your apache distro.



Did that as well as googled for the list of extensions. Still can't seem to find the mime type for .pm7, .p65, .qxp and .pmd.





--
http://www.radinks.com/upload
Drag and Drop File Uploader.

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Sir, I read in a thread that you mailed some code to generate thumbnails
> Might I also have a copy ?
> It's been driving me crazy, all week.
> Thanks !!!!
> Cheers
> Russell

Russell - you might try this google link if you don't get a more useful 
response:

http://www.google.com/search?q=generate+thumbnails+php&sourceid=opera&num=
25&ie=utf-8&oe=utf-8

Cheers
-- 
Quod subigo farinam

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

--- End Message ---
--- Begin Message ---
In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> I'm having a problem with e-mail addresses entered by users that are
> invalid (i.e. $email == "some person at somewhere.com").  Is there a
> function I could call like:
> 
> <?php
> 
>   if (email_is_valid($email))
>    { mail_out_newsletter($email); }
>   else
>    { yelp_and_whine(); }
> 
> ?>
> 
> Thanks in advance,

Haven't seen this question for a few days now :-) The mailing list 
archives are a valuable resource at 

http://marc.theaimsgroup.com/?l=php-general

In particular, for your question, try (allowing for line wrap)

http://marc.theaimsgroup.com/?l=php-
general&w=2&r=1&s=email+address+validation&q=b

Cheers
-- 
Quod subigo farinam

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

--- End Message ---

Reply via email to