Are you sure you are using the ASCII/Binary flag properly?
Also, in your script, are you opening the file with fopen() then reading
with fgets/fread to write to a file on the ftp? or are you using ftp_put()?
I know if there is binary data in a file you are attempting to send ascii,
it will truncat
This happens because the Resource ID is a pointer to the socket, not the
socket itself.
You are storing the value of the resource ID (i.e. '1') in the database.
However, when you are pulling it out, you are pulling it out as an int, and
not a socket identifier.
Keep the socket identifier as a globa
As an addition to that, if you don't want the thousands separator to be ',';
do the following:
$amount = 1234.567
$fmt1 = number_format($amount,2);
$fmt2 = number_format($amount,2,'.','');
echo("$fmt1\n$fmt2");
This will output:
1,234.56
1234.56
Matt
- Original Message -
From: Van Andel,
Loop an fgets()
i.e.
$fp = fopen($file)
while ($filerow = fgets($fp,1024)) /* Read 1024 bytes or to EOL, whichever
is first) */
{
$filerow = str_replace("; ","", $filerow);
$filerow = str_replace("# ","", $filerow);
$filerow = str_replace("\r","", $filerow);
$size = strlen($fil
m - PC, *nix, and Max EOL characters
>
> Hi,
>
> Thanks for the reply. I appreciate your help. fgets() reads to the EOF;
not the
> EOL. Is there something similar to fgets() that I can use? Perhaps where I
can
> state explicity read the file until you encounter and EOL char?
>
&
Compile php as a static binary (CGI execution mode?) and add something liek
the following to your code at the top:
#!/usr/local/bin/php
$arg_count = 1;
while ($arg_count < count($argv))
{
$argument = $argv[$arg_count];
$arg_split = split("=",$argument);
$variable = trim($arg_split[0]);
p friendly.
The other alternative is to have a script require() the php file, just set
your variables in the script, then require('catalog.php');
All code will be executed as if it were part of the script.
Matt
- Original Message -
From: Ron Stagg <[EMAIL PROTECTED]>
To:
You don't need sequential numbers as your key.
Take this example:
/*** define some values ***/
$fruits['apple']['color']=$color;
$fruits['apple']['diameter']=$x;
$fruits['orange']['color']=$color;
$fruits['orange']['diameter']=$x;
$fruits['grape']['color']=$color;
$fruits['grape']['diameter']=$x;
- Original Message -
From: Jonathan Chum <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 01, 2002 3:27 PM
Subject: [PHP] XML-RPC, is this the best approach for something like this?
> Hi guys!
>
> I'm wrapping up a web hosting control panel written in PHP that fills up
A string is an array of characters.
In your example, $str[4] == "h".
Matt
- Original Message -
From: Rodrigo de Oliveira Costa <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, December 05, 2002 1:50 PM
Subject: [PHP] String to an Array
> Hi guys, I got a string that I need to
Try flush()
Matt
- Original Message -
From: Richard Baskett <[EMAIL PROTECTED]>
To: PHP General <[EMAIL PROTECTED]>
Sent: Tuesday, December 10, 2002 7:27 PM
Subject: [PHP] Flushing Output
> Is there a way of flushing output to the browser. So for example, I have
a
> script that checks t
To your first question, I'm sure it can only increase efficiency.
To the second, think the other way around possibly...
Within your script, do the following (or something along these lines):
Pull a list of your includes directory into an array ($all_functions in my
example)
/**
$file is the scrip
$img_count = 0;
echo("
My Images"):
(loop through filenames)
{
if (($img_count % 5) == 0) echo("
");
echo("
");
$img_count = $img_count + 1;
}
while (($img_count % 5) != 0)
{
echo("
");
}
echo("
")
Matt
RClark <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EM
Just use absolute paths.
If your webserver is looking at the root directory, /index.phtml and
index.phtml are the same file
Matt
- Original Message -
From: WMB <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 30, 2002 12:03 PM
Subject: [PHP] Continued story on : PHP inclu
Is bandwidth an issue?
If not, you could have a at the top of your page, flush it before
beginning your data parsing, and update it with a table with two columns, 1
with a bgcolor of some color, the other with no bgcolor, and have the width
of the columns change as the javascript updates it.
i.e
What is the ASCII value of an EOF? Find that and use
Matt
- Original Message -
From: Jean-Christian Imbeault <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 08, 2003 5:24 AM
Subject: [PHP] Re: EOF: how to generate one in a string
> I'm at wits end ... I've tried eve
Instead, find out exactly what headers it is that Getright sends.
Store the resume point in $resume_bytecount
Then, have your script do something like this:
/** Send the appropriate HTML headers **/
/** Do this instead of the fpassthru **/
$filesize = size($filename);
$fp = fopen('$filename','r');
Why not try this:
Store the plaintext password in your DB, or hash with a permanent key (same
key for all users)
Send a well-salted key to the browser @ your login page, each time the user
logs in
Have the user enter the password, have javascript hash it and send it to you
(if you're storing a has
I don't care what you say, all you need is Secure-Socket-Layer
contrary to what you may believe, you don't need a beefy server to implement
it. I had apache+ssl+php+mysql running quite well on a 486 DX4/100 with 64MB
ram.
Decrypting is worse than you think.
Anything you can decrypt, so can someone
So forward the ports (80,443) to a box that u can run a webserver on, then
you can user SSL.
Matt
- Original Message -
From: José León Serna <[EMAIL PROTECTED]>
To: Matt Vos <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 5:28 AM
Subj
Try $languages = array_keys($lang);
This will create an array $languages = array("english","francais");
Matt
- Original Message -
From: Vincent M. <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 02, 2003 4:58 PM
Subject: [PHP] So many functions!
> Hello,
>
> There so
21 matches
Mail list logo