php-general Digest 20 Dec 2003 17:30:51 -0000 Issue 2484

Topics (messages 173063 through 173078):

Re: Merry Chrismas
        173063 by: Ryan A

form variables
        173064 by: Nitin
        173065 by: Robert Cummings
        173066 by: Nitin

Re: Turck MMcache compiling
        173067 by: R'twick Niceorgaw

File Upload on a MAC-Browser didn't work
        173068 by: Volker Dähn

Re: html or php to pdf whith pdflib?
        173069 by: Chris
        173071 by: dan

Re: fopen does not open URL-files
        173070 by: Taras V. Panchenko

Re: File upload problem
        173072 by: Larry Brown

PHP Memory Use
        173073 by: Chris Hogben
        173074 by: Chris Hogben
        173077 by: Raditha Dissanayake

sessions problem
        173075 by: Nitin

PHP 4.3.4 configure
        173076 by: Bernard C. Saulter

mysql load_file retreival
        173078 by: Larry Brown

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 ---
Hey,
And a very Merry Christmas to you too...think I dont mean it?

Check this out:
www.jumac.com/free-birthday-christmas-holiday-greetings/upcardme.php?step=pi
ckup&id=2k03596bb8f8

Cheers,
-Ryan A

--- End Message ---
--- Begin Message ---
hi all,

i've an application, where i'm receiving variables from an html form and process them 
in the script. depending on the values, i may want to get some extra information from 
user through another form. now, problem is how can i keep the vaiables received from 
the first form, without passing them as query string to the next script or specifying 
as hidden form fields.

i'll really appreciate a quick help. thanx in advance
Nitin

--- End Message ---
--- Begin Message ---
On Sat, 2003-12-20 at 01:29, Nitin wrote:
> hi all,
> 
> i've an application, where i'm receiving variables from an html form and process 
> them in the script. depending on the values, i may want to get some extra 
> information from user through another form. now, problem is how can i keep the 
> vaiables received from the first form, without passing them as query string to the 
> next script or specifying as hidden form fields.
> 
> i'll really appreciate a quick help. thanx in advance

Sessions.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
thanx for a quick reply and i'm sorry for it was so dumb qu

nitin
----- Original Message ----- 
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Nitin" <[EMAIL PROTECTED]>
Cc: "PHP-General" <[EMAIL PROTECTED]>
Sent: Saturday, December 20, 2003 11:59 AM
Subject: Re: [PHP] form variables


> On Sat, 2003-12-20 at 01:29, Nitin wrote:
> > hi all,
> >
> > i've an application, where i'm receiving variables from an html form and
process them in the script. depending on the values, i may want to get some
extra information from user through another form. now, problem is how can i
keep the vaiables received from the first form, without passing them as
query string to the next script or specifying as hidden form fields.
> >
> > i'll really appreciate a quick help. thanx in advance
>
> Sessions.
>
> Cheers,
> Rob.
> -- 
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

Quoting Ryan A <[EMAIL PROTECTED]>:

> Hi,
> 
> We just took a dedicated server (Linux) and want to install Turck MMCache
> for PHP on it, we have total control of that server and can SSH in etc.
> Their "support" does not want to install it and told us if we want to, we
> will have to do it ourselves...
> 
> is there anyway we can ssh in and do it?
> I have never done anything like this before and am on a windows 2k pro
> machine...I use putty to connect.
> 
> Any help appreciated.

definitely you can do it. just login as root and follow the documentation at
the
mmcache web site. I just installed it y'day and it was very easy. 
if you need any help feel free to contact me off list.

HTH
R'twick






----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--- End Message ---
--- Begin Message ---
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:  
 
<form enctype="multipart/form-data" method="POST" name="NAForm"
action="IA.php?<?=SID?>">  
<input type="file" name="BildDatei" maxlength="128" size="36" value="<? echo
$Bild; ?>">  
<input type="hidden" name="MAX_FILE_SIZE" value="20480">  
 
 
 
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";  
} 

--- End Message ---
--- Begin Message ---
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
> 
> 
> 

--- End Message ---
--- Begin Message ---
i use htmldoc, which converts html to pdf, saves trying to render lines
and borders in a pdflib how painful.

On Sat, 2003-12-20 at 10:20, Chris wrote:
> 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
> > 
> > 
> > 

--- End Message ---
--- Begin Message ---
I tried, but I receive the new error:

Warning: fopen(): php_network_getaddresses: getaddrinfo failed: Name or
service not known in /home/manageme/public_html/try-test/fopen-test-http.php
on line 7

Warning: fopen(http://www.management.kiev.ua/MO/main.php/): failed to open
stream: Permission denied in
/home/manageme/public_html/try-test/fopen-test-http.php on line 7

Why there are errors in this simple command? What are
'php_network_getaddresses' and 'getaddrinfo' ?

Thanx,
Taras V. Panchenko.


"Eric Bolikowski" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
> "Taras Panchenko" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > I have 2 questions:
> > 1) why gethostbyname() does not resolve my host name into IP?
> > 2) why fopen() (and file()) does not open an external (URL) file via
http?
> > Please, see my example below:
> > ------------------
> >
>
http://www.management.kiev.ua/try-test/fopen-test-http.php -----------------
> > --
> > <?
> > echo gethostbyname("www.management.kiev.ua");
> >
> > $h=fopen("http://www.management.kiev.ua/MO/main.php";, "r");
> > echo fread($h,200);
> > ?>
>
> Try this rather(maybe it works):
>
> <?php
>
> $fp=fopen("http://www.management.kiev.ua/MO/main.php/";, "r");
>  echo fread($fp,200);
> ?>

--- End Message ---
--- Begin Message ---
According to the documentation you have to have the maxfilesize tag before
the input tag.

-----Original Message-----
From: Dino Costantini [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 17, 2003 6:34 PM
To: [EMAIL PROTECTED]
Subject: [PHP] File upload problem


i'm trying to write a page which allows user to upload file. theese are my
sources but they didn't work, anyone could help me?
-----form.html--------
<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="upfile">
<input type="hidden" name="MAX_FILE_SIZE" value="10000">
<input type="submit" value="Invia il file">
</form>
--------upload.php-----------
<?php
// QUESTE RIGHE RENDONO LO SCRIPT COMPATIBILE CON LE VERSIONI
// DI PHP PRECEDENTI ALLA 4.1.0
if(!isset($_FILES)) $_FILES = $HTTP_POST_FILES;
if(!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;

/********************* VARIABILI DA SETTARE ********************/
// Directory dove salvare i files Uploadati ( chmod 777, percorso assoluto)
$upload_dir = $_SERVER["DOCUMENT_ROOT"] . "/esempi";

// Eventuale nuovo nome da dare al file uploadato
$new_name = "ciao.dino";

// Se $new_name è vuota, il nome sarà lo stesso del file uploadato
$file_name = ($new_name) ? $new_name : $_FILES["upfile"]["name"];

if(trim($_FILES["upfile"]["name"]) == "") {
die("Non hai indicato il file da uploadare !");
}

if(@is_uploaded_file($_FILES["upfile"]["tmp_name"])) {
@move_uploaded_file($_FILES["upfile"]["tmp_name"], "$upload_dir/$file_name")
or die("Impossibile spostare il file, controlla l'esistenza o i permessi
della directory
dove fare l'upload.");
} else {
die("Problemi nell'upload del file " . $_FILES["upfile"]["name"]);
}

echo "L'upload del file " . $_FILES["upfile"]["name"] . " è avvenuto
correttamente";

?>
-----------------------
upload.php doesn't upload anything and doesn't output any error message. i
don't think it's an apache problem, because this is the only page that
doesn't work.

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

--- End Message ---
--- Begin Message ---
Hey guys,

Just a quick question, which i hope someone can answer for me :)

If PHP is run for a long time, such as a server, or a PHP Bot, is the memory
usage of PHP likely to increase? If so, is there any way of attempting to
combat this, or is it just the way that PHP is built?

Cheers :)

Chris Hogben

--- End Message ---
--- Begin Message ---
Hey guys,

Just a quick question, which i hope someone can answer for me :)

If PHP is run for a long time, such as a server, or a PHP Bot, is the memory
usage of PHP likely to increase? If so, is there any way of attempting to
combat this, or is it just the way that PHP is built?

Cheers :)

Chris Hogben

--- End Message ---
--- Begin Message ---
Hi,
if you run poorly written scripts the answer is yes. else the answer is no.

Chris Hogben wrote:

Hey guys,

Just a quick question, which i hope someone can answer for me :)

If PHP is run for a long time, such as a server, or a PHP Bot, is the memory
usage of PHP likely to increase? If so, is there any way of attempting to
combat this, or is it just the way that PHP is built?

Cheers :)

Chris Hogben





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

--- End Message ---
--- Begin Message ---
hi all,

i'm just starting to use sessions.
i've a problem, 

i started session and assigned variables to $HTTP_SESSION_VARS
i can very well see these vars in my next script, but i need to get back to first 
script for some working, and strangely i dont find these vars there.

any help or suggestions

Nitin

--- End Message ---
--- Begin Message ---
I'm trying to configure/compile PHP4.3.4 on Solaris 2.8.
Seem that 'configure' just hangs now. The 'new' build systems is broken.
I can build older version with no problem. Seem something that was not broken 
was 'fixed'. (Not a good idea.)
So, the old command of: 'configure --prefix=(what ever) --with-mysql
--with-apxs=(what ever) not just starts and hang after get to: checking host 
system type...sparc-sun-solaris2.8'
and stays there (for ever unless you kill it manual - break or control d). No 
idea what the problem could be as it never does anything more. (Machine runs: 
everythings that will compile version php-4.0.1pl2, Apache_1.3.29 and 
MYSQL-4.0.16 so this version should work (ya right)).
Bernard

--- End Message ---
--- Begin Message ---
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?

--- End Message ---

Reply via email to