[PHP] Re: POST files with PHP

2001-11-20 Thread _lallous

Never tried that, But i'm afraid that by reading a binary file like:
join('', file('binfile'))
will brake the file!

try using fopen('binfile', 'rb') and fread() and filesize()

good luck.

Daniel Reichenbach [EMAIL PROTECTED] wrote in message
01c17111$02617a50$796010ac@danielmob">news:01c17111$02617a50$796010ac@danielmob...
 Hy,

 I'm trying to post image files to a php script with another php script.
 Don't ask why, it's a crazy project :)
 Now the file is around 28000 bytes but the post receiver only gets
 around
 300 bytes. Has anybody experienced this behaviour?

 I use the following script:

 --- snap ---
 ?
 // the receiver of file
 $remote_page = http://www.server.com/post.php;;

 // the file to upload
 $file = /var/www/test/dummy.jpg; // the file location
 $con_type = image/jpg; // the file mime type
 $content_file = join(,file($file));

 // define boundary
 srand((double)microtime()*100);
 $boundary =
 ---.substr(md5(rand(0,32000)),0,10);
 $data = --$boundary
 Content-Disposition: form-data; name=\userfile\; filename=\$file\
 Content-Type: $con_type

 $content_file.--$boundary--\r\n\r\n;
 $msg =
 POST $remote_page HTTP/1.0
 Content-Type: multipart/form-data; boundary=$boundary
 Content-Length: .strlen($data).\r\n\r\n;

 $f = fsockopen(www.server.com,80);
 fputs($f,$msg.$data);
 $result = fread($f,32000);
 fclose($f);
 print $result.\nbr;

 ?
 --- snap --





-- 
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: catching parse error.

2001-11-20 Thread _lallous

hmm...never tried it but maybe this works:

try to include the class via eval()
like: @eval(include ('$filetoinclude'););
and use the control operators w/ them?

Aaron [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 ok what I want to do if possible is

 i have file index.php

 then I include the file  x.class

 now.  index.php calls x.class

 IF x.class has a parse error just return false to index.php?
 or just return nothing,

 But dont stop the execution of index.php  Is this possible?




-- 
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: Valid Chars Function

2001-11-19 Thread _lallous

you can use regluar expressions, or single character scanning via for loop,

1)RegExp:
if (ereg('[^a-z0-9]', $name)) print 'error!';

2)For loop
for ($i=0;$istrlen($name)$;$i++)
if ($name[$i] == '@' || $name[$i]=='!' .. ) print 'error!';

Phantom [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Anyone know a good PHP function or script to scan a string for Valid
 Characters to make sure something that is not allow is not included in a
 form?

 $Name = #@@##@!#!@ would not be a valid alphabetical name, how do I
 scan for that in PHP?  Thanks.




-- 
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: Additional e-mail address in PHP script...

2001-11-19 Thread _lallous

haven't you tried to add a CC to the header?
$mailheadrs .=Cc: [EMAIL PROTECTED]\n;

Anthony Ritter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there any way to add an *additional* e-mail address - a cc - besides
the
 one that is already in the $to variable below using the following PHP
 script?

 Thanking all in advance.
 Tony Ritter
 ..


 ?
 $msg=This e-mail is being sent from www site\n;
 $msg.=Sender's name: \t$sender_name\n;
 $msg.=Sender's e-mail:\t$sender_email\n;
 $msg.=Message:\t$message\n\n;
 $to=[EMAIL PROTECTED];
 $subject=Website Feedback;
 $mailheaders=From: My website \n;
 $mailheaders.=Reply to: $sender_email\n\n;
 mail($to,$subject,$msg,$mailheaders);
 ?







-- 
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 Date Question

2001-11-19 Thread _lallous

try using the date() with the field content.

string date (string format [, int timestamp])

David Mitchell [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey Guys and Girls,

 I'm selecting a datetime value from SQL Server. In the database the data
 looks like:

 2001-11-16 18:33:56

 When I print out the results on the page I get this:

 1005958764

 This is how I'm displaying the data:

 while(!$rs-EOF)
 {
 print(trtdfont class=smallText . $dtmDate-value .
 /font/tdtd
 $rs-MoveNext();
 }

 I'm obviously missing something here
 Any suggestions would be appreciated.

 Dave


 %
 David Mitchell
 [EMAIL PROTECTED]
 www.IceRadio.ca
 %




-- 
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: Filling a text field from a different window

2001-11-16 Thread _lallous

You can do that only if you've got a reference to the window you want to
change its properties.

the reference is obtained like this:

script
var w = window.open('file.htm');
w.document.theform.theControl.theProperty = someValue here;
/script

Carlo loiudice [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi, I'm Carlo.

 Is there a way (probably javascript) to fill a text
 field (or another form object) selecting from a select
 box on a window different from that where's the text
 filed ?

 Ciao, Carlo

 __

 Abbonati a Yahoo! ADSL con Atlanet!
 Naviga su Internet ad alta velocità, e senza limiti di tempo!
 Per saperne di più vai alla pagina http://adsl.yahoo.it




-- 
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] Copying into another table

2001-11-16 Thread _lallous

Hello!

Is there is anyway to copy from a table to another but by applying a filter?

Example:

SELECT * FROM table1 WHERE (condition)
INSERT INTO table2 (the results of the last query)



-- 
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: problem with xgettext and php with javascript file

2001-11-16 Thread _lallous

this code seem incomplete:
 window.opener.document.celkem.cena_celkem.value = ? echo _(nìjaký
 blábol); ?
 }
 here's a fix:
 function zmen_cenu() {
 window.opener.document.celkem.cena_celkem.value = ? echo _(nìjaký
blábol); ?;
}

Pavel NováK [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello all!

 I want to use gettext for multilanguage webs, so I'm pleasing you to help
 me.

 When I use this: xgettext  --keyword=_ file.php
 on this file:
 ---
 script language=JavaScript
 !--
 function zmen_cenu() {
 window.opener.document.celkem.cena_celkem.value = ? echo _(nìjaký
 blábol); ?
 }
 // --
 /script
 ---

 I get this message: file.php: 4: warning: unterminated string literal



 but when I use the same on this file:
 ---
 ?$str = _(nìjaký blábol);?
 script language=JavaScript
 !--
 function zmen_cenu() {
 window.opener.document.celkem.cena_celkem.value = ?= $str?;
 }
 // --
 /script
 ---

 gettext makes this good.


 Do you know where is a problem?
 My gettext version is 0.10.35


 Thanks,
  Pavel Novák







-- 
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: Parse POST-Data myself

2001-11-16 Thread _lallous

take the query string as is:
$QUERY_STRING
in this case:
$qstring = myfield1=myfield2=aaacccmyfield1=;
and then pass it on as is again to whoever you want!

or you can parse it like:
$qstrings = split('', $qstring);
then split each pair:
$pairN = split('=', $qstrings[$i]);

etc

Stefan [EMAIL PROTECTED] wrote in message
002601c16eaf$cb057830$3c01a8c0@quasimodo">news:002601c16eaf$cb057830$3c01a8c0@quasimodo...
Hi

I have following problem:
I get a form with some fields having the same name.
PHP solves this problem by appending [] to the form-field-names which causes
the creation of arrays.
My problem now is, that I have to pass those variables further to another
script (not PHP) in exactly that order I receive them from the form.
But when I have a form (schematically) like this:
-input type=text name=myfield1
-input type=text name=myfield2
-input type=text name=myfield1
-input type=text name=myfield2
-input type=text name=myfield1
-input type=text name=myfield2

Then I get in PHP all myfield1 in 1 variable (the array myfield1) and all
myfield2 in 1 other variable - order is irreversibly destroyed.
Give the fields numbers is not a solution (for complexity reasons).

So my ultima ratio is to parse the post-data myself - but how can I do this?
I have not found any indices for a variable containing post-data :-(

If someone has another approach to a solution: I will have both ears open
for it :)

Thanks in advance
Stefan Rusterholz, [EMAIL PROTECTED]
--
interaktion gmbh
Stefan Rusterholz
Zürichbergstrasse 17
8032 Zürich
--
T. +41 1 253 19 55
F. +41 1 253 19 56
W3 www.interaktion.ch
--




-- 
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: Need help with reading values from a form

2001-11-16 Thread _lallous

name the checkbox as:
input type='checkbox' value='?=$field['id']?' name='selectedplayers'

where ID is used to identify this current field!

then read in the posted page as:
?
while (list(, $selected) = each($selectedplayers))
{
  // $selected  holds the ID of the field that was previously selected
  // do whatever here!
}
?

P. Roescher [EMAIL PROTECTED] wrote in message
01c16eab$65226360$015a@cc48693a">news:01c16eab$65226360$015a@cc48693a...
 The script I have:
 ?
  $query = SELECT * FROM members ORDER BY MemberName ASC;
  $player = MYSQL_QUERY($query);
  $Aantal_play = MYSQL_NUM_ROWS($player);
  $x=0;
  while ($x  $Aantal_play) :
$name = mysql_result($player,$x,MemberName);$name = $name +
 NAME;
 ?
 tr
   td width=25% height=18
 font face=Verdana size=2 color=#FF? print $name;
 ?/font
   /td
   td width=75% height=18
 input type=checkbox name=?print $name? value=ON
   /td
 /tr
 ?
   $x++;
   endwhile;
 ?
 The Problem I have:
 How can i read all checkboxes?!?





-- 
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: Info on another page

2001-11-16 Thread _lallous

you can fopen() remote files!
$fp = fopen(www.site.com/infodir/exchange.txt,r);
$rates = fread($fp, ...);
fclose($fp);

Mindhunter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 Lets say I want to get the current exchangerate from another page on the
web
 and use it in calculations on my own page.  How do I retrieve info from
 another site once someone access my page?

 Tx
 MH





-- 
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: I suck at regular expressions!

2001-11-15 Thread _lallous

try that!
?
$mem='
!doctype html public -//W3C//DTD HTML 4.0 Transitional//EN
html
head
title New Document /title
meta name=Author content=
meta name=Keywords content=
meta name=Description content=
/head

body

/body
/html
';


if (preg_match('/title(.+?)\/title/is', $mem, $matches))
{
  echo title is:$matches[1];
}
?

Richard S. Crawford [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
I am trying to get the title of an html file... you know, the string
between the  title  and  /title  tags...

Here is the function I've got so far:

function fileTitle($fileName) {
 $myFile = fopen($fileName, r);
 $myText=;
 while (!feof($myFile)) {
 $myText .= fgets($myFile,255);
 }
 fclose($myFile);
 if (eregi(TITLE(.+)/TITLE,$myText,$theTitle)) return
$theTitle[0];
 else return (No Title);
}

The trouble is, it always returns (No Title), regardless of whether the
file has a title defined in the header or not.

I suspect I'm doing something fundamentally wrong.  Can anyone set me
straight?



Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
It is only with the heart that we see rightly; what is essential is
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!




-- 
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: Serious problem with Cookies..

2001-11-15 Thread _lallous

you must set the cookie's expiry time!

of-the manual:
setcookie (TestCookie, Test Value);
setcookie (TestCookie, $value,time()+3600);  /* expire in 1 hour */
setcookie (TestCookie, $value,time()+3600, /~rasmus/, .utoronto.ca,
1);

Phpgalaxy.Com [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I started an affiliate program to sell my scripts, and it uses cookies
 for tracking..  I didnt know it at the time, but as soon as the web
 browser's closed, the cookie info is gone. g! I need it to stay
 there *permanently*! =) Here's the code I have no for both setting and
 retrieving..

 retrieving: $refid = $HTTP_COOKIE_VARS[refid];
 setting: setcookie (refid, $id);

 Am I just missing something I didnt see on php.net? =)


 --
 From PHPGalaxy.com, earn up to $10 per order selling our PHP Scripts
 and Software on your Site. http://www.phpgalaxy.com/aff/

 Also, get a fast free POP3 email account, you @php.la at
 http://www.phpgalaxy.com/search/





-- 
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: Serious problem with Cookies..

2001-11-15 Thread _lallous

Yes, I guess you can't make it foreever but you can give it a higher expiry
date.

Phpgalaxy.Com [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 well yeah, thats always true..but this's at least as good as it gets =)
ya suppose
 there's any limit on how many years I can set it for? hell, I'll just set
it for 10
 years and that'll be good enough =)


 Magnus wrote:

  Den 01-11-15 13.20, skrev PHPGalaxy.com [EMAIL PROTECTED]:
 
   yeah I saw that bit on there, but I was led to believe tha by leaving
it out,
   it would make the cookie permanent...I see thats not true =)  so what
would I
   do to make this permanent? or would I just set it for the highest
time-limit
   possible? =)
 
  If you set it like this:
  ?
  $hour = 3600;   // One hour
  $day = $hour * 24;  // One day
  $year = $day * 365; // One year
  $year = $year * 2;  // 2 years
  setcookie (TestCookie, $value,time()+$year);  // Expire in 1 year
  ?
 
  There is not a good way to set a permanent cookie, the user can always
  delete them if he wants to.
 
  Thanks.
  /Magnus Hammar
 
  --
  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]

 --
 From PHPGalaxy.com, earn up to $10 per order selling our PHP Scripts
 and Software on your Site. http://www.phpgalaxy.com/aff/

 Also, get a fast free POP3 email account, you @php.la at
 http://www.phpgalaxy.com/search/





-- 
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: Time out for file()?

2001-11-14 Thread _lallous

from the manual
?php
$fp = fsockopen(www.php.net, 80);
if(!$fp) {
echo Unable to open\n;
} else {
fputs($fp,GET / HTTP/1.0\n\n);
$start = time();
socket_set_timeout($fp, 2);
$res = fread($fp, 2000);
//var_dump(socket_get_status($fp));
fclose($fp);
print $res;
}
?
this will grab a file too using the socket functions, the
socket_set_timeout()'s first param is expected to be a socket handle.

Jean-Arthur Silve [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi !

I use the file function for accessing to pages on another server.

It works perfectly.

But if the server does not respond or is too long to send datas, the file
function wait too long..

Is there a way to tune the time out ?? I would like that id the server does
not respond, the function return in few seconds only.

I thought to a solution using :

set_time_limit(2);
register_shutdown_function(func);
file(myurl);
set_time_limit(30);
func();

In this example if the file function takes more than 2 seconds, then func()
would be called. If the file function does not time out, then then func is
called too...

But may be there is a cleanest way to do this (I checked the manual,
somethink like socket_set_timeout), in the way that if the time function
timed out then the script continues normally, returning an error:

tuning the time out(2);
$f=file(myurl);
if ($f==false)
 // Timed out
else
 // ok


Thank you !

jean-arthur

---

EuroVox
4, place Félix Eboue
75583 Paris Cedex 12
Tel : 01 44 67 05 05
Fax : 01 44 67 05 19
Web : http://www.eurovox.fr





-- 
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: Any easy way of finding yesterday...?

2001-11-13 Thread _lallous

strtotime('yesterday') should work!

Harry Lau [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 It is easy to use the function getDate() to obtain the date of today.
 But instead of writing plenty of conditions,
 is there any easy way to get the date of yesterday?
 Thank you.





-- 
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: matches problem (preg_match)

2001-11-13 Thread _lallous

?
  $str=eins zwei drei vier fünf sechs sieben acht neun;
  if (preg_match_all(/\w+/, $str, $matches))
  {
$words = $matches[0];
var_dump($words);
  }
?
viele Grüße,
lallous!

Ewald Schoeller [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hello
 we want to save every word of a text in an array field.
 we want to solve the problem without split.

 Here's our code:

 $str=eins zwei drei vier fünf sechs;
 preg_match('(\w+)(\s+\w+)*',$str,$Wort);

 $n=count($Wort);
 for($i=0;$i$n;$i++){echo $i: $Wort[$i]br;}

 The result is:
 0: eins zwei drei vier fünf sechs
 1: eins
 2: sechs

 it only saves the first and the last word.
 why doesn't it save every single word in one array field?
 can anybody give us the (corrected) code to achieve the desired result?

 thanks for every answer !!

 Bruno and Ewald





-- 
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: Function Call Line Number

2001-11-13 Thread _lallous

I guess that is not possible with PHP yet.

Jason G. [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 Does anyone know of a way, that from within a function, you can determine
 what line number and file the function was called on?

 I did try:
 function myfunc($lineno = __LINE__)
 {
 echo $lineno;
 }
 but this just outputted the very line that __LINE__ resides on.

 This would be very helpful in displaying sensible error messages, like the
 native php functions do.

 Thanks,

 -Jason Garber
 IonZoft.com




-- 
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: Unix timestamp ?

2001-11-12 Thread _lallous

timestamp is an integer.
you can convert it to hex string via sprintf(%x, timestamp) and store it.
so if timestamp is a 32bit integer than it's hexadecimal representation will
take 8 characters.

De Necker Henri [EMAIL PROTECTED] wrote in message
3A8ED7A62794D311AA7700508B6164EC08DCA384@SCPTS01">news:3A8ED7A62794D311AA7700508B6164EC08DCA384@SCPTS01...
 What is the max. size of a timestamp in vanchar value ?
 I have seen it varies between 9  10.Will it be bigger than 10 or not ?



-- 
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: mail() w/ mailing lists

2001-11-12 Thread _lallous

sending one by one will take ages no?

Phpgalaxy.Com [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I just finished making a bulk emailer script with the mail() function. I
would probably recommend doing a loop,
 sending one email at a time. Seems that way you're not putting too much
pressure on it at one time (if that makes
 any sense). If you can find a decently-written smtp-class that uses the
socket directly, that would be much better.
 Then, you're not limit to sending to one mail server, and there's greater
flexibility in the code; room to edit/add
 code when needed, and you have the opportunity to log specific error
messages if ya need to. The only problem is
 finding an SMTP class that'll work without too much editing, unless you
have the socket knowledge to write your own.
 Whether or not the socket commands in PHP work well in Windows or not,
I've not a clue. I know there are some
 Windows issues with the mail() command as well, and a few other PHP
functions that just don't work under Windows. =)

 --
 From PHPGalaxy.com, earn up to $10 per order selling our PHP Scripts
 and Software on your Site. http://www.phpgalaxy.com/aff/

 Also, get a fast free POP3 email account, you @php.la at
 http://www.phpgalaxy.com/search/





-- 
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: Stripping IMG tags

2001-11-11 Thread _lallous

$string = preg_replace('/img[^]*/si', '', $string);

Richard S. Crawford [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...
All I need to do is strip out IMG tags from strings; I don't want to strip
out all of the HTML, just the IMG tags, so the strip_tags() function won't
be adequate.

I've tried

 eregi_replace(img[^$],,$string);

but that doesn't seem to do any good (though the regexp works fine in Perl).

Any thoughts?



Sliante,
Richard S. Crawford

http://www.mossroot.com
mailto:[EMAIL PROTECTED]
AIM: Buffalo2K   ICQ: 11646404  Y!: rscrawford
It is only with the heart that we see rightly; what is essential is
invisible to the eye.  --Antoine de Saint Exupéry

Push the button, Max!




-- 
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] mail() w/ mailing lists

2001-11-11 Thread _lallous

Hello,

Is is advisable that I mail lots of users from a database via one call to
mail() ?

Or else, how do you think I should split the list and send my mails?

Is there is a way to tell if the mail was returned because the email address
was invalid?


Thanks.



-- 
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: DB wrapper

2001-10-30 Thread _lallous

try http://phpclasses.upperdesign.com


Alberto [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Any1 knows about a good class for DB abstraction? I need some scripts to
 work with mysql/pgsql.

 Thnx





-- 
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: PHP changing my JavaScript??

2001-10-29 Thread _lallous

it happened to me when i enter the page for the very first time and I use
session_start()

I suggest to make the page reload itself w/ a parameter so that the first
pass to the site will screw the javascript and then automatically 2nd pass
(which is self called) is okay.


Moloko [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All,
 got a strange problem with a PHP include file that contains all my
 JavaScript functions. This file is included on every page in my site and
 contains some image swap behavious amongst other things. The first time I
go
 into the site, however, I get all sorts of JavaScript errors which I have
 traced to the fact that lots of quotes are being dumped into the
JavaScript
 for some reason, screwing up the syntax. As soon as I hit refresh, the
 quotes disappear and the page loads fine anyone got any ideas as to
why
 this is happening??

 example of screwed up script:
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
 var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
 ia.length; i++)

 this is how it should look:
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
 var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0;
ia.length;
 i++)


 any ideas at all much appreciated!


 --
 Moloko
 'When the going gets weird, the weird turn pro' - Dr Gonzo
 GCM/CS/IT/MC d-- S++:- a-- C++ U--- P+ L !E W+++$ N+ K+ w+++$ M+ PS+++ PE-
 PGP- t+ 5- X-- R* tv++ b+++ DI D G e h-- r++ y++





-- 
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: Array's

2001-10-28 Thread _lallous

 $b=array($surname,$init),  // does it work
like
it does work like that, but you're creating an array of one item which is a
string holding to values comma seperated.
you can do this too:
 $b=array($surname,$init),  // does it work like
w/o the quotes.
and also no need to put quotes around the $b or $a.
and when you're storing one element no need to put it in an array like you
did for this:
 = array($a=array($co_id),
do directly:
array($a = $co_id, ...

 I have 4 fields that i want to to put in an array and about 3000 records.
 How can i list the fields in an array and retrive the values out of the
 array

$values = array();
$i =0;
while (getting the rows)
{
  list($id, $surname, $ba) = $row;
  $values[$i]['surname'] = $surname;
  $values[$i]['id'] = $id;
  $values[$i]['ba'] = $ba;
  $i++;
}

retrieve any element as:
$values[INDEX HERE]['surname'] for example.


De Necker Henri [EMAIL PROTECTED] wrote in message
3A8ED7A62794D311AA7700508B6164EC08DCA35E@SCPTS01">news:3A8ED7A62794D311AA7700508B6164EC08DCA35E@SCPTS01...
 Please help!

 Im have been trying to get a multi-dimentional array for so time now and
 dont seems to get a right!

 I have the following :

 while($row=db_range()){
   list($co_id,$surname,$init,$ba) = $row;

   $acid[$i] = array($a=array($co_id),
 $b=array($surname,$init),  // does it work
like
 this ???
 $c=array($ba)) ;

   $i++;
 }//end while 1

 I have 4 fields that i want to to put in an array and about 3000 records.
 How can i list the fields in an array and retrive the values out of the
 array

 PLS help!





-- 
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: php.ini executable

2001-10-28 Thread _lallous

go for it...even if someone did a visual tool for that.

my question goes, has anyone made a *nix program to configure php.ini ? ;)
before i 

Jtjohnston [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Has anyone made a Windows executable to configure the php.ini? ... just
 asking, before I find myself doing it myself.





-- 
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: Random

2001-10-28 Thread _lallous

$ceiling is too big.

try to do this and see:
echo getrandmax();
you might get 32767 as an output!

therefore, $ceiling must be = getrandmax();

try to scale down your floor and ceiling,
ie:
$max = $ceiling - $floor;
$random = rand(0, $max) + $floor;

Andrew Duck [EMAIL PROTECTED] wrote in message
005f01c15ea6$30375800$017f@localhost">news:005f01c15ea6$30375800$017f@localhost...
#Create Random number
  $floor = 10;
  $ceiling = 99;
  srand((double)microtime()*100);
  $random = rand($floor, $ceiling);

Warning: rand(): Invalid range: 10..99 in c:\my
documents\ezone\testing\signup2.php on line 49

Can someone please tell me where i went wonr gin this coding.

Thanks




-- 
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: Array

2001-10-28 Thread _lallous

   $values[$i]['id'] = $co_id;
you didn't initialize the $i did you?
should put $i =0; before the while loop.

   echo $idbr  ;   # Doesnt wanna work
what is $id ? i don't see it defined in your code, i see $cid instead.

   list($a,$b,$c,$d) = $values[$i];
sure won't work, try:
   list($a,$b,$c,$d) = each($values[$i]);


De Necker Henri [EMAIL PROTECTED] wrote in message
3A8ED7A62794D311AA7700508B6164EC08DCA35F@SCPTS01">news:3A8ED7A62794D311AA7700508B6164EC08DCA35F@SCPTS01...
 Now i did the following :
 My output is only null or blank values!,but my data is there!

  while($row=db_range()){
   list($co_id,$surname,$init,$ba) = $row;
   echo $co_id $surnamebr;  # This works perfect!
   $values[$i]['id'] = $co_id;
   $values[$i]['surname'] = $surname;
   $values[$i]['init'] = $init;
   $values[$i]['ba'] = $ba;
   $cid = $values[$i]['id'];
   echo $idbr  ;   # Doesnt wanna work
   list($a,$b,$c,$d) = $values[$i];
   echo $a ; # Doesnt wanna work
   $i++;
 }//end while 1



-- 
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: POSTing values to file

2001-10-28 Thread _lallous

see http://www.php.net/fopen

Michiel Van Heusden [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 anybody help me please...

 how can I open a file from php (something like require, but without
closing
 the php-file)
 and then send some string to that file with POST
 is thispossible?/?





-- 
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] String breaking up

2001-10-26 Thread _lallous

 $string = hey there!;

$out = '';
 for ($i=0; $icount($string); $i++) {
   $out .= strtoupper($string[$i]) . \n; // or br if output is to
browser
 }
echo $out;

Richard Baskett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Strings are arrays, so you can print out a string by doing something like
 this:

 $string = hey there!;

 for ($i=0; $icount($string); $i++) {
   echo strtoupper($string[$i]);
 }

 That's about all there is to it! :)  Use the strtoupper() function if you
 mean to have everything uppercase like in your example.

 Rick

  I was looking to take a string like Dan and return it like
  D
  A
  N
 
  is it the str function that does that
 
  =
  Dan McCullough
  ---
  Theres no such thing as a problem unless the servers are on fire!
  h: 603.444.9808
  w: McCullough Family
  w: At Work
 
  __
  Do You Yahoo!?
  Make a great connection at Yahoo! Personals.
  http://personals.yahoo.com
 
  --
  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 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: tail a file

2001-10-26 Thread _lallous

to tail a file use the + flag when opening that log file,
and write a simple PHP script that spits that file to you, ie:
showlog.php
?
readfile('logfile.txt');
?
Yamin Prabudy [EMAIL PROTECTED] wrote in message
003901c15de4$82f0cb70$fe2796ca@dusak">news:003901c15de4$82f0cb70$fe2796ca@dusak...
 Hi there I need help here
 I got a file say it's a logs file and keep update ever changes

 I need to tail this files and pharse it into web, so I can see this the
 update without login into server (jst thru web browser ) how can i do this

 Thanks for Help




-- 
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] talking directly w/ MySql

2001-10-25 Thread _lallous

SELECT 1+1 doesn't really need a connection...
or any other statments that doesn't address a table or database,
SELECT SUBSTRING('test', 1, 2);

etc etc..

I guess it is not possible though...

Kodrik [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  how can i issue such statments w/o opening a connection?

 I you don't open a connection, how is mysql supposed to know which db you
are
 talking to?



-- 
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: Loading message

2001-10-25 Thread _lallous

the page won't ever showup unless the webserver finishes processing the PHP
file, therefore the Loading ... will appear while the page is waiting for
its component to finish loading (images, javascripts, flash files, )

therefore what you're asking for has a javascript solution:

1)make a div with width and height about 1000 and absolute position w/
z-index=1000
2)add a body.onload event so that when the pages loads you hide that layer.
3)that layer can hold any text or tags as you want like: Please wait

this division's code:
div id='loadinglayer'
style='left:0;top:0;width:1000;height:1000;position:absolute;z-index:1000;ba
ckground:black'Please wait/div

body onload='hidelayer()'
/body

script
function hidelayer()
{
  if(document.all)
document.all['loadinglayer'].style.visibility=hidden;
  else
document.layers['loadinglayer'].visibility=hide;
}
/script

hope that helps
Daniel alsén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 is there a easy way in php to display text like Loading... while
elements
 on a page is being loaded from the server?

 Regards
 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   |  #




-- 
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: Loading message

2001-10-25 Thread _lallous

I agree with you Derek,
It also depends on the webserver and your connection speed...

perhaps the pages is already parsed and processed but your connection is
slow somehow and you're getting the page partially as if it is beeing show
while it is beeing processed/parsed.

Derek Mailer [EMAIL PROTECTED] wrote in message
010e01c15d43$0a319c60$5c00010a@NTSERVDOM">news:010e01c15d43$0a319c60$5c00010a@NTSERVDOM...
 I suspect that PHP does all of it's work and, only when complete, will it
 send the generated html to the client.

 No matter what you try and do there's no way you can output the progress
of
 your script to the browser while it is still being parsed.

 I could be wrong, but this is my understanding of it.

 Is your script really taking that long to be parsed that you need a
loading
 progress bar or is the html (including graphics etc) just very big?

 Anyway,

 Hope this helps
 Derek

 - Original Message -
 From: Daniel Alsén [EMAIL PROTECTED]
 To: php [EMAIL PROTECTED]; _lallous
 [EMAIL PROTECTED]
 Sent: Thursday, October 25, 2001 11:27 AM
 Subject: RE: [PHP] Re: Loading message


  I will try experimenting with that.
 
  But my situation is:
 
  A page with multiple php file includes. The page loads on to the
includes,
  loads them and continues to load the includes below.
  I want to display some sort of text while the include still isn´t
loaded.
 
  Likewise i would like to display some sort of loading message while a
  database search is active.
 
  - Daniel
 
   -Original Message-
   From: _lallous [mailto:[EMAIL PROTECTED]]
   Sent: den 25 oktober 2001 13:14
   To: [EMAIL PROTECTED]
   Subject: [PHP] Re: Loading message
  
  
   the page won't ever showup unless the webserver finishes
   processing the PHP
   file, therefore the Loading ... will appear while the page is
   waiting for
   its component to finish loading (images, javascripts, flash files,
)
  
   therefore what you're asking for has a javascript solution:
  
   1)make a div with width and height about 1000 and absolute position
w/
   z-index=1000
   2)add a body.onload event so that when the pages loads you hide
   that layer.
   3)that layer can hold any text or tags as you want like: Please
 wait
  
   this division's code:
   div id='loadinglayer'
   style='left:0;top:0;width:1000;height:1000;position:absolute;z-ind
  ex:1000;ba
   ckground:black'Please wait/div
  
   body onload='hidelayer()'
   /body
  
   script
   function hidelayer()
   {
 if(document.all)
   document.all['loadinglayer'].style.visibility=hidden;
 else
   document.layers['loadinglayer'].visibility=hide;
   }
   /script
  
   hope that helps
   Daniel alsén [EMAIL PROTECTED] wrote in message
   [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,
   
is there a easy way in php to display text like Loading... while
   elements
on a page is being loaded from the server?
   
Regards
# Daniel Alsén| www.mindbash.com #
# [EMAIL PROTECTED]  | +46 704 86 14 92 #
# ICQ: 63006462   |  #
   
  
  
  
   --
   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 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]
 





**
 This e-mail (and any attachment) is intended only for the attention
 of the addressee(s). Its unauthorised use, disclosure, storage
 or copying is not permitted. If you are not the intended recipient,
 please destroy all copies and inform the sender by return e-mail.
 This e-mail (whether you are the sender or the recipient) may be
 monitored, recorded and retained by Business Information
 Publications Limited (BiP). E-mail monitoring/ blocking software
 may be used, and e-mail content may be read at any time.You
 have a responsibility to ensure laws are not broken when composing
 or forwarding e-mails and their contents.


**




-- 
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: how can I do this !!

2001-10-25 Thread _lallous

?
  $mem = '
--
bla bla bla

[phpcode]
?
echo \'hello word\';
??
[/phpcode]

bla bla bla
---
'; //'

  $re = '/\[phpcode\](.+?)\[\/phpcode\]/is';
  if (preg_match($re, $mem, $matches))
  {
ob_start();
highlight_string($matches[1]);
$html = ob_get_contents();
ob_end_clean();

$out = preg_replace($re, $html, $mem);
echo $out;
  }
?

this should do!
Alawi [EMAIL PROTECTED] wrote in message
008f01c15da2$ddf4fd30$d43f47d4@php">news:008f01c15da2$ddf4fd30$d43f47d4@php...
i have txt file have this words

--
bla bla bla

[phpcode]
?
echo 'hello word';
?
[/phpcode]

bla bla bla
---

now I want to convert the code that are between [phpcode] and [/phpcode] to
colorized code ..
How I can do that




-- 
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: regardnig receiving mails

2001-10-25 Thread _lallous

there are lots of classes on http://phpclasses.upperdesign.com
just search there.

Nigam Chheda [EMAIL PROTECTED] wrote in message
006e01c15d43$63351620$26a8a8c0@bravo">news:006e01c15d43$63351620$26a8a8c0@bravo...

 Hi
 For sending mail php has a function mail()
 But how to receive mails(i.ie. POP3 access)
 can anyone send some sample code
 pl reply me mail at following id
 [EMAIL PROTECTED]


 Nigam




-- 
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: intermediate pre-parsed or compiled PHP files possible?

2001-10-25 Thread _lallous

did you check www.zend.com and their caching/optimizing products?


Thomas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello there,
 I was wondering if there was any intermediate format I could compile my
 PHP scripts to in order to gain speed.

 For example, having the format/validity of the scripts already
 formatted, function locations ready in an index, PHP function calls, etc
 etc. Sortof like obj files for C++.

 Is this available? If not, what is the easiest way to link in a few of
 my own fully compiled functions to be used from PHP?

 Thanks to everyone who has any clue what I am talking about :),
 Thomas





-- 
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: argument variable gets lost in function

2001-10-25 Thread _lallous

hmm...weird! is that the code?
if you show us your real code...maybe you're missing a small detail...

Spunk S. Spunk III [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm assigning a variable a value from an associative array.
 $variable = $array[key][value];

 Then passing the $variable to a function.
 SomeFunction($variable)

 The variable exists (can be printed) until a built-in function (within the
 original function) is called.
 echo $variable; //prints out fine
 $variable2 = ereg_replace( , _, $variable);
 echo $variable; //prints out NOTHING...

 Why is this and how can I get around it?

 Thanks,
 Spunk





-- 
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] talking directly w/ MySql

2001-10-24 Thread _lallous

I think that the MySql's API allow to many queries to be executed w/o having
an open connection, example:
SELECT 1+1;

how can i issue such statments w/o opening a connection?

like SELECT NOW() ..


whenever I first run mysql_query() it tries to connect w/ default connection
settings.



-- 
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: Detect mySql Install

2001-10-24 Thread _lallous

$mysql_installed = function_exists('mysql_query');
as for the version, you can then do:
$r = mysql_query(SELECT VERSION());
$r = mysql_fetch_array($r);
$ver = $r[0];


Chris [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is there a way to detect, using PHP, if mySql is installed on a server?
 Can a version # be determined also? I know this can be done using
 phpinfo, but I don't want to use that approach.

 Thanks,
 Chris




-- 
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: running scripts onunload

2001-10-24 Thread _lallous

I'm afraid there is no way to do so!


Impex Holidays Maldives / Hasan [EMAIL PROTECTED] wrote in message
0beb01c15bcb$f0becf50$c6c801ca@hasan">news:0beb01c15bcb$f0becf50$c6c801ca@hasan...
 Hi everyone,

 I can use javascripts onunload to run PHP file with a new window.
 Is there anyway i can run PHP script file on ONUNLOAD with out opening a
new window ( in the back ground).

 Any one help will be greatly appreciated.

 Best regards,
 Hasan




-- 
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] OnUNload Scripts

2001-10-24 Thread _lallous

This can be done...but what if the user closes the whole browser?
the frame won't work cause it will also be closed i guess!

The popup window will assure that in all cases it will be poped up.

Kodrik [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  You could open a new window, give focus to the current window, and in
the
  new window, have it close itself after it's finished processing.

 An invisible frame is the easiest:
 frame rows=100%, *
  framset name='main' src='src.php'
  frameset name='invisibleframe' src='background.php'
 /frameset

 then javascript can send orders to php through the invisible frame.

 Flash can also talk to php without reloading which allows for some cool
stuff.
 Finally, Java is the hardest solution but still a solution




  -Original Message-
 
  From: Impex Holidays Maldives / Hasan [mailto:[EMAIL PROTECTED]]
 
  Sent: Wednesday, October 24, 2001 4:16 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP] OnUNload Scripts
  
  
  Hi everyone,
  
  I can use javascripts onunload to run PHP file with a new window.
  Is there anyway i can run PHP script file on ONUNLOAD with out opening
a
   new window ( in the back ground).
  
  Any one's help will be greatly appreciated.
  
  Best regards,
  Hasan
  
  
  
  --
  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 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: I NEED HELP WITH PWS AND W98

2001-10-24 Thread _lallous

1)Install PHP w/ the installer or manually
2)In PWS add a new virtual directory and give it Script+Execute rights.
3)Create a simple script there (where the virtual directory points) and
write ?phpinfo();? just to see if everything is fine.

you may want to try to ask in php.install group too.

Nicolas Llamosas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 My name is Nicolás Llamosas, I`m from Río Cuarto, Argentina and sorry for
my
 poor english. I need informacion about how configure Personal Web Server
 under W98 to use with PHP 3.0 I downloaded the BIN code of PHP version
 3.0.17 for W32 and I followed the instructions on the manual #8220;PHP
 Manual#8221; (I downloaded it in php.net page, and I configured the
PHP.ini
 file, etc, etc.), but I don#8217;t know if I need to compile under C or
 Visual C, or what I have to do after that to start to use PHP under w98
and
 PWS. Some detailed informacion will very important for me.

 Thanks.

 Nicolas Llamosas #8211; [EMAIL PROTECTED]


 _
 Descargue GRATUITAMENTE MSN Explorer en http://explorer.msn.es/intl.asp




-- 
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: MessageBox in PHP?

2001-10-22 Thread _lallous

you can  use JavaScript to do that...
script
alert('your message goes here');
/script

embed this in your HTML source code.

it is not possible to do so in PHP since it is server side.

Silvia Mahiques [EMAIL PROTECTED] wrote in message
005101c15aec$9ccac280$1a9cd29b@tscpc6">news:005101c15aec$9ccac280$1a9cd29b@tscpc6...
Hi!,
How can I make a messagebox in PHP to print errors or warning (such as in VB
or VC++)?. Is it possible?

Silvia Mahiques




-- 
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: Thick arc with PHP

2001-10-22 Thread _lallous

try this:

ImageSetThickness()

Ville Mattila [EMAIL PROTECTED] wrote in message
009801c15a31$e7f56140$0100a8c0@ville">news:009801c15a31$e7f56140$0100a8c0@ville...
Hi there,

How it would be possible to draw a thich arc with PHP  GD?  You can see a
picture here about thing I mean:
http://www.pilotmedia.fi/xfiles/circle.jpg

ImageArc -function is just what I need, but it makes all arcs only 1 pixel
width.

Any ideas?

Cheers,
- Ville






-- 
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: DATE FORMAT ISSUES

2001-10-22 Thread _lallous

maybe you have in your database a DATE field instead of DATETIME field?

Beeman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have inserted the date into MySQL using now() in the query. However,
when
 I retrieve the using MySQL_Date_Format in the query the time is always
 wrong. on the other hand, if I format the date using Date() in PHP it
always
 makes the date DEC 31 1969 at 700PM. Please Help





-- 
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: kindly help adding days on a date

2001-10-19 Thread _lallous

you can use it like that:

see the mysql's date_add() usage:

SELECT DATE_ADD(NOW(), INTERVAL 5 DAY)
or 5 YEAR or n MONTH


Krushna Kumar R [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi,

I have 2 fields on a table as shown below

1. period   int- we enter no of days as number/integer
2. lastdatedate  - here i'll have to add period to todays(current) date
and store in the table

i used dateadd it was working on mysql prompt, but when i used it with PHP,
it doesnt work

Any help would be appreciated

Regards
Krushna Kumar




-- 
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: How can I simulate the login process?

2001-10-05 Thread _lallous

what if they were session variables...how can i fake that out?

can you plz give me an example on how to make a header with cookies before
requesting a page?

Richard Lynch [EMAIL PROTECTED] wrote in message
046401c14d62$917ce620$c801a8c0@Lynchux100">news:046401c14d62$917ce620$c801a8c0@Lynchux100...
 You have to http://php.net/fopen (or http://php.net/curl for SSL page) the
 login page, get the headers, snarf out the cookies or whatever, generate
the
 appropriate cookie headers to send back on the next page (and every page
 thereafter).

 Your goal is to fake out the web server into thinking you're really a
 web-browser.

 --
 WARNING [EMAIL PROTECTED] address is an endangered species -- Use
 [EMAIL PROTECTED]
 Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
 Volunteer a little time: http://chatmusic.com/volunteer.htm
 - Original Message -
 From: _lallous [EMAIL PROTECTED]
 Newsgroups: php.general
 To: [EMAIL PROTECTED]
 Sent: Thursday, October 04, 2001 4:48 AM
 Subject: How can I simulate the login process?


  I want to write a script that simulates the login process and logs on
and
  grabs some pages (that can only be viewed when logged in) and the logs
  out...
  how can i do that?
 
  consider the authentication system is done via session variables
method...
 
  any ideas would help.
 
 




-- 
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] Downloading Images

2001-10-05 Thread _lallous

I suggest you call: readfile() instead of include() at the end of your
script!

David Otton [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, 4 Oct 2001 07:32:17 -0700 (PDT), you wrote:

 I have added a download button to a web-site that
 enables users to download images to their local
 drives. (I'm using a button as I want to wrap some
 logic round this function) I have the following
 (simplified code )that will be called from the
 web-site when the button is clicked.
 
 header(Content-type: application/octet-stream);
 header( Content-Disposition: attachment;
 filename=01lg.jpg);
 $filename= c:/program files/apache
 group/apache/kidz/gallery/download/01lg.jpg;
  include($filename);
 
 The result is the SaveAs box appears and the image is
 being downloaded with the correct name however when I
 try and re-open the image i get the message invalid
 header. Does anyone have any ideas?

 What does the downloaded file look like internally? Open it in a hex
 editor (or even just Notepad). Check the file-lengths of the original
 and copy. My guess is you're saving an error message with a .jpeg
 extension.

 djo




-- 
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] ereg checking if its only numbers

2001-10-05 Thread _lallous

That's not regexps Rasmus! :)
I always see you referring us the the manual! sometimes you refer to a
function i never say in my life! ;)

Rasmus Lerdorf [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 http://php.net/is_numeric

 On Fri, 5 Oct 2001, Chris Aitken wrote:

 
  Ive been playing around with ereg for about half an hour and having no
joy
  because I dont really understand the medhod behind it and how it all
works.
  But what im trying to do is check to see if a 9 digit string is all
numbers
  and nothing else
 
  $string1 = 123456789
  $string2 = 123456abc
 
 
  how would I check either string with an IF statement and make it
continue
  on string 1 (ie, all numbers) and error on string 2 (not all numbers).
 
 
  Any suggestions ?
 
 
 
  Thanks
 
 
  Chris
 
  --
   Chris Aitken - Administration/Database Designer - IDEAL Internet
email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628
8890
__-__
  It is said that if you line up all the cars in the world end to end,
some moron in a rotary will still to try and pass them
 
 
 




-- 
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: Adding zeros to date

2001-10-05 Thread _lallous

if you want to do as you're doing this will do:

 if ($month  10) {
  $month = 0$month;
 if ($date  10) {
  $date = 0$date;

Daniel alsén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 is there a easier way to add zeros to date than the script below? (ie to
get
 20011005 instead of 2001105). I wrote a long string replace. But it seems
 kind of unecessary to me. Is it?


 $date_time_array = getdate (time());
 $date = $date_time_array[ mday];
 $month = $date_time_array[ mon];
 $year = $date_time_array[ year];


 if ($month  10) {
 $month = str_replace(1, 01, $month);
 $month = str_replace(2, 02, $month);
 $month = str_replace(3, 03, $month);
 $month = str_replace(4, 04, $month);
 $month = str_replace(5, 05, $month);
 $month = str_replace(6, 06, $month);
 $month = str_replace(7, 07, $month);
 $month = str_replace(8, 08, $month);
 $month = str_replace(9, 09, $month);
 }

 if ($date  10) {
 $date = str_replace(1, 01, $date);
 $date = str_replace(2, 02, $date);
 $date = str_replace(3, 03, $date);
 $date = str_replace(4, 04, $date);
 $date = str_replace(5, 05, $date);
 $date = str_replace(6, 06, $date);
 $date = str_replace(7, 07, $date);
 $date = str_replace(8, 08, $date);
 $date = str_replace(9, 09, $date);
 }

 $datemonth = $year . $month . $date;

 echo $datemonth;

 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   |  #




-- 
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] How can I simulate the login process?

2001-10-04 Thread _lallous

I want to write a script that simulates the login process and logs on and
grabs some pages (that can only be viewed when logged in) and the logs
out...
how can i do that?

consider the authentication system is done via session variables method...

any ideas would help.



-- 
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: passing object variable from page to page. Please disregard the previous!

2001-10-03 Thread _lallous

you can always pass objects if you serialize them in the first page and then
unserialize them back in the 2nd page.
check serialize()

Ming-Chieh Lee [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

  I have a question on how to pass object variable from page to page. Here
 is

  something that I found, but it doesn't work. I would greatly appreciate
if

  someone can help:

  1. does it matter if I include first, then so session_start()?

 

 

  file1.php

  ?

  include ('class.myclass.php');

  session_start();

  $myvar = new MyClass;

 

  $myvar-who = me;

  // this is where my doubt reside !!!

  session_register ('myvar'); // like this ?

 

  // don't need to register stuff in the class, it's already there.

  // session_register ('who'); ?

  _

  file2.php

 session_start();

  include ('class.myclass.php');

  // using an  you won't make a copy and you

  // can work directly on the session var

  $myvar = $HTTP_SESSION_VARS['myvar'];

 

  // should print object

  echo br . gettype($myvar);

 

  // use the object, who is not a session var

  echo Session Var :  .$myvar-who. BR;

 

  //echo Session Var :  .$HTTP_SESSION_VARS['myvar']['who'] . BR;

  //echo Session Var :  .$HTTP_SESSION_VARS['myvar-who'] . BR;

  ?






-- 
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: Array Elements While Loops

2001-10-01 Thread _lallous

 if ($flag = 1) {
 die (p align='center'bEmail #$errorNo is not a valid e-mail

should be:

if ($flag == 1) // notice the double-equal signs

Tom Churm [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi,

 my problem is this:  i'm using a while loop to check elements in an
 Array for valid email syntax.  if $User[0] is a valid email address but
 $User[1] is not, the code for $User[0] is still executed before the die
 statement.  i need my loop to finish checking ALL array elements for
 validity, and to then die BEFORE any further code is executed.  here's
 what i have now (it doesn't work):

 //loop to check for bad email addresses:
 $j = 0;
 $flag = 0;
 while ($j  count($User)){
 if

(($User[$j]!=)!eregi(^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-
]+)*$,
 $User[$j]))
 {
 $flag = 1;
 $errorNo = $j + 1;
 }
 //die if flag is 1
 if ($flag = 1) {
 die (p align='center'bEmail #$errorNo is not a valid e-mail
 address!/bbrbrbra
 href='javascript:window.history.back();'Please return and correct
 this./a/p);
 }
 else {
 continue...
 }

 any suggestions would be great!

 thanks much,

 tom



-- 
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] word filter

2001-10-01 Thread _lallous

and btw Maxim...I didn't write the $naught_words array in the first place...

Maxim Maletsky ) [EMAIL PROTECTED] wrote in message
news:014a01c14a54$05530640$4829abd4@tatiana...


Sorry, I meant since PHP 4 only, as it is when function in_array() was
introduced

Maxim Maletsky
www.PHPBeginner.com


-Original Message-
From: Maxim Maletsky (PHPBeginner.com)
[mailto:[EMAIL PROTECTED]]
Sent: lunedì 1 ottobre 2001 10.33
To: '_lallous'; [EMAIL PROTECTED]
Cc: 'Kristjan Kanarik'; 'Richard Heyes'
Subject: RE: [PHP] word filter



There's a better way to do this:

?
 $naughty_words = array(
'poop',
'bum',
'religion'
  );

 echo in_array($text, $naughty_words) ? found bad words! : text is
clean!; ?

Since PHP though...


P.S: are you considering 'region' a naughty word, _lallous? Careful
there...

Maxim Maletsky
www.PHPBeginner.com



-Original Message-
From: _lallous [mailto:[EMAIL PROTECTED]]
Sent: lunedì 1 ottobre 2001 11.15
To: [EMAIL PROTECTED]
Subject: Re: [PHP] word filter


 $naughty_words = array(
 'poop',
 'bum',
 'religion'
 );
if (eregi(join('|', $naughty_words), $text))
  echo found bad words!;
else
  echo text is clean!;

Richard Heyes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]...

  Looking for a function which checks the user input for unwanted
  (mostly
  rude) words. Those words should be defined first in array or so of
  course...  should be case insensitive as well.

 $text = 'This text contains a naughty word: Bum'; $naughty_words =
 array( 'poop',
 'bum',
 'religion'
 );

 function naughty_words($text, $naughty_words){
 $text = strtolower($text);
 foreach($naughty_words as $value){
 if(strpos($text, strtolower($value)) !== FALSE)
 return TRUE;
 }

 return FALSE;
 }

 echo naughty_words($text, $naughty_words) ? 'Found naughty words' :
 'Text
is
 clean';

 --
 Richard Heyes
 I know not with what weapons World War III will be fought, but World
 War
IV
 will be fought with sticks and stones. - Albert Einstein





--
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 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 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: one pattern, one string, multiple results

2001-09-26 Thread _lallous

try this!
I don't know how effective is preg_replace w/ huge memory contentsbut
this should work fine!

  $mem = an arc is an archer, arc but what about marc and darcy?;
  $match = arc;
  $count = 0;
  preg_replace(/\b$match\b/ie, \$count++;, $mem);
  echo $count;

Richard Baskett [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I just can not seem to figure this out.

 If i have a pattern 'arc' and I want to search the string:
 an arc is an archer, but what about marc and darcy?

 How can I find out how many occurances of arc is within that string?  I
know
 I can do an explode and then compare it, but when you have huge amounts of
 text... is this the best way?  Or is there something better?  Any help
would
 be great I have been struggling with this for awhile, since I really do
not
 want to explode, pun intended :)

 Rick




-- 
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: one pattern, one string, multiple results

2001-09-26 Thread _lallous

use this modifier /ies instead of /ie

_lallous [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 try this!
 I don't know how effective is preg_replace w/ huge memory contentsbut
 this should work fine!

   $mem = an arc is an archer, arc but what about marc and darcy?;
   $match = arc;
   $count = 0;
   preg_replace(/\b$match\b/ie, \$count++;, $mem);
   echo $count;

 Richard Baskett [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I just can not seem to figure this out.
 
  If i have a pattern 'arc' and I want to search the string:
  an arc is an archer, but what about marc and darcy?
 
  How can I find out how many occurances of arc is within that string?  I
 know
  I can do an explode and then compare it, but when you have huge amounts
of
  text... is this the best way?  Or is there something better?  Any help
 would
  be great I have been struggling with this for awhile, since I really do
 not
  want to explode, pun intended :)
 
  Rick
 





-- 
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: Receiving mySQL result from remote server?

2001-09-25 Thread _lallous

Yes you can.
It depends if you have a user name and password and access to access
abc.com's MySql server,

remember you do this:
?
  $db_name = newsdatabase;
  $db_uname= username;
  $db_upass= password;
  $db_host = abc.com;

  $conn = mysql_connect($db_host, $db_uname, $db_upass);
  mysql_select_db($db_name);
?
see?
try http://freesql.org (it is a free mysql database provider!;))

Jeff Lewis [EMAIL PROTECTED] wrote in message
010301c14508$864c8060$[EMAIL PROTECTED]">news:010301c14508$864c8060$[EMAIL PROTECTED]...
Is it possible to have a script at xyz.com retrieve data from a mySQL
database on abc.com?

Jeff




-- 
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: mysql_connect failes w/ variables and defines. why?

2001-09-24 Thread _lallous

Can you show us some code?

Dana Holt [EMAIL PROTECTED] wrote in message
000501c143df$dcedbb20$6400a8c0@MORPHEUS">news:000501c143df$dcedbb20$6400a8c0@MORPHEUS...
 Does anyone know why if I pass mysql_connect() or mysql_select_db() parms
as
 variables or defined constants the connection always fails? If I copy and
 paste the values I assign to the variable or the defined constant it works
 like a champ. Can anyone explain this?

 Thanks in advance.

 --
 Dana Holt / [EMAIL PROTECTED]
 Xenos Online
 http://www.xenosonline.com/
 ---
 http://www.theydidmewrong.com/
 http://www.shedidmewrong.com/
 http://www.hedidmewrong.com/
 --





-- 
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: parsing

2001-09-21 Thread _lallous

This should do,

?
$mem = '
TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0 TRTD
WIDTH=100% CLASS=DEFAULTBOX colspan=2 SPAN CLASS=TITLE Motor
Racings Strangest Races/SPANBR SPAN CLASS=AUTHOR  TIMBALLS,
GEOFF/SPANBR /TD/TR/table TABLE BORDER=0 WIDTH=100%
CELLPADDING=0 CELLSPACING=0 TRTD CLASS=DEFAULTBOX COLSPAN=2
width=100%IMG SRC=//www.proxis.be/imgs/nav/transpix.gif WIDTH=1
HEIGHT=1/TD/TR TRTD WIDTH=98% TABLE BORDER=0 CELLSPACING=0
CELLPADDING=2 width=100% TRTD width=100% colspan=2 SPAN
CLASS=AUTHORPaperback/SPAN /TD/TR TRTD width=100%
colspan=2IMG SRC=//www.proxis.be/imgs/nav/transpix.gif WIDTH=10
HEIGHT=10/TD/TR TRTD ALIGN=left VALIGN=topA
HREF=http://owas.proxis.be/gate/jabba.coreii.g_p?bi=4sp=DETAILSmi=3575625
si=19806267IMG SRC=//www.proxis.be/imgs/navigation/BK/infoscan.gif
border=0 HEIGHT=70 WIDTH=50/A/TD TD ALIGN=left VALIGN=top
class=INFO width=100%SPAN CLASS=SUBPRICESales start/SPAN   SPAN
CLASS=INFO30/09/2001/SPAN TABLE BORDER=0 CELLSPACING=2
CELLPADDING=0 width=100% TRTD CLASS=SHOPTITLE WIDTH=8IMG
SRC=//www.proxis.be/imgs/nav/transpix.gif WIDTH=8 HEIGHT=8/TD TD
width=100%SPAN CLASS=EXCLAMATIONProxis Price: 663
BEFBR/SPAN/TD/TR /TABLEbr A
HREF=http://owas.proxis.be/gate/jabba.coreii.g_p?bi=4sp=DETAILSmi=3575625
si=19806267more info/A /TD/TR /TABLE /TDTD ALIGN=left
VALIGN=top WIDTH=2% CLASS=DEFAULTBOXIMG
SRC=//www.proxis.be/imgs/nav/options_t.gif WIDTH=114 HEIGHT=5BRA
HREF=http://owas.proxis.be/gate/jabba.cx_basket.ins_basket_item?sesid=19806
267p_item_id=3575625p_quantity=1 img
src=//www.proxis.be/imgs/nav/EN/options_inbasket.gif WIDTH=114
HEIGHT=18 BORDER=0 alt=in winkelwagentje/ABRa
href=http://owas.proxis.be/gate/jabba.coreii.g_p?bi=4sp=DETAILSmi=3575625
si=19806267#noteimg src=//www.proxis.be/imgs/nav/EN/options_desc.gif
width=114 HEIGHT=18 border=0/AbrIMG
SRC=//www.proxis.be/imgs/nav/options_b.gif WIDTH=114
HEIGHT=8/TD/TR /TABLE
';

if (preg_match_all(/span[^]+(.+?)\/span/is, $mem, $matches))
{
  for ($i=0;$icount($matches[0]);$i++)
  {
echo content $i = {$matches[1][$i]}\n;
  }
}

?

Dries Plessers [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 Below you will see some html code, my question is how can I parse
everything
 between the tags
 SPAN CLASS=TITLE and /SPAN and put the results in an array ?

 i know i should use preg_match_all but can't figure it out.


 Thanks !


 this is the html needed to be parsend:

 TABLE BORDER=0 WIDTH=100% CELLPADDING=0 CELLSPACING=0 TRTD
 WIDTH=100% CLASS=DEFAULTBOX colspan=2 SPAN CLASS=TITLE Motor
 Racing's Strangest Races/SPANBR SPAN CLASS=AUTHOR  TIMBALLS,
 GEOFF/SPANBR /TD/TR/table TABLE BORDER=0 WIDTH=100%
 CELLPADDING=0 CELLSPACING=0 TRTD CLASS=DEFAULTBOX COLSPAN=2
 width=100%IMG SRC=//www.proxis.be/imgs/nav/transpix.gif WIDTH=1
 HEIGHT=1/TD/TR TRTD WIDTH=98% TABLE BORDER=0
CELLSPACING=0
 CELLPADDING=2 width=100% TRTD width=100% colspan=2 SPAN
 CLASS=AUTHORPaperback/SPAN /TD/TR TRTD width=100%
 colspan=2IMG SRC=//www.proxis.be/imgs/nav/transpix.gif WIDTH=10
 HEIGHT=10/TD/TR TRTD ALIGN=left VALIGN=topA

HREF=http://owas.proxis.be/gate/jabba.coreii.g_p?bi=4sp=DETAILSmi=3575625
 si=19806267IMG SRC=//www.proxis.be/imgs/navigation/BK/infoscan.gif
 border=0 HEIGHT=70 WIDTH=50/A/TD TD ALIGN=left VALIGN=top
 class=INFO width=100%SPAN CLASS=SUBPRICESales start/SPAN   SPAN
 CLASS=INFO30/09/2001/SPAN TABLE BORDER=0 CELLSPACING=2
 CELLPADDING=0 width=100% TRTD CLASS=SHOPTITLE WIDTH=8IMG
 SRC=//www.proxis.be/imgs/nav/transpix.gif WIDTH=8 HEIGHT=8/TD TD
 width=100%SPAN CLASS=EXCLAMATIONProxis Price: 663
 BEFBR/SPAN/TD/TR /TABLEbr A

HREF=http://owas.proxis.be/gate/jabba.coreii.g_p?bi=4sp=DETAILSmi=3575625
 si=19806267more info/A /TD/TR /TABLE /TDTD ALIGN=left
 VALIGN=top WIDTH=2% CLASS=DEFAULTBOXIMG
 SRC=//www.proxis.be/imgs/nav/options_t.gif WIDTH=114 HEIGHT=5BRA

HREF=http://owas.proxis.be/gate/jabba.cx_basket.ins_basket_item?sesid=19806
 267p_item_id=3575625p_quantity=1 img
 src=//www.proxis.be/imgs/nav/EN/options_inbasket.gif WIDTH=114
 HEIGHT=18 BORDER=0 alt=in winkelwagentje/ABRa

href=http://owas.proxis.be/gate/jabba.coreii.g_p?bi=4sp=DETAILSmi=3575625
 si=19806267#noteimg src=//www.proxis.be/imgs/nav/EN/options_desc.gif
 width=114 HEIGHT=18 border=0/AbrIMG
 SRC=//www.proxis.be/imgs/nav/options_b.gif WIDTH=114
 HEIGHT=8/TD/TR /TABLE





-- 
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: How to update a variable on a other frame.

2001-09-21 Thread _lallous

are we talking JavaScript wise?

Hvm [EMAIL PROTECTED] wrote in message
001001c14270$8a563380$0601a8c0@Hans">news:001001c14270$8a563380$0601a8c0@Hans...
Hi all,

Is there a command to update a variable on a other frame generated by a php
script.
This is needed to show the number of records selected in the bottom frame
(this frame is also generated from a php script).

Manny thanks,

Hans.




-- 
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: Grabbing

2001-09-21 Thread _lallous

I guess the ereg() will stop when i reads a new line character, therefore
try to use the preg_match() with /is modifiers.

preg_match(/$begin(.*?)$end, $search, $matches);

Daniel alsén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 iam trying to grab info from a webpage.

 This snippet is the part that does the actual searching...

 $site = www.whatever.com/something.html;
 $open = fopen($site, r);
 $search = fread($open, 2);
 fclose($open);
 $search = ereg($begin(.*)$end, $search, $content);

 What i find strange is that the search only works on the actual text in
the
 html-document. It doesn´t seem to be able to use htmltags as $begin or
$end.

 And another question: does  the search of $end begins from $begin? Or
does
 it scan the whole document for both strings?

 Regards
 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   |  #




-- 
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: form variables have CR/LF ?

2001-09-21 Thread _lallous

in worst cases read it after post via trim()

Patrick Sibenaler [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...



 Does anyone know what is going wrong, when all of a sudden, the
 content of PHP global variables that are generated from a POSTED
 form, have a CR/LF prepended?

 That means, looking at a field 'name' where 'john' was typed in,
 I'm getting a variable $name with the content

 '
 john'

 instead of 'john'

 Anyone seen this I found that it only happens with the POST
 method. GET works fine (but I cannot use that).

 Any help is greatly appreciated.


 greets.



-- 
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: text editing (parsing)

2001-09-20 Thread _lallous

you can also use Regular Expressions,

just post the text you want to parse (no matter how complex) and we will see
how we can help you out.

Jonas K [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I need some help with parsing text. very simple. I have a text string like
 News, Bla, Blabla and i want to get the single words out of the string.





-- 
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: excuting several sql statements in one time

2001-09-20 Thread _lallous

No you can't! I wrote a simple routine for the task!


you might want to view it from:
http://www.kameelah.org/eassoft/php_files/sql2php.php.txt

just take the  parse_sql_stream($all) which returns an array that have all
the statments to be passed to mysql_query()

this script is usefull when you have a huge .SQL file that you want to
execute from PHP code.


VM ÁÖ¿N [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello

 I want to know how to implement these several sql statements in one time.

 For example, I have 2 sql statements like :

 INSERT INTO com VALUES ('pentium');
 INSERT INTO com VALUES ('amd');

 Then, I want to excute these 2 sql statements in one time with PHP.

 I tried to implement like this :

 $query = 
 INSERT INTO com VALUES ('pentium');
 INSERT INTO com VALUES ('amd');
 ;
 mysql_query($query, $dbconnect);

 But as you know, it didn't work.

 Does any one know how to run this job?

 _
 MSN Explorer°¡ ÀÖÀ¸¸é Hotmail »ç¿ëÀÌ ÈξÀ Æí¸®ÇØ Áý´Ï´Ù. Áö±Ý
 http://explorer.msn.co.kr/ ¿¡¼­ ¹«·á·Î ´Ù¿î·ÎµåÇϼ¼¿ä.




-- 
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: Call a script without a return

2001-09-19 Thread _lallous

check lgwm.org
goto reading comprehension section and then double-click or select any word
on this page and see what happens!

Yes it can be done what you're thinking of.

Alex Shi [EMAIL PROTECTED] wrote in message
005d01c140b6$67c19550$0105050a@pony">news:005d01c140b6$67c19550$0105050a@pony...
 Hi,

 I know my question might be a little bit strange but I am really
 thinking for the posiblity.

 Suppose we have a page and on it a button link to a backend
 script. When click the button, at the server side the scritp will
 be called. My question is, how can we program the script that
 just let to do something on server but not to send out a return
 to browser, so at client end the page will be stay unchanged.

 Can any one here have an idea how to do this?

 Alex





-- 
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: Replacing datafile with array

2001-09-18 Thread _lallous

works like a charm

just initializet the $retVal function...

$retVal = array();
rest of script here

Daniel alsén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi,

 i am trying to replace a datafile wich contains the contents of a
directory
 with an array.
 I am reading the directory and am trying to pass the value to an array.
What
 am i doing wrong? Shouldn´t $retVal contain the direcory info?

 Also, is there a way to use the content of an array without getting the
word
 'Array' at the start?

 $handle=opendir('.');
 while (false !== ($file = readdir($handle)))

 if ($file != .  $file != ..  ereg(.jpg,$file)) {

 $retVal[count($retVal)] = $file;

 }

 # Daniel Alsén| www.mindbash.com #
 # [EMAIL PROTECTED]  | +46 704 86 14 92 #
 # ICQ: 63006462   |  #




-- 
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: regular expression help

2001-09-18 Thread _lallous

This should do (but ofcourse you might want to play a bit with it)

$mem =
'
A HREF=http://www.mydomain.com/mypage.php;something/a is fine
A HREF=http://www.yourdomain.com/yourpage.php;something/a is wrong
A HREF=http://www.yourdomain.com/yourpage.php;something/a is finebr
a href=http://www.lgwm.org/;lgwm/abr
a href=http://www.google.com;
onclick=javascript:alert(\'hello\');Google!/a
';

function handler($theTag, $theDomain)
{
  if (!strstr($theDomain, mydomain.com))
  {
$theTag = strstr($theTag,  );
$theTag = a target='_blank'$theTag;
  }
  return stripslashes($theTag);
}

$re = /\s*a\s*href\s*=\s*(['\])(.+?)\\1[^]*/eis;
$t = preg_replace($re, handler('\\0', '\\2') ,$mem);
echo $t;

//greetings RZe!

Justin French [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 hi all,

 I have some user-supplied text on a content driven site.
 I am allowing A tags inside the main text, BUT I want
 any links to external sites (not on the chosen domain)
 to include a ' TARGET=_new ' element.

 So,

 A HREF=http://www.mydomain.com/mypage.php;something/a is fine
 A HREF=http://www.yourdomain.com/yourpage.php;something/a is wrong
 A HREF=http://www.yourdomain.com/yourpage.php;
 TARGET=_newsomething/a is fine

 And of course there are all the variants with and without
 the www, and with and without sub directories and pages.

 I'[d also like to make sure the dopey people have put a
 close tag in.


 I've got a few ideas on how it might be done, but I need
 to do it the right way, avoiding slight human errors etc.


 Has anyone got something written, or can point me in the
 right direction?


 Justin French



-- 
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: May I ask sql question here??

2001-09-18 Thread _lallous

Man...you could have asked already and you might have got an answer from
others and NO from others...
I might answer you if your question is in the range of my knowledge.

Zenith [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I know that, this is a newsgroup for PHP, but can I ask some SQL question
 here?
 Or, would you mind point me to a suitable newsgroup for SQL question?





-- 
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: Get the beginning array number

2001-09-18 Thread _lallous

reset($array);
list(, $value) = each($array);
this will give you first value in $value

Brandon Orther [EMAIL PROTECTED] wrote in message
!~[EMAIL PROTECTED]">news:!~[EMAIL PROTECTED]...
 Hello,

 I have an array sent to my script that starts at different numbers each
 time.  Here is an example


 $array[5] through $array[23]  will have values but [0]-[4] will not.

 Is there a way for me to find the first element of an array with a value?

 Thank you,

 
 Brandon Orther
 WebIntellects Design/Development Manager
 [EMAIL PROTECTED]
 800-994-6364
 www.webintellects.com
 





-- 
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: INCREASING GAS PRICES

2001-09-18 Thread _lallous

Hehhere and just now the gas price rasied to $2 per 20 Litter
[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Oil prices have jumped amid concerns that U.S.
 retaliation for this week's terrorist attacks
 could hurt supplies from the Middle East.

 Brent Crude futures for November delivery jumped
 61 cents, or 2.2 percent, to $28.96 in mid-morning
 trade on London's International Petroleum Exchange.


 It's a Fact!
 Experts are saying that by the end of the year
 gas prices can be over $2.50 per gallon!


 Increase Your Gas Mileage up to 27%!

 http://www.e-webhostcentral.com/ch8/gas-001.html







 remove at [EMAIL PROTECTED]



-- 
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: INCREASING GAS PRICES

2001-09-18 Thread _lallous

Hehhere (Lebanon) the gas price rasied to $2 per 20 Litters already!

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Oil prices have jumped amid concerns that U.S.
 retaliation for this week's terrorist attacks
 could hurt supplies from the Middle East.

 Brent Crude futures for November delivery jumped
 61 cents, or 2.2 percent, to $28.96 in mid-morning
 trade on London's International Petroleum Exchange.


 It's a Fact!
 Experts are saying that by the end of the year
 gas prices can be over $2.50 per gallon!


 Increase Your Gas Mileage up to 27%!

 http://www.e-webhostcentral.com/ch8/gas-001.html







 remove at [EMAIL PROTECTED]





-- 
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: Overriding PHP build-in functions

2001-09-17 Thread _lallous

You have two ways:

1)Recompile PHP (as it comes with source code) and put your decryption
functions just after the reading of the .PHP and before getting it parsed.

2)If you want to do a windows solution w/o modifying source code then you
have to hack into the PHP code and add your new functions:
The idea is to set a hook on the CreateFileA() and ReadFileA() windows APIs
and replace them with our new functions that only decrypts PHP files (in
memory) and them returns them to PHP.

//elias

Robert Klinkenberg [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Is it possible to override the php build-in functions without changing the
 PHP base distribution?

 We want to encode our scripts but zend is a bit expensive so we are
looking
 to write something ourself.
 (encryption libs are freely available, so the main problem is changing the
 file open function so that it decodes the file while reading it from disk)

 Robert Klinkenberg





-- 
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: Download a file with PHP

2001-09-17 Thread _lallous

Very simple,

you can use functions like this to copy file from an HTTP server to your
local harddrive:
  function my_copyfile($src, $dest)
  {
if (!$fp  = fopen($src, rb))
  return;
$fpo = fopen($dest, wb);
while (!feof($fp))
{
  $t = fread($fp, 4096);
  fwrite($fpo, $t, 4096);
}
fclose($fp);
fclose($fpo);
  }

in combination with the use of RegExps to parse HTML pages and extract the
filenames that you want to extract

Erich Kolb [EMAIL PROTECTED] wrote in message
000601c13d3b$3e0ba580$[EMAIL PROTECTED]">news:000601c13d3b$3e0ba580$[EMAIL PROTECTED]...
 How do I download a file with PHP?  I have a few hundred .xml and .rdf
files
 that I want to download on a regular basis.




-- 
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: FOPEN remote problems..

2001-09-17 Thread _lallous

I tried to get it via CURL but i failed, here's the output:
* Connected to www.800.com (216.88.211.1)
 GET /prod.asp?P=5261 HTTP/1.1
User-Agent: curl/7.8 (win32) libcurl 7.8
Host: www.800.com
Pragma: no-cache
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*
* Closing live connection (#0)

I tried with NetVampire (which allow you to specifiy a user agent string),
and I succeeded, here's output:
  Connecting to www.800.com ...
  Connected to www.800.com [216.88.211.1]
  GET /prod.asp?P=5261 HTTP/1.1
  Connection: close
  Host: www.800.com
  Accept: */*
  Pragma: no-cache
  Cache-Control: no-cache
  Referer: http://www.800.com/
  User-Agent: Mozilla/4.04 [en] (Win95; I ;Nav)
  Cookie: SITESERVER=GUID=5003bed94ac9ead4d5b3fcd703c59b91;
MemRightsChanged=jtalOx==; popup=1

  HTTP/1.0 200 OK
  Server: Microsoft-IIS/5.0
  Date: Mon, 17 Sep 2001 10:58:16 GMT
  P3P: policyref=http://www.800.com/w3c/p3p.xml;, CP=ADM DEV CUS TAI STP
UNI STA OUR DSP ALL COR
  Content-Length: 51076
  Content-Type: text/html
  Cache-Control: private
  X-Cache: MISS from gw.inet.gw
  Connection: close

  Data transfer started
  Received 51 076 bytes in 0:00:08 (5 686 bytes/s)
  JOB COMPLETED SUCCESSFULLY

I'm not sure then if the problem is with user agent or not

Reberrya [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hey all.  I'm trying to do a fopen for reading on many different sites and
 web pages.  However, I have found that many webpages can not be FOPENed at
 all.  For instance, one such example would be
 http://www.800.com/prod.asp?P=5261

 I do not understand as I can read from numerous other sites.  Why can I
see
 the above site and others in Internet Explorer and Netscape, but PHP is
not
 able to read from that file?

 And yes, I can read from many other ASP, JSP, and PHP pages, so this is
not
 the problem that I know of.

 Any help appreciated.

 Andrew





-- 
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: MySQL query error

2001-09-17 Thread _lallous

 mysql_quory($Query);
typos

i can't also see more errors...

Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Code:
 ?
 $Query = UPDATE feRegUsers SET Constructor='2001-09-17',
 Enertec='2001-09-17', Seatec='2001-09-17' WHERE ID LIKE '288';
 mysql_quory($Query);
 print mysql_error();
 ?

 That results
 You have an error in your SQL syntax near 'Constructor='2001-09-17',
 Enertec='2001-09-17', Seatec='2001-09-17'' at line 1.

 What's wrong? I don't see anything that can be wrong! Am I blind once
again?


 Niklas




-- 
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] Script that logons and grabs some pages (while beeing authenticated)

2001-09-17 Thread _lallous

Hello

I wonder if this can be done via a PHP script:

1)Goto mail.yahoo.com
2)Authenticate (submit username and password)
3)proceed to next screen and grab the inbox page (which shows the messages
headers)
4)Log out


I know how I can post data, but I wonder how I can keep my script
authenticated while surfing from page to page...

Does the fopen() support https://; also?

Thanks.



-- 
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: EXTRACTING URL FROM A FILE

2001-09-17 Thread _lallous

your regexp won't work...you have to change it! cause a quick look to
yahoo's index page:

a href=r/f3Photos/a - a href=r/drbDomain Registration/b/a -
see?!

I made this regexp which is partially working:

$re = /a href=(['\]*|)(.+?)(\1|[ ])[^]*(.+?)\/a/is;


Chinmay Varma [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi all,
The following is a sample code I try to extract URL from a Web Page.Its not
finding any match.Any idia why ?
Kindly let me know.
Thanks to all.
chinmay.
***
$fp = fopen('http://yahoo.com/','r') or die (Cannot connect);
while($line = fgets($fp,1024))
{

if(preg_match_all('/.*?a.*?href=\s*?[\'](.+)[\'].*?.*?\/.*?a.*?/i',$li
ne,$matches))
  {
array_shift($matches);
foreach($matches as $match)
{
$url_list = $match;
echo $match;
}
  }
}









-- 
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: Is it *really* an associative array?

2001-09-14 Thread _lallous

what are you trying to do?
why do you want to diffirentiate between 99 as a string or as a number?

Chris Boget [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Sample code:

 script language=php

   $array = array( one, two, three );
   while( list( $key, $val ) = each( $array )) {
 if( is_string( $key )) {
   echo Key is a string\n;

 }
 echo Key: $key = $val :Val\n;

   }
   echo \n\n;

   $array = array( SS = one, 15 = two, 19 = three );
   while( list( $key, $val ) = each( $array )) {
 if( is_string( $key )) {
   echo Key is a string\n;

 }
 echo Key: $key = $val :Val\n;

   }

 /script

 Because of the loose typing in PHP, essentially all arrays
 are associative arrays.  Running the script above produces
 the following results:

  BEGIN RESULTS
 Key: 0 = one :Val
 Key: 1 = two :Val
 Key: 2 = three :Val


 Key is a string
 Key: SS = one :Val
 Key: 15 = two :Val
 Key: 19 = three :Val
  END RESULTS

 Anyways, I want to be able to pass an array to a function.
 This array can be defined by me as associative (as the
 second array in the sample) or regular (as the first).  However,
 I need to be able to tell one from the other in my function.
 As you can see, I can't do it with the is_string() function
 because it doesn't realize that the 15 and the 19 I specify
 as keys in the second declaration are actually strings that I
 added and not actual element numbers.
 Is there some way that I can determine if the keys of an array
 are user defined (ie, a user defined associative array) and not
 the keys PHP defines due to the fact that they are the element
 numbers?

 Another, somewhat related issue, notice the funkiness that
 happens when you run the following, similar, script:

 script language=php

   $array = array( one, two, three );
   while( list( $key, $val ) = each( $array )) {
 if( is_string( $key )) {
   echo Key is a string\n;

 }
 echo Key: $key = $val :Val\n;

   }
   echo \n\n;

   for( $i = 0; $i  count( $array ); $i++ ) {
 echo Printing element: $i --  . $array[$i] . \n;

   }
   echo \n\n;

   $array = array( SS = one, 15 = two, three );
   while( list( $key, $val ) = each( $array )) {
 if( is_string( $key )) {
   echo Key is a string\n;

 }
 echo Key: $key = $val :Val\n;

   }
   echo \n\n;

   for( $i = 0; $i  20; $i++ ) {
 echo Printing element: $i --  . $array[$i] . \n;

   }

 /script

 Any help anyone can provide would be *greatly* appreciated!!

 Chris




-- 
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: Sorting an array

2001-09-13 Thread _lallous

here's your script,

?
$mem = The Childhood
A Man called lallous
The Long kiss good night
Abbey Road
Dark Side Of the Moon
The Final Cut
The Zombie
A Hard Days Night
Kill 'em All
The Wall;

$mem = split(\n, $mem);
$arr1 = array();

for ($i=0;$icount($mem);$i++)
{
  $line = trim($mem[$i]);
  $prefix = ;
  $affix = $line;
  if (preg_match(/^(the |a )(.+)$/i, $line, $matches))
  {
$prefix = $matches[1];
$affix  = $matches[2];
  }
  $arr1[$affix] = $prefix;
}
ksort($arr1);
$arr2 = array();
while (list($key, $val) = each($arr1))
{
  $arr2[] = $val$key;
}
var_dump($arr2);
?


Dotan Cohen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to sort a listing of albums alphabetically
 for LyricsList.com, the problem is that I want the
 initial 'The' and 'A' in some albums (A Hard Days
 Night, The Wall) to be ignored. So that the list will
 look like:

 Abbey Road
 Dark Side Of the Moon
 The Final Cut
 A Hard Days Night
 Kill 'em All
 The Wall

 ABC order, 'A' and 'The' negated. The info comes from
 a database, in three calls:

 // call albums that begin with letter $letter
 $query = SELECT * FROM albums WHERE album LIKE
 '$letter%' ORDER BY album;
 $result = mysql_query($query) or die(mysql_error());

 // call albums that begin with letter A
 $query_a = SELECT * FROM albums WHERE album LIKE 'a'
 ORDER BY album;
 $result_a = mysql_query($query_a) or
 die(mysql_error());

 // call albums that begin with letter T
 $query_t = SELECT * FROM albums WHERE album LIKE 't'
 ORDER BY album;
 $result_t = mysql_query($query_t) or
 die(mysql_error());

 So I need to get just the albums from $result_t that
 begin with 'The ' (easy regex) and from $result_a that
 begin with 'A ' (easy regex), but puting the three of
 them in order is proving beyond my skill.

 Thanks in advance for any advise.

 Dotan Cohen


 __
 Terrorist Attacks on U.S. - How can you help?
 Donate cash, emergency relief information
 http://dailynews.yahoo.com/fc/US/Emergency_Information/



-- 
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: syntax?

2001-09-13 Thread _lallous

If you don't put fields name as in: INSERT INTO news VALUES(, )
this means you are going to give values to all the fields in the table (in
their order).
If you specify fields after table name: news(body, date) this means VALUES()
would be adding to these specific fields...

now as for putting NULL, this means that the fields will get the default
value, if it was autoincrement it will be also stored there.

Usualy ID fields are autoincrement and always inserted with NULL values so
that MySql will assign a valid value.


Peter [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 HI,

 I am new to this PHP thing.

 I was working out of my PHP book and website and I noticed some
 discrepancies in inputting data into the MySQL database.

 I followed the example from my book and I noticed that the syntax for
 putting data into a mysql database from PHP was like this:

 $sql = INSERT INTO news
 VALUES (NULL,'$heading','$body','$date','$auth','$auth_email');

 However I read some information on the website and I noticed that they
 added the field names right after the name of the table like this:

 mysql_query (INSERT INTO tablename (first_name, last_name)
 VALUES ('$first_name', '$last_name')
  );

 I have two questions:

 In the first example what is the meaning of putting the NULL before the
 variables?

 I was successful in entering data from my first example without declaring
 field names, so why did they declare in field names in the second example?

 If anyone can shed some light on this question, I would be most grateful.

 Thanks.

 Peter




-- 
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: Sorting an array

2001-09-13 Thread _lallous

another case-insensitive version:

pre
?
$mem = The childhood
A Man called lallous
The Long kiss good night
Abbey Road
Dark Side Of the Moon
The Final Cut
The Zombie
A Hard Days Night
Kill 'em All
The Wall;

$mem = split(\n, $mem);
$arr1 = array();

for ($i=0;$icount($mem);$i++)
{
  $line = trim($mem[$i]);
  $prefix = ;
  $affix = $line;
  if (preg_match(/^(the |a )(.+)$/i, $line, $matches))
  {
$prefix = $matches[1];
$affix  = $matches[2];
  }
  $arr1[strtolower($affix)][$affix] = $prefix;
}
ksort($arr1);
$arr2 = array();
while (list($key, $val) = each($arr1))
{
  list($key, $val) = each($val);
  $arr2[] = $val$key;
}
var_dump($arr2);
?
/pre


Dotan Cohen [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I'm trying to sort a listing of albums alphabetically
 for LyricsList.com, the problem is that I want the
 initial 'The' and 'A' in some albums (A Hard Days
 Night, The Wall) to be ignored. So that the list will
 look like:

 Abbey Road
 Dark Side Of the Moon
 The Final Cut
 A Hard Days Night
 Kill 'em All
 The Wall

 ABC order, 'A' and 'The' negated. The info comes from
 a database, in three calls:

 // call albums that begin with letter $letter
 $query = SELECT * FROM albums WHERE album LIKE
 '$letter%' ORDER BY album;
 $result = mysql_query($query) or die(mysql_error());

 // call albums that begin with letter A
 $query_a = SELECT * FROM albums WHERE album LIKE 'a'
 ORDER BY album;
 $result_a = mysql_query($query_a) or
 die(mysql_error());

 // call albums that begin with letter T
 $query_t = SELECT * FROM albums WHERE album LIKE 't'
 ORDER BY album;
 $result_t = mysql_query($query_t) or
 die(mysql_error());

 So I need to get just the albums from $result_t that
 begin with 'The ' (easy regex) and from $result_a that
 begin with 'A ' (easy regex), but puting the three of
 them in order is proving beyond my skill.

 Thanks in advance for any advise.

 Dotan Cohen


 __
 Terrorist Attacks on U.S. - How can you help?
 Donate cash, emergency relief information
 http://dailynews.yahoo.com/fc/US/Emergency_Information/



-- 
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: Regular Expression ? from newbie

2001-09-12 Thread _lallous

here's your PHP code,

?
$mem = '
table cellspacing=2 cellpadding=2 border=1
tr
td align=centerbanana/td
td align=left.46/td
td align=right.55/td
/tr

tr
td align=centerpear/td
td align=left.38/td
td align=right.51/td
/tr

tr
td align=centerapple/td
td align=left.59/td
td align=right.33/td
/tr
/table';

$re2 =
/.*?tr[^]*.*?td[^]*(.+?)\/td.*?td[^]*(.+?)\/td.*?td[^]*(.+?
)\/td.*?\/tr/is;
$re1 = '/table cellspacing=2 cellpadding=2
border=1(.+?)\/table/is';

if (preg_match($re1, $mem, $matches))
{
  if (preg_match_all($re2, $matches[1], $tddata, PREG_SET_ORDER))
  {
for ($i=0;$icount($tddata[0])-1;$i++)
{
  echo name={$tddata[$i][1]} p1={$tddata[$i][2]}
p3={$tddata[$i][3]}\n;
}
  }
}
?


Craig Westerman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Consider the following table that I grabbed from another web site using:

 ?
 $url = 'http://www.abc123xyz.com';
 $lines_array = file($url);
 $lines_string = implode('', $lines_array);
 ?

 ===

 table cellspacing=2 cellpadding=2 border=0
 tr
 td align=centerbanana/td
 td align=left.46/td
 td align=right.55/td
 /tr

 tr
 td align=centerpear/td
 td align=left.38/td
 td align=right.51/td
 /tr

 tr
 td align=centerapple/td
 td align=left.59/td
 td align=right.33/td
 /tr
 /table

 ===

 The fruit lables don't change, but prices change daily.
 How would I parse JUST the two prices to the right of the word pear into a
 new html table?

 How would I parse the word pear AND the two prices to the right into a new
 html table?

 I think the answers will help me understand better.

 Thanks

 Craig 
 [EMAIL PROTECTED]




-- 
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: Problem regarding select boxes

2001-09-11 Thread _lallous

IT's something like that friend,

html
head
title New Document /title
/head

body onload=hidelb();
script language=JavaScript
!--
  function hidelb()
  {
o = document.all[lb1];
if (test.phone.selectedIndex==1)
  o.style.display = none;
else
  o.style.display = ;
  }
//--
/script
form name=test
select name=phone id=phone
onchange=hidelb()optionMobile/optionoptionTest/option/select
select name=lb1 id=lb1option1/optionoption2/option/select
/form
/body
/html

Balaji Ankem [EMAIL PROTECTED] wrote in message
006d01c13a90$193219e0$[EMAIL PROTECTED]">news:006d01c13a90$193219e0$[EMAIL PROTECTED]...
 Hi! friend,
I had one html form .
In that i had 5 inputs.
First option is a select box.
If the selected item is Mobile then only i want to display  second and
 third input boxes. Otherwise i want to hide those two options.

 How can i endure that?

 Please give the solution to this problem.

 Thanks and regards
 -Balaji

 Here i am sending the file..

 

 !DOCTYPE html public -//w3c//dtd html 4.0 transitional//en
 html
 head
 META HTTP-EQUIV=Refresh
 content=120;URL=http://localhost/imac/addinventory.php;


 script language=Javascript


 function check(){

   if(document.addinv.inv_name.options[0].selected)
{
alert('Please select the item name');
document.addinv.inv_name.focus();
return false;
   }
   else if(document.addinv.inv_type.options[0].selected)
{
alert('Please select the item type');
document.addinv.inv_type.focus();
return false;
   }


   else if (document.addinv.inv_tag.value=='' ||
 document.addinv.inv_tag.value=='0')
   {
  alert('Inventory tag is required and it must start with
 alphabet.Please try again');
  document.addinv.inv_tag.focus();
  return false;

   }


   else
   { document.addinv.method = POST;
  document.addinv.action=add_inv.php;
  document.addinv.submit();
  return true;
   }
}

 /script
 /head

 body background=imacbg1.gif ONLOAD=document.addinv.inv_name.focus() 

center h1 ADD INVENTORY ITEM /h1/center
  ! Get current time and date 
?php$today = date(Y:m:d h:i:s); ?
 center

   h3 TIME STAMP: ?php echo $today; ? /h3
  form name=addinv 

  Item Name :
  select name=inv_name STYLE=width : 120px

 option value=0 SELECTEDSELECT/option
   option value=MobileMobile/option
   option value=SIMSIM/option
   option value=Data CableData Cable/option
   option value=ChargerCharger/option
   option value=Power SupplyPower Supply/option

 /select

 Item Type:
   select name=inv_type STYLE=width : 120px 

 option value=0 SELECTEDSELECT/option
option value=PTX520PTX520/option
option value=PTX438PTX438/option
option value=J5J5/option
option value=J6J6/option
option value=Z5Z5/option

   /select


  IMEI Numberinput type=text name=inv_imei size=15 value=

  Item Tag   input type=text name=inv_tag size=15 value=

  Status select name=inv_status STYLE=width : 120px
 option value=0 SELECTEDSELECT/option
 option value=stockSTOCK/option
 option value=inuseIN USE/option
 /select

   input type=button Value=ADD OnClick=check();/td
 /form
 /center
 /body/html

 

 If  Item name is Mobile then only we can enter type and IMEI...otherwise i
 want to hide and i will insert blank values in to the database.


 Thanks in advance.

 Regards
 -Balaji





-- 
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: NT?

2001-09-11 Thread _lallous

it works fine under 2000 Pro +IIS5

Jeremy Morano [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,
 Sorry to bother everyone. I was just wondering if php runs on NT?



-- 
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: Weird PHP problem...Example code...

2001-09-11 Thread _lallous

Yes, I see this problem before, There was a setting that you turn on/off in
the php.ini file..forgot which one..
maybe these:
; use transient sid support if enabled by compiling with --enable-trans-sid.
session.use_trans_sid = 1
url_rewriter.tags = a=href,area=href,frame=src,input=src,form=fakeentry

anyway, as a work around, you can have a redirector to this page, or this
page can redirect to itself (to simulate reload)
?
// very start of page
if (!isset($reload))
{
  Header(Location: $PHP_SELF?reload=y);
  exit();
}
// continue script here...
?

Dana Holt [EMAIL PROTECTED] wrote in message
01c13a93$edf933e0$6400a8c0@MORPHEUS">news:01c13a93$edf933e0$6400a8c0@MORPHEUS...

 Ok, this code is used on the index page of on of my sites. It prints out a
 list of links from a database.

 I am using PHP sessions. When I open a new browser and go the site for the
 first time the HTML that is output by my code is not correct. This is only
 on SOME of the lines, but it is always on the SAME lines. After a reload
or
 even going to another web site and back it works fine every time. I
noticed
 that PHP is automatically adding a PHPSESSID to the links. I think this is
 causing the problem. PHP seems to be adding more than just that.

 Anyone seen this before? Anyone know how I can fix it?

 Thanks in advance for any help!

 WEIRD HTML START (first view of page in new browser window)

 a
href='/viewstory.php?story=20PHPSESSID=61bf547309e9bce7c1e333fb1958cd89'
 target='_self'tr
 Test 1.../abr

 a
href='/viewstory.php?story=28PHPSESSID=61bf547309e9bce7c1e333fb1958cd89'
 target='_self'tr
   Test 2.../abr

 a
href='/viewstory.php?story=21PHPSESSID=61bf547309e9bce7c1e333fb1958cd89'
 target='_self'tr
   Test 3.../abr

 a
href='/viewstory.php?story=27PHPSESSID=61bf547309e9bce7c1e333fb1958cd89'
 target='_self'tr
   Test 4.../abr

 WEIRD HTML END

 CORRECT HTML START (after the first page view I get this)

 a href='/viewstory.php?story=20' target='_self'Test 1.../abr

 a href='/viewstory.php?story=28' target='_self'Test 2.../abr

 a href='/viewstory.php?story=21' target='_self'Test 3.../abr

 a href='/viewstory.php?story=27' target='_self'Test 4.../abr

 CORRECT HTML END

 PHP CODE START

 while($row = mysql_fetch_assoc($result)) {

 echo a href='/viewstory.php?story=;
 echo $row[RECORD_ID];
 echo ' target='_self';

 if (strlen($row[HEADLINE])  20) {
 echo substr($row[HEADLINE], 0, 20);
 echo '...';
 } else {
 echo $row[HEADLINE];
 } }

 echo '/a';
 echo 'br';
 }

 PHP CODE END

 --
 Dana Holt / [EMAIL PROTECTED]







-- 
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: JavaScript MD5()

2001-09-11 Thread _lallous

Yes, there is Md5() for javascript ;)

http://pajhome.org.uk/crypt/md5/

I tried it and it works just fine! :)

Nicolas Costes [EMAIL PROTECTED] wrote in message
00fd01c13a94$e3329b80$0100a8c0@p2333">news:00fd01c13a94$e3329b80$0100a8c0@p2333...
 Hellorgh, all !!!
 Does anyone knows if there is a way to MD5-encode strings with JavaScript
?

 I use MD5() to encode passwords then insert them in my account database,
 and when a user logs in, i do MD5($password_provided_by_form) to compare
it
 with the one stored in the DB.
 Ok, fine, I cannot see the users's passwords but when they log in,
everyone
 can sniff it !!!

 That's why i'd like to encode passwords at client-side a Javascript
 MD5() function should be fine, but i think it doesn't exists  and I
 can't use (and i don't know how to ;~p ) SSL, https: 

 Someone's got any solution 

 Thanx,


 (°-Nayco,
 //\[EMAIL PROTECTED]
 v_/_ http://nayco.free.fr




-- 
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: Sessions Getting Broken

2001-09-11 Thread _lallous

Maybe it's getting timed out?

Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I have a database update system and I regonize users with sessions.
 Sometimes sessions just broke with no sane (for me at least) reason.

 Any ideas what may cause this, it's pretty anoying if you have updated 20
 fields, try to submit the form and then you get kicked out of the
system!?!
 Otherwise my sessions work great. :)



 Niklas




-- 
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: More thoughts about PHP: Taglibs

2001-09-11 Thread _lallous

Yep this is not bad!
 html
 Hello, showusername/.  Your last login was showlastlogin/.p
 /html

and now using PHP's short tags, you can make it even prettier:

 html
 Hello, ?=showusername()?.  Your last login was ?=showlastlogin()?.p
 /html

Right?

Dr. Evil [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...

 It seems to me that one of the problems with PHP is that you have to
 include code in your HTML pages.  Even with the cleanest design, you
 end up with HTML that looks like this:

 html
 Hello, ?php showusername(); ?.  Your last login was ?php
 showlastlogin(); ?.p
 /html

 This is ok, but it seems to me that java taglibs provide a more
 elegant way to do the same things:

 html
 Hello, showusername/.  Your last login was showlastlogin/.p
 /html

 This lets the backend stuff be completely separated from the html
 design part of things.  What do people think of this?  I'm just now
 learning JSP so I'm thinking about the differences between PHP and
 JSP.

 In general, both are powerful ways of creating dynamic websites, but
 they have different characteristics and are better for different
 things.  I'm learning java but I will continue to use both, depending
 on the task.



-- 
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: variables

2001-09-11 Thread _lallous

Sure you can!

consider this simple example:
html
body
a href=javascript:setvars('var1value', 'var2value')click here to go to
next page/a

script language=JavaScript
!--
  function setvars(var1, var2)
  {
df = document.dataform;
df.var1.value = var1;
df.var2.value = var2;
df.submit();
  }
//--
/script
form name=dataform action=page2.php method=post
input type='hidden' name='var1'
input type='hidden' name='var2'
/form
/body
/html

it's using hidden forms...
you can also use sessions...

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hello,

 Is it possible to transfer certain variables to a new scripts, but not
doing
 this as uri-parameters (../bla.php?var1=varvar2=var#)

 I need it for Usernames and passwords and when the pages get cached the
 usernames and pwd's can be viewed in the Temp-inetfiles-folder in
Windhoze.

 Thanks,

 Bart




-- 
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: variables

2001-09-11 Thread _lallous

In that case you'll have to use session_variables or cookies.
mostly session_variables are better especially for authentication and
login/logout systems...

[EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Thanks for the fast answer1

 Yes I thought of that, but I also got the problem using the $vars in
frames:

 I'm using a authenticationform for users to get to a frameset. Now I'm
 transfering the usernames/pwds in the uri-string to all the framepages. In
 all framepages I check for $PHP_AUTH_USER to be set and when so I query
the
 db again and.
 It seems that the vars aren't global. How can I globalize the vars so they
 are usable in other files. Are sessions teh only option?

 Thanks in advance,
 Bart

 -Oorspronkelijk bericht-
 Van: _lallous [mailto:[EMAIL PROTECTED]]
 Verzonden: dinsdag 11 september 2001 12:23
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Re: variables


 Sure you can!

 consider this simple example:
 html
 body
 a href=javascript:setvars('var1value', 'var2value')click here to go to
 next page/a

 script language=JavaScript
 !--
   function setvars(var1, var2)
   {
 df = document.dataform;
 df.var1.value = var1;
 df.var2.value = var2;
 df.submit();
   }
 //--
 /script
 form name=dataform action=page2.php method=post
 input type='hidden' name='var1'
 input type='hidden' name='var2'
 /form
 /body
 /html

 it's using hidden forms...
 you can also use sessions...

 [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  Hello,
 
  Is it possible to transfer certain variables to a new scripts, but not
 doing
  this as uri-parameters (../bla.php?var1=varvar2=var#)
 
  I need it for Usernames and passwords and when the pages get cached the
  usernames and pwd's can be viewed in the Temp-inetfiles-folder in
 Windhoze.
 
  Thanks,
 
  Bart
 



 --
 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 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: Sessions Getting Broken

2001-09-11 Thread _lallous

Can't tell like that
No more ideasmaybe somecode would help?!

Niklas lampén [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hmm.. How do I know how fast they timeout? And it seems that all of my
users
 drop at the same time, not sure about it thou.

 session.cache_expire is set to 180.
 session.cookie_lifetime is 0.

 Maybe those do tell you something and you tell me more! :)


 Niklas

 -Original Message-
 From: _lallous [mailto:[EMAIL PROTECTED]]
 Sent: 11. syyskuuta 2001 13:09
 To: [EMAIL PROTECTED]
 Subject: [PHP] Re: Sessions Getting Broken


 Maybe it's getting timed out?

 Niklas lampén [EMAIL PROTECTED] wrote in message
 [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  I have a database update system and I regonize users with sessions.
  Sometimes sessions just broke with no sane (for me at least) reason.
 
  Any ideas what may cause this, it's pretty anoying if you have updated
20
  fields, try to submit the form and then you get kicked out of the
 system!?!
  Otherwise my sessions work great. :)
 
 
 
  Niklas
 



 --
 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 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: how to ?

2001-09-11 Thread _lallous

$ok = mysql_query(INSERT INTO table(field) VALUE('asdf'));

if (!$ok)
{
  echo error!;
}
else
{
 echo good!;
}


Clint Tredway [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 is there a way to tell if an insert failed while a in a loop. I tried
this: $query = my query;
 if (!$query)
 {
 logic here
 }
  but this is not working... is this even possible?

 thanks!
 Clint



-- 
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: Question on the list() function

2001-09-10 Thread _lallous

I don't think this is correct!

You can't do this:

list($a, $b) = variable!
which is the case in: list($key, list($tag, $data)) = each($array)

you can use: list($key, $value) = each($array)


D [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am a newbie and having some problems with a function I found in a
script:

 while(list($key,list($tag,$data))=each($array))

 From what I have read of list(), what I assume is happening here is that
its
 takeing a 2 dimensional array and assigning the key value pairs
accordingly,
 so that I can then work with the data using the $key, $tag, and $data
 variables while it cycles through each item in the array. Is this correct?

 If this is correct, which order is the dimension of the array? For example
 if the values of the variables were: $tag = 2 and $key = 1 would it be:
 $array[1][2] or $array[2][1]

 I have tried both, and dont get the $data (outside of the while loop I am
 trying to access specific parts of the array). Other thoughts?

 Thanks for the help,

 Ken






-- 
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] Never tried it but....

2001-09-10 Thread _lallous

Can sessions hold the $result resource of a mysql_query?
and the use that $result variable to fetch rows on other page?



-- 
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: Unique Array

2001-09-10 Thread _lallous

and more practically your code get corrected to this:
 for ($i = 0; $i100; $i++)
{
   $a[$i] = rand(0,9);
   $test[]=$a[$i];
 }

 $ra = array_unique($test);

and your code get optimized to this: (mostly of the manual!;))
$numbers = range (0,9);
srand ((double)microtime()*100);
shuffle ($numbers);

Cc Zona [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] (Deirdre Mc Cann) wrote:

  for ($i = 0; $i100; $i++){
  $a[$i] = rand(0,9);
  $test=$a[$i];
  }
 
  $ra = array_unique($test);
 
  I keep getting an error saying $test is the incorrect type. Can someone
  please explain why this doesn't work.

 $test is a string variable, not an array.  To add elements to an array,
 either use $varname[], array_push(), or array_unshift().

 BTW, when an error message says that a variable is not the right type,
this
 is a good time to use gettype() and/or var_dump() in order to check that
 the variable really has the type and value(s) what that you expect.

 --
 CC



-- 
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: Anagram Solution in PHP

2001-09-10 Thread _lallous

I have no idea how anagrams work, but is it true as you say/imply:
If the same of the characters of a string is same as the sum of other
characters in another string THEN the last is an anagram of the first?

Ralph Guzman [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Im trying to figue out the following anagram using PHP. Here is the
problem:

 Using letters of the alphabet represented by a number, I have to come up
 with words that add up to exactly 100.

 Numbers are in reverse where A=26 and Z=1, so for example:

 A  B  C...X  Y  Z
 26 25 24..3  2  1

 So let's say the word 'acronym'

 A  + C  + R + 0  + N  + Y + M
 26 + 24 + 9 + 12 + 13 + 2 + 14  = 100

 My thoughts were to download a list of words in the dictionary, then read
 the file and somehow replace each letter by its number, then add each
letter
 for each word and see which words would equal to 100.

 So I am emailing this list for any suggestions or examples of code that I
 can use to accomplish this. Any help?

 Thanks much.






-- 
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: include path-problem

2001-09-10 Thread _lallous

Try use absolute path reference,

I can't see your problem!?
If you have this file:
/home/websitename/www/include/news.txt
whether you access it from /index2.php or /support/shop.php all the same!

You might also want to refer yourself to the include_path variable
configuration.


[EMAIL PROTECTED] wrote in message
001201c139f6$e1d51220$0100a8c0@pentium333">news:001201c139f6$e1d51220$0100a8c0@pentium333...
Hi

I have a problem with the include command.I want to include a txt file in a
php file.But this txt file must include in every php file on the server and
these phpfiles are in different directories.
Here is the Problem :
www.domain.com/index2.php and www.domain.com/support/shop.php must include
the txt file from www.domain.com/includes/news.txt.

So i used for this problem ?php include(/server/path/includes/news.txt);
? for every php file.But this works only for the www.domain.com/index2.php
file.

So what should i do to get the txt file in the
www.domain.com/support/shop.php file ?
Thank you very much for support !!!

chris




-- 
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: problem in downloading manual

2001-09-10 Thread _lallous

Did you try to dload the manual from PHP site's mirrors?

S.Maria Goretti20010808 [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi All,
 I am trying to download php mauals. but I couldn't suceed as the server
 is displaying the message
 as Server is Busy and try later. Even  I tried by using the link
 with port number.

 Can anybody help me in downloading the manulas?

 Regards,
 Maria




-- 
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: New to PHP, just looking for resources is all =)

2001-09-10 Thread _lallous

http://www.weberdev.com/
http://www.phpbuilder.com
http://www.zend.com


Pete Lopez [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 Hi there,

 I am new to PHP and mySQL.  I am a fairly quick learner and have set up a
 script to add/modify/delete entries from a mySQL database and display them
 in a table.

 My first question is, where or how can I get information on how to only
 allow certain people to add and then modify what they have added based on
 their user name and password?

 Right now, anyone use the script and add/delete/modify all entries.  I
need
 to create a way for everyone to be able to register a username then be
able
 to login.

 The other thing I wanted to know was where I could get any information on
 building a completely database driven site.  A lot of sites have
references
 to content but none that I have come across tell you how to use the
database
 to display things like images, imagebars, buttons, and so on.

 I am not asking for any one-on-one help here(I realize most of you have
 lives and dont have the time for that, although I would most certainly
 appreciate it, heh =))  Any links or references you could provide would be
 MOST helpful.  Also any good books on PHP and building database driven
 websites using PHP and mySQL.

 Thanks in advance,
 Pete





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




  1   2   >