[PHP] Re: Newbie question...

2002-02-22 Thread J Smith


Try wget if it's installed. If not, lynx, a shell-based web browser, is 
installed on quite a few machines. 

J




Ben Turner wrote:

> This may be a bit off topic but I am trying to install the pdflib package
> for Linux so I can make pdfs through php and I was wondering if anyone
> might know the command to download a file via CRT from an http source.
> 
> I apologize to the OT but I cant seem to get much of anything to work for
> me.
> 
> Thanks!
> Ben


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




[PHP] Re: Newbie Question

2002-04-08 Thread Michael Virnstein

try this:



Solid






");
print("".$data[0]."");
print("");
print("."$data[2]."");
print("".$data[3]."");
print("".$data[4]."");
print("".$data[5]."");
print("");
}
 }
?>





"Hubert Daul" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

>
> Hi ,
>
> Here's my problem :
>
> I read a data file (no sql file) which contains 8 lines, and in each line,
8
> datas
>
> (ex: name1;picture1;title1;anything1;everything1;nothing1)
>
> and when i run it I see only one picture(the second data) and not all of
> them
>
> If someone could help me
>
> TYA
>
> Here the code :
>
> 
> 
> Solid
> 
> 
>
> 
> 
>
>   $row = 1;
>  $fp = fopen ("album.dat","r");
>   while ($data = fgetcsv ($fp, 1000, ";"))
>   {
> $num = count ($data);
>
> $row++;
>
> if (isset($vignette))
> {
> print("");
> print("$vignette");
>// I think it's wrong here but I dont know why
> ==>   print(" \"prod.php?file=lecteur.dat\">");
> print("$marque");
> print("$nom");
> print("$pdfproduit");
> print("$commprod");
> print("");
> }
>
>
> for ($c=0; $c<$num; $c++)
> switch ($c)  {
> case 0 :
> {
> $vignette = $data[$c];
> break;
> }
>
> case 1 :
> {
> $photo= $data[$c];
> break;
> }
>
> case 2 :
> {
> $marque= $data[$c];
> break;
> }
>
> case 3 :
> {
> $nom = $data[$c];
> break;
> }
>
> case 4 :
> {
> $pdfproduit= $data[$c];
> break;
> }
>
> case 5 :
> {
> $commprod = $data[$c];
> break;
> }
> }
>  }
> ?>
> 
> 
> 
>
>
>
>
>



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




[PHP] Re: Newbie Question

2001-11-21 Thread Lee Willmann

Ok, I think I have the solution to your problem.

Try using nl2br() on the data in that field..
Example:

I have a message table that allows one user to send an instant message to
another user on my site. There are several fields, one of which being a TEXT
column (MySQL db). I use a simple textarea form element to get the data. It
inserts into the DB as basically a single line regardless of the ENTER
keystrokes in the data. Now, when I pull it back out I use this:

$query = "SELECT * FROM message WHERE msg_id = '$msg_id'";
$query_result = mysql_query($query);
$query_row = mysql_fetch_array($query_result);

$message = $query_row["message"];

echo "Message text:".nl2br($message);

And that should do what you need.

Lee Willmann

"Steve Brett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> have a look at get_html_translation_table() in the php manual.
>
> there is an example of conversion of all special chars so they can be
> inserted into the database as text (i.e. £>£) and a cool way of
> 'decoding' them if you need to write them to a file. A Browser wil
interpret
> them correctly when they are displayed.
>
> This must be the question of the day as i have posted this answer three
> times today :-)
>
> Let me know if you need any more help
>
> Steve
>
> get_html_translation_table manual page is below:
>
>   PHP Manual
>   Prev  Next
>
> --
--
> 
>
> get_html_translation_table
> (PHP 4 >= 4.0b4)
>
> get_html_translation_table --  Returns the translation table used by
> htmlspecialchars() and htmlentities()
> Description
>
> string get_html_translation_table (int table [, int quote_style])
>
>
> get_html_translation_table() will return the translation table that is
used
> internally for htmlspecialchars() and htmlentities(). There are two new
> defines (HTML_ENTITIES, HTML_SPECIALCHARS) that allow you to specify the
> table you want. And as in the htmlspecialchars() and htmlentities()
> functions you can optionally specify the quote_style you are working with.
> The default is ENT_COMPAT mode. See the description of these modes in
> htmlspecialchars(). Example 1. Translation Table Example
>
> $trans = get_html_translation_table (HTML_ENTITIES);
> $str = "Hallo &  & Krämer";
> $encoded = strtr ($str, $trans);
>
>
>
> The $encoded variable will now contain: "Hallo &  &
> Krämer".
>
> The cool thing is using array_flip() to change the direction of the
> translation.
>
>
> $trans = array_flip ($trans);
> $original = strtr ($str, $trans);
>
>
>
>
> The content of $original would be: "Hallo &  & Krämer".
>   Note: This function was added in PHP 4.0.
>
>
> See also: htmlspecialchars(), htmlentities(), strtr(), and array_flip().
>
>
> --
--
> 
>   Prev Home Next
>   explode Up get_meta_tags
>
>
>
>
>
> "Jay Fitzgerald" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]...
> > Ok, I am still fairly new at PHP and MySQL also, so please bear with me.
> >
> >
> > TASK: I have a client that wants to have job openings listed on their
site
> > and they want to be able to add, edit and delete the postings
themselves.
> I
> > would do this in flat-file format but there is the risk of that file
size
> > getting too large and slowing down the server.
> >
> >
> > SOLUTION: I have created a MySQL database that will hold all the
postings
> > in a table called 'jobs' and have created a PHP form that will post this
> > jobs into the db.
> >
> > PROBLEM: When I go to the PHP form and enter all of the pertinent job
> > information, there is one specific field that will have to have carriage
> > returns/line breaks in it between paragraphs. Everything is working
except
> > for this. Is there a way whenever the user presses , that either
> > PHP/MySQL will convert this into a  tag only when being displayed in
a
> > browser and not in the db??
> >
> >
> > Can anyone out there please help me with this? I am available off-list
as
> > well if it will be easier to pass code back and forth. Any assistance is
> > greatly appreciated!
> >
> >
> >
> > Should you have any questions, comments or concerns, feel free to call
me
> > at 318-338-2034.
> >
> > Thank you for your time,
> >
> > Jay Fitzgerald, Design Director - CSBW-A, CPW-A, CWD-A, CEMS-A
> > ==
> > Bayou Internet..(888)
> > 30-BAYOUhttp://www.bayou.com
> > Mississippi Internet...(800)
> > MISSISSIPPI...http://www.mississippi.net
> > Vicksburg Online..(800)
> > MISSISSIPPIhttp://www.vicksburg.com
> > ==
> > Tel: (318) 338-2034ICQ: 38823829
Fax:
> > (318) 323-5053
> >
>
>



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

Re: [PHP] Re: Newbie question...

2002-02-22 Thread Thalis A. Kalfigopoulos

On Fri, 22 Feb 2002, J Smith wrote:

> 
> Try wget if it's installed. If not, lynx, a shell-based web browser, is 
> installed on quite a few machines. 
> 
> J
> 
> 
> 
> 
> Ben Turner wrote:
> 
> > This may be a bit off topic but I am trying to install the pdflib package
> > for Linux so I can make pdfs through php and I was wondering if anyone
> > might know the command to download a file via CRT from an http source.
> > 
> > I apologize to the OT but I cant seem to get much of anything to work for
> > me.
> > 
> > Thanks!
> > Ben

Let me suggest an alternative for creating .pdf files on PHP:
http://www.fpdf.org

Easier to use. Trivial to install.

cheers,
thalis


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




[PHP] Re: Newbie: Question about filesize()

2002-01-31 Thread Jim Winstead

Manuel Ritsch <[EMAIL PROTECTED]> wrote:
> $file_s = filesize($file);

you want $file_s = filesize("images/$file").

jim

-- 
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: Newbie: Question about filesize()

2002-02-06 Thread Ben Crawford

You also seem to have an extra equals. Your loop should read:

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

It should come up as an error, but I'm not sure.

Ben

Manuel Ritsch wrote:

> Hello There
>
> I'm new to PHP and trying to code a function that reads all teh files out of
> a directory and printing out a link and the filesize,
> but it seems that the filesize() function doesn't work, here's the code so
> far:
>
>  $handle = opendir ('images');
>  echo "Files:";
>  while (false !== ($file = readdir ($handle))) {
>  if($file != "." && $file != "..")
>  {
>  $file_s = filesize($file);
>  echo "$file Filesize:
> $file_s";
>  }
>  }
>  closedir($handle);
>
> and the output is somethingl ike this:
>
> Files:
> button_test_04.gif Filesize:
> button_test_03-down.gif Filesize:
> lilextras_01.gif Filesize:
> (and so on)...
>
> You see, there's no Filesize and I don't know why, please help me
>
> -- manu


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




[PHP] Re: Newbie question pleeze help

2001-11-15 Thread Richard Lynch

Rvb Pixels wrote:

> Hi,
> 
> I'm new to the list and I have a problem with PHPNUKE 5.2 and W98.
> 
> After installing some categories and links in the Web Links section, and
> then clicking on one of the links created I keep getting the following
> message error in W98SE.
> 
> "PHP caused an invalid page fault in module PHP4TS.DLL..."
> 
> 
> Does anyone know why and how can I solve this problem ?

Your web server (Apache or IIS) has a log file with every error recorded, 
or at least, every error that isn't so horrendous that making a record is 
possible.

For Apache with the default installation Windows, it's in:
C:/Program Files/Apache Group/Apache/logs/error_log
(I think)

You may have some useful details in that file that can clue you in to what 
is happening.

There may also be instructions at http://bugs.php.net about how to track 
down these kinds of errors.

-- 
Like music?  http://l-i-e.com/artists.htm


-- 
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: Newbie question on Tutorials?

2001-12-06 Thread The Big Roach

Bunch of them!
Check php.net's links and sift through those.
Web Monkey has a good primer on PHP & MySQL.

"Geoff E" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Okay, probably been asked zillions of times already, but I couldn't find
> reference to it in the last 5 minutes. :)
>
> Where can I find newbie-novice tutorials on php/mysql?
>
> My server is PHP4/MySql on a Apache/FreeBSD.
>
> I want to learn how to make these types of sites: Dating, Buy&Sell,
Forums,
> etc...
>
> I have VB, Delphi, and C programming experience, so I'm hoping it won't be
> too hardcore. :)
>
> Cheers,
>
> - Geoff
>
>



-- 
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: Newbie question: Page Counter

2001-04-19 Thread yanto


this counter'll increment the counter, no matter where are you go the page
from. If you only want that the counter increment for the first time
visitor visit the website, put the code at mainpage file, and check also
the page referrer weather it's a local url or not.


-toto-

Adam writes:

> make a file called counter.php and include this text:
> 
> //-counter.php--
> ---//
> 
>   //Simple PHP counter, v0.1. Send comments to [EMAIL PROTECTED]
>  if (file_exists('count.inc'))
>  {
>   $fil = fopen('count.inc', r);
>   $dat = fread($fil, filesize('count.inc'));
>   echo $dat+1;
>   fclose($fil);
>   $fil = fopen('count.inc', w);
>   fwrite($fil, $dat+1);
>  }
>  else
>  {
>   $fil = fopen('count.inc', w);
>   fwrite($fil, 1);
>   echo '1';
>   fclose($fil);
>  }
> php?>
> 
> //--
> --//
> 
> 
> then make a file called count.inc and chmod it to 777 so anyone can write to
> it. insert a number into the file.
> 
> 
> //--count.inc---
> --//
> some value

-- 
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] Re: Newbie: Question about filesize()

2002-02-06 Thread Martin Towell

that should be okay - it's to make sure that it is exactly equal to (as
opposed to equates to be equal to)

eg (0 === false)  => false
   (0 ==  false)  => true

-Original Message-
From: Ben Crawford [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 07, 2002 2:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Newbie: Question about filesize()


You also seem to have an extra equals. Your loop should read:

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

It should come up as an error, but I'm not sure.

Ben

Manuel Ritsch wrote:

> Hello There
>
> I'm new to PHP and trying to code a function that reads all teh files out
of
> a directory and printing out a link and the filesize,
> but it seems that the filesize() function doesn't work, here's the code so
> far:
>
>  $handle = opendir ('images');
>  echo "Files:";
>  while (false !== ($file = readdir ($handle))) {
>  if($file != "." && $file != "..")
>  {
>  $file_s = filesize($file);
>  echo "$file
Filesize:
> $file_s";
>  }
>  }
>  closedir($handle);
>
> and the output is somethingl ike this:
>
> Files:
> button_test_04.gif Filesize:
> button_test_03-down.gif Filesize:
> lilextras_01.gif Filesize:
> (and so on)...
>
> You see, there's no Filesize and I don't know why, please help me
>
> -- manu


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



Re: [PHP] Re: Newbie: Question about filesize()

2002-02-06 Thread Jeff Sheltren

At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote:
>You also seem to have an extra equals. Your loop should read:
>
>while (false != ($file=readdir($handle))){

I think you could eliminate the "false !=" in the while condition...

It should be just the same if you write
while (($file = readdir($handle)))

right?

-Jeff




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




Re: [PHP] Re: Newbie: Question about filesize()

2002-02-06 Thread Lars Torben Wilson

On Wed, 2002-02-06 at 07:27, Ben Crawford wrote:
> You also seem to have an extra equals. Your loop should read:
> 
> while (false != ($file=readdir($handle))){
> 
> It should come up as an error, but I'm not sure.
> 
> Ben

No, that's the 'identical' operator, which returns true when its
operands are both equalivalent and of the same type:

  http://www.php.net/manual/en/language.operators.comparison.php


Cheers,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




Re: [PHP] Re: Newbie: Question about filesize()

2002-02-06 Thread Lars Torben Wilson

On Wed, 2002-02-06 at 15:33, Jeff Sheltren wrote:
> At 10:27 AM 2/6/2002 -0500, Ben Crawford wrote:
> >You also seem to have an extra equals. Your loop should read:
> >
> >while (false != ($file=readdir($handle))){
> 
> I think you could eliminate the "false !=" in the while condition...
> 
> It should be just the same if you write
> while (($file = readdir($handle)))
> 
> right?
> 
> -Jeff

Wrong, actually. If you have any files in that directory which have
names which would evaluate as false in PHP, then your way will fail on
them and you'll get a truncated directory listing. Do 'touch 0' in a 
directory and give it a shot; you'll see what I mean.

However, the original example does the same thing, since it only checks
whether the result of the readdir() evaluates to FALSE, not whether it
actually is a boolean FALSE value. The correct way to do this is:

  while (FALSE !== ($file = readdir($handle))) {
 . . . 
  }

Note the !== instead of !=.


Hope this helps,

Torben

-- 
 Torben Wilson <[EMAIL PROTECTED]>
 http://www.thebuttlesschaps.com
 http://www.hybrid17.com
 http://www.inflatableeye.com
 +1.604.709.0506


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




[PHP] Re: Newbie question to everybody....PHP

2002-05-11 Thread Austin Marshall

R wrote:
> Greetings people,
> Special greetings to all of you who have helped me in the past.
> 
> As most of you know i am a newbie, I learned a bit of PHP via webmonkey and
> a few other places, seeing the power of PHP i decided to convert from Java
> servlets and JSP (JSP coz its expensive to host and not many hosting
> opportunities) so I baught a book called "The PHP black book".
> Anyway, now that the background is done heres my questions:
> 
> 1)How many of you have seriously dug into arrays and has it been important
> in your programming?
> 1.1)Do you think you could have done the same thing you did with arrays
> WITHOUT arrays?
> (The reason i ask this is theres a whole chapter dedicated to arrays in the
> book & its pretty frustrating)
> Last question:
> Is ther any function to make the program "sleep" for 10 seconds or so? or
> does anybody have a function that does this?
> 
> ANY replies good,bad,flames will be welcome.
> Cheers,
> -Ryan.
> 
> /* You cannot get to the top by sitting on your bottom. */
> 
> 
> 
> 

I couldn't imagine a world without arrays.  But even if you don't 
understand the creation of arrays, you should at least get familiar with 
the $_POST,$_GET,$_SERVER,etc... arrays as you probably won't be able to 
write any useful scripts without them.  Not to mention the fact that you 
will probably never be able interface with a database without using arrays.


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




[PHP] Re: Newbie Question re: Select boxes

2001-08-23 Thread jimw

Lb <[EMAIL PROTECTED]> wrote:
> 1) I thought that PHP automatically created variables for all form elements
> on a page. When I run this, the dropdown box contains the first item, but
> $Report evaluates as null. I am unclear why.
> 
> 
> 1 Test Report A
> 2 Test Report B
> 3 Test Report C
> 
> 

you have set the value for each option to an empty string. you
probably mean either 'Test Report A' or
'1 Test Report A'.

> 2) Is there any way for PHP to detect the change even on the dropdown, or do
> I need to use javascript?

you have to use javascript.

jim

-- 
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: newbie question: how to recompile PHP?

2002-04-03 Thread Craig Donnelly

Strange..U sure you got the Win32 version??

Heres a mirror where u can get the installer:
http://www.evilwalrus.com/downloads/php/4.1.2/php-4.1.2-installer.exe

All the best,

Craig

"Bogdan Popescu" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello all,
>
>   I hope my newbie question don't bother you
>   too much.
>
>   I've downloaded the latest PHP for windows
>   but when I try to use it I get a message
>   that I have to re-compile it.
>
> ("You may disable this restriction by recompiling the PHP binary
> with the --disable-force-cgi-redirect switch.")
>
>   Can anybody tell me a couple of words about
>   how to recompile PHP? Or this error message
>   is just an issue of php.ini?
>   I got the sources but what kind a compiler
>   do I need, where from I can get it?
>
> --
> TIA,
> Bogdan  mailto:[EMAIL PROTECTED]
>



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




[PHP] Re: Newbie question about PHP and Oracle

2002-05-28 Thread Markus Mirsberger

Hi,

I think you mean hwo u can get the data into an array
well here is an example :

$query = "select ...";
$stmt = ociparse( $connectionhandle, $query );

if( ociexecute( $stmt, OCI_DEFAULT ) ){
ocifetchinto( $stmt, $row, OCI_ASSOC+OCI_RETURN_NULLS );
}

and now you got 1 resultset in an associative array called $row.
take a look at the oci-functions in the manual for the different flags u can
set.



regards
markus mirsberger


"Michael Sweeney" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> a VERY newbie question, just how do I get data into a listbox? In mysql it
> was pretty easy with mysql_fetch_row, but for oracle I am totally lost.
>
>
> Thanks!
>
>
>
>



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




[PHP] Re: Newbie question : PHP variables are not posted by this

2002-05-31 Thread Michael Davey

Can you send the code that is failing to the list - it will help in working
out the problem...

Mikey

"FréDéRick St-Hilaire" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> It a BASIC question,
>
> With the following:
>
>  ENCTYPE="multipart/form-data">
> 
>  Name : 
> 
> 
> 
> 
> 
>
> With the job_action.php I want to display the resaults to the user.
>
> But the variable name is empty.
>
> What's the problem?
>
> Thanks
>
> Frédérick St-Hilaire
>
>



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




Re: [PHP] Re: Newbie question : PHP variables are not posted by this

2002-05-31 Thread Stuart Dallas

On Friday, May 31, 2002, 5:17:49 PM, you wrote:
> Can you send the code that is failing to the list - it will help in working
> out the problem...

And include your platform details (OS, PHP version, etc).

-- 
Stuart


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