$array = file($filename);
Each line of the array will have a line of your file.
Or, if you want to do it line by line:
$fp = fopen($filename,'r');
while(!feof($fp)) {
$line = fgets($fp);
}
fclose($fp);
-Rasmus
On Tue, 19 Nov 2002, Kelly Meeks wrote:
> here's an example of a text f
There are a couple of ways:
- If the file is small enough, I suppose you could use the
http://ca.php.net/manual/en/function.file.php file function, which loads
the file in array (one element per line).
- If the file is bigger, you can use the normal fopen() functionality
and then use http://ca.ph
On Wednesday 20 November 2002 03:45, Kelly Meeks wrote:
> here's an example of a text file I need to read...
>
> abcd|test1|morevalues|otherstuff
> efghijklm|a;kd;laskf;alskdjf;alskdf;askldjasldkf|;askd;lakjl;asdf|al;sdjf;a
>lf
>
> I believe each line is seperated by a carriage return.
>
> How can
This works too.
$fp = fopen($filename,'r');
while($line=fgets($fp))
{
//do what you need to do with $line
}
fclose($fp);
Robbert van Andel
-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 11:44 AM
To: Kelly Meeks
Cc: [EMAIL PRO
Some are more stable than others. Which particular SAPI module are you
asking about?
On Tue, 19 Nov 2002, Chris Edwards wrote:
> Does anyone know if the PHP SAPI modules are better in the newer releases?
> Are they currently stable enough for production websites?
>
> --
> Chris Edwards
> Web App
even further, instead of using fgets() to get each line and then exploding
it, you can use fgetcsv() which reads the line and breaks it into chunks by
any delimiter, returning the chunks in an array.
$fp = fopen($filename, "r");
while (!feof($fp))
{
$line = fgetcsv($fp, 9, "|");
...
}
> does anybody know a way to make a distinction
> between robots and users?
> should I use the user agent? Or is this not a safe method.
> If the visitor is a spider/robot I want to include some script
> containing extra URL's for the robot.
I am very interested too in this, as I received visits f
ok, I have gotten great help here already, but it still doesn't work,
it returns a object not found error (on the $foo->bar() line). I want to
change $overall->foo->bar() to $foo->bar... any tips? or help??
thanx!
- Tularis
class overall {
var $loaded;
function load($class){
eval("glob
>From what I think I heard on another group was that it dosent matter what
stylesheet you use, it will just read the file, getting words and following
links. Cant remember where I read this, think it was a forum, and they were
argueing about robots and whether they follow links specified in JavaScr
hi
how can i send a mail by a smtp server from a php page?
thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi all
Does somebody know if there is a potential problem with
Header("Location: ");
not working properly?
I have a redirection, but it seems that on some browser, this doesn't work.
Instead of the redirection, the same page is requested again!
I'm also using sessions and html-post reque
What browsers are having the problems?
On Tue, 2002-11-19 at 15:36, Baumann Reto wrote:
> Hi all
>
> Does somebody know if there is a potential problem with
> Header("Location: ");
> not working properly?
>
> I have a redirection, but it seems that on some browser, this doesn't work.
> I
At 23:08 19.11.2002, Vincent Vandemeulebrouck said:
[snip]
>> does anybody know a way to make a distinction
>> between robots and users?
>> should I use the user agent? Or is this not a safe method.
>> If the visitor is a spider/robot I want to include some s
Are you using an exact path or a relative url (such as somepage.php)?
It should be absolute (such as http://someserver/somepage.php).
Baumann Reto wrote:
Hi all
Does somebody know if there is a potential problem with
Header("Location: ");
not working properly?
I have a redirection, but
phpmailer.sourceforget.net
-js
Siamak wrote:
> hi
> how can i send a mail by a smtp server from a php page?
> thanks
>
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
At 23:36 19.11.2002, Baumann Reto said:
[snip]
>Hi all
>
>Does somebody know if there is a potential problem with
>Header("Location: ");
>not working properly?
>
>I have a redirection, but it seems that on some browser, this doesn't work.
>Instead of
--- Baumann Reto <[EMAIL PROTECTED]> wrote:
> Does somebody know if there is a potential problem with
> Header("Location: ");
> not working properly?
Try this code:
http://www.google.com/";);
?>
If this does not work, let us know.
Chris
--
PHP General Mailing List (http://www.php.net/)
To
I'm looking for a PHP library that would allow me to write in the native
file format of Microsoft Access (".mdb"). This would allow me to "hand" a
copy of a MySQL database to my client. I'm hosted on unix, and I'm not
familiar with ODBC, nor do I have access to MS Access running on a server.
Does
At 11:18 20.11.2002, Siamak said:
[snip]
>hi
>how can i send a mail by a smtp server from a php page?
>thanks
[snip]
http://www.php.net/manual/en/function.mail.php
--
>O Ernest E. Vogelsinger
(\)ICQ #
$overall->foo->bar() works for me.
also there's no need for the eval('global...') line
Apache 1.3.27, PHP 4.2.2
-js
Tularis wrote:
> ok, I have gotten great help here already, but it still doesn't work,
> it returns a object not found error (on the $foo->bar() line). I want to
> change $overal
Hello,
On 11/20/2002 08:18 AM, Siamak wrote:
hi
how can i send a mail by a smtp server from a php page?
If you are using Windows that is is the default method.
If not, you may want to try these classes:
http://www.phpclasses.org/smtpclass
http://www.phpclasses.org/mimemessage
--
Regards,
Ma
After upgrade to 4.2.3, plus "+" sign has changed to space after POST. I
have checked the mailing list but can't find any help to turn this off
forever! is this a bug in PHP?
thanks
seems to me that you're trying to have an object's member behave as if it
had global scope. you never say "$foo = new bar()". instead you say
"$this->foo = new foo()" where $this is an instance of Overall. you can't
instantiate a Foo as a member of an Overall instance, and then expect to
talk to
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 19, 2002 6:43 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] plus sign has changed to space after POST
>
> After upgrade to 4.2.3, plus "+" sign has changed to space after POST.
I
> have checke
I have tried this but the problem is it change the other special character
as well. For example, $ to %24, etc.
If people pass a string like "abc+def$ghi", I want to save the exact
string to the database rather than "abc+def%24ghi". I can't do a
translation of %24 to $ before saving the stri
You have to encode it on one end, and decode it on the other.
Use
$url_safe = urlencode($string);
and pass $url_safe in the URL. Then on the receiving end, use
$back_to_normal = urldecode($url_safe_string);
---John Holmes...
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMA
Hello,
Every not EXPERIMENTAL modules are supposed to be stable. There still might
have some bugs and bug-fixes too..
--
Regards.
M.CHAILLAN Nicolas
[EMAIL PROTECTED]
www.WorldAKT.com Hébergement de sites internets.
"Chris Edwards" <[EMAIL PROTECTED]> a écrit dans le message de news:
04dd01c28ff
Hey Guys,
At the moment, I'm using quite a few lines of code to convert seconds to
minutes and hours. I'm thinking, surely I'm missing something really
simple! Is there a PHP function that converts seconds to minutes? Or is it
a 4 or 5 (and not always that accurate) lines of code?
Any ideas or
might be my php code has problem the following code fragment will keep "+"
to "+" but "$" to "%24"
"John W. Holmes" <[EMAIL PROTECTED]>
11/19/2002 04:12 PM
Please respond to holmes072000
To: <[EMAIL PROTECTED]>
cc: <[EMAIL PROTECTED]>
Subject:
Ok, I'm going to break down and ask for help.
I'm trying to post an XML file to NetLedger through HTTPs, but cURL isn't
returning any errors when I run through PHP, and the file isn't getting there.
Can someone point me in the direction of a site with some *good* help on
how to do file posting
>From: "Bob Irwin" <[EMAIL PROTECTED]>
> Sent: Tuesday, November 19, 2002 7:27 PM
>Subject: [PHP] Seconds to minutes
> At the moment, I'm using quite a few lines of code to convert seconds to
> minutes and hours. I'm thinking, surely I'm missing something really
> simple! Is there a PHP function
> might be my php code has problem the following code fragment will keep
"+"
> to "+" but "$" to "%24"
That's what urlencode() is supposed to do.
---John Holmes...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
> You can do something like this:
> $seconds = 265;
> $time = date('i s',$seconds);
> $minSecs = explode(' ',$time);
> echo "{$minSecs[0]} minutes and {$minSecs[1]} seconds\n";
> ?>
That doesn't work for anything over 3599 seconds, though...
---John Holmes...
--
PHP General Mailing List
Its seems far more reliable than what I am using (dividing by 60 for
minutes, 3600 for hours and doing rounding, exploding if its not a round
number etc).
Its only for measuring short times, so Matt's suggestion should work ok.
Ideally though, because it will crop up from time to time, it'd be the
Bob,
Instead of dividing, use modulus to get the exact number of remaining
seconds, and then determine the minutes from that.
Here is some code that I've quickly adapted from another language I use, to
take the total minutes, and convert it to "hours:minutes" display.
$totalmins = 193;
$showmin
Hello, how would I go about listing a portion of a MySQL table, without an
overall selection criterium? I have a unique index field, but it's a string
and not autoincremented (but manually and with gaps). I just want to go to
one particular row (query on that index field) and then list, say, 20
On Wed, 20 Nov 2002, Bob Irwin wrote:
> Its seems far more reliable than what I am using (dividing by 60 for
> minutes, 3600 for hours and doing rounding, exploding if its not a round
> number etc).
>
> Its only for measuring short times, so Matt's suggestion should work ok.
> Ideally though, beca
- Original Message -
From: "Marco Bleeker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 19, 2002 8:34 PM
Subject: [PHP] Listing a table
> Hello, how would I go about listing a portion of a MySQL table, without an
> overall selection criterium? I have a unique index
i'll just throw my code in here while we're at it...
$seconds = 3600*5 + (60 * 10) + 45;
$hours = floor( $seconds / 3600 );
$mins = floor( ($seconds % 3600) / 60 );
$seconds = floor( ($seconds % 60) );
echo "Hours: $hours\nMins: $mins\nSeconds: $seconds\n";
-js
John W. Holmes wrote:
>>You can
Thats a toughy.. Your best bet is going to be dump the database to text,
then find an importer into MS Access.. Yes, I know you said you don't have
access, but I don't think you'll be able to create the access database
without it. Mabey you have a friend or something with it.
There are a bunch of
Have you tried this:
http://curl.haxx.se/libcurl/php/examples/
Would help if you posted some code, or errors or something. I've used curl
in several PHP applications successfully.
Snoopy is actually a really awesome implementation of curl in php:
http://sourceforge.net/projects/snoopy/
I replace
CHeck out ADODB, it makes this a pretty easy task.
http://php.weblogs.com/adodb
"Marco Bleeker" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello, how would I go about listing a portion of a MySQL table, without an
> overall selection criterium? I have a un
Ahhh - that works a treat! First time I've seen the floor command in
action.
Thanks Jonathon.
Still more lines of code than I'd like, but obviously its not that easy to
do!
Best Regards
Bob Irwin
Server Admin & Web Programmer
Planet Netcom
- Original Message -
From: "Jonathan Sharp" <[E
I'm using the following syntax, but evidently it's not correct.
HREF="action.html?action=deactivate?confirm=yes"
thanks,
Jeff
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I don't mind helping, but can you please read the archives next time?
This has been asked a lot. Anyway, the correct syntax is:
HREF="action.html?action=deactivate&confirm=yes"
Jeff Bluemel wrote:
I'm using the following syntax, but evidently it's not correct.
HREF="action.html?action=deactiv
I used this link for sendmail on linux, and it works great... you'll have a
very hard time beating it.
Jeff
"Manuel Lemos" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello,
>
> On 11/20/2002 08:18 AM, Siamak wrote:
> > hi
> > how can i send a mail by a sm
HREF="action.html?action=deactivate&confirm=yes"
Should work...
On Tue, 2002-11-19 at 20:44, Jeff Bluemel wrote:
> I'm using the following syntax, but evidently it's not correct.
>
> HREF="action.html?action=deactivate?confirm=yes"
>
> thanks,
>
> Jeff
--
Ray Hunter
email: [EMAIL PROTECTE
WOW - talk about a quick response. this solved my problem...
thanks,
Jeff
"Ray Hunter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> HREF="action.html?action=deactivate&confirm=yes"
>
> Should work...
>
>
>
> On Tue, 2002-11-19 at 20:44, Jeff Bluemel wrote:
This is the problem that I describe earlier in the thread. I can't save
%24 in the database but "$".
ie
a user send a string "abc+def$ghi", I need to get the exact string back
but not "abc+def%24ghi".
so is this a bug in PHP??
"John W. Holmes" <[EMAIL PROTECTED]>
11/19/2002 04:46 PM
Pl
Show your code. If I pass a + sign in a form, it comes out as a plus
sign in my data... I don't see your problem unless I do something like
this:
$data = "abc+def$ghi";
echo "Click Here";
Which is solved by using urlencode() before you place it in the link.
---John Holmes...
> -Original Me
Hi,
I have form that a user would input information and that info is sent to
a function, but I need to be able to return a result of this function
and is where I am having a problem.
For example:
testfunction($var1, $var2, $var3, $var4); //the form fills these
values.
echo $meat;
function te
Hi to all,
I have a problem regarding exploding string. I want to explode string
sepated by "+" sign, but i want it also the first variable in the array be
distinc in terms of collor or whatever when viewed in the page.
ex.
$no=("1+2+3");
$number=explode("+", $no);
how could i echo $no with th
echo testfunction($var1, $var2, $var3, $var4);
Or if you need to do something else with the value before echo()ing it:
$meat = testfunction($var1, $var2, $var3, $var4);
//Do something with $meat
Beauford 2002 wrote:
Hi,
I have form that a user would input information and that info is sent to
On Wednesday 20 November 2002 06:36, Baumann Reto wrote:
> Hi all
>
> Does somebody know if there is a potential problem with
> Header("Location: ");
> not working properly?
>
> I have a redirection, but it seems that on some browser, this doesn't work.
> Instead of the redirection, the sam
--- [EMAIL PROTECTED] wrote:
> After upgrade to 4.2.3, plus "+" sign has changed to space after
> POST. I have checked the mailing list but can't find any help to
> turn this off forever! is this a bug in PHP?
It is possible.
When you post a form with your browser, the browser will URL encode
all
I don't believe it has anything to do with PHP, to be honest. I've got
scripts that are several versions of PHP old that do that. However, it
makes no difference in execution of the script.
case "show roster":
{
...
}
catches submit=show+roster quite nicely.
Bob
- Original Mes
ASSISTANCE
WE ARE MEMBERS OF A SPECIAL COMMITTEE FOR BUDGET AND
PLANNING OF THE NIGERIA NATIONAL PETROLEUM CORPORATION
(NNPC)IN WEST AFRICA. THIS COMMITTEE IS PRINCIPALLY CONCERNED
WITH CONTRACT AWARDS AND APPROVAL. WITH OUR POSITIONS,
WE HAVE SUCCESSFULLY SECURED FOR OURSELVES
I think I'd rather go with the 126M USD being offered by Desmond West (see
email entitled "STRICTLY CONFIDENCIAL") instead of this measly 31.5M USD.
If anyone wants to contact the people who own ecplaza.net (for fun), here's
the info from whois:
Registrant:
EC Plaza Network Inc.
1F, Shinho Vil
Good lord they're at it again!
- Original Message -
From: "MICHAEL OSHODI" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 19, 2002 10:51 PM
Subject: [PHP] REPLY NEEDED
ASSISTANCE
WE ARE MEMBERS OF A SPECIAL COMMI
Just do ereg_replace(" ","+",$var) on the receiving end and be done with it.
- Original Message -
From: "Bob Eldred" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 19, 2002 11:24 PM
Subject: Re: [PHP] plus sign has changed to space after POST
> I don't believe it has
MY GOODNESS! Thing of what 126M would do for the open source movement!
We could run php.net on gold plated servers! Not to mention a 64 way sun
box with all the bells and whistles, and spruced up with urb3r cool
lighting kits!
or thing of all the cd's you could send to AOL for 126M!
any other ide
That's a terrible idea.
Not only does this avoid fixing the real issue (tries to fix the
symptom instead of the problem), you're telling him to change all
spaces to + signs.
Imagine a form asking for your name. You enter "Hugh Danaher" only to
see it translated into "Hugh+Danaher" on the server.
101 - 162 of 162 matches
Mail list logo