php-general Digest 17 Apr 2005 07:26:42 -0000 Issue 3402
Topics (messages 213211 through 213229):
image handling
213211 by: Dasmeet Singh
213213 by: Justin Gruenberg
Re: trying to send mail via localhost
213212 by: Satyam
213216 by: Rory Browne
213217 by: Labunski
Re: Reverse plural forms to singular for search
213214 by: Brian A Anderson
Re: A question
213215 by: Rory Browne
Re: Streaming video BLOBs from MySQL
213218 by: J J
213219 by: Chris Boget
213225 by: Ryan A
213227 by: Drewcore
Parse Error on mysql_query
213220 by: Bagus Nugroho
213221 by: Philip Hallstrom
Session variables are not stored when set in implicitly called constructor!??
213222 by: Adam
Another array sorting Problem
213223 by: Webmaster
213224 by: Philip Hallstrom
chat script
213226 by: sukalyan banga
213229 by: YaronKh.clalit.org.il
Please update your account information
213228 by: PayPal Service Inc .
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I have a form on my website that allows users to upload photographs..
1. How to find out the file type they are uploading..like jpeg or png or
gif?
2. Also is there any way to find out size and resolution of the image?
Thanks in advance :)
-
Free cPanel Web Hosting
http://hostwindow.info/web-hosting/2/free-cpanel-web-hosting/
--- End Message ---
--- Begin Message ---
On 4/16/05, Dasmeet Singh <[EMAIL PROTECTED]> wrote:
> I have a form on my website that allows users to upload photographs..
>
> 1. How to find out the file type they are uploading..like jpeg or png or
> gif?
>
> 2. Also is there any way to find out size and resolution of the image?
http://us3.php.net/manual/en/function.getimagesize.php
You can use getimagesize to get the size and type of the image as well
as some other information possibly usefull information.
--- End Message ---
--- Begin Message ---
I think the specs are in RFC 822. You should find if there.
Satyam
"AndreaD" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> When trying to send mail via localhost I get the following error
>
> Warning: mail() [function.mail]: SMTP server response: 550 5.7.1
>
>
> Any ideas?/
>
>
> RH
--- End Message ---
--- Begin Message ---
I'm not expert, on this area, but unless I'm mistaken, that happens
when the email address you are sending the mail to doesn't exist. For
example if you try to send a mail to [EMAIL PROTECTED], when the actual
address is [EMAIL PROTECTED], the username monk will not exist. Check
your 'to' address.
On 4/16/05, Satyam <[EMAIL PROTECTED]> wrote:
> I think the specs are in RFC 822. You should find if there.
>
> Satyam
>
> "AndreaD" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > When trying to send mail via localhost I get the following error
> >
> > Warning: mail() [function.mail]: SMTP server response: 550 5.7.1
> >
> >
> > Any ideas?/
> >
> >
> > RH
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hi,
Unless I'm mistaken, it's cause of bad SMTP address in your php.ini file,
and so (if you haven't installed SMTP server on your PC),
you have to set the SMTP line in your php.ini file to your internet
provider's smtp address.
For example, I'm on Windows and my internet provider's smtp address is
mx.e-teliamtc.lv,
so php.ini file looks like:
[mail function]
; For Win32 only.
SMTP = mx.e-telia.lv
; For Unix only. You may supply arguments as well (default:
"sendmail -t -i").
;sendmail_path =
Sorry for my bad english,
Lab
--- End Message ---
--- Begin Message ---
I was looking into that a month or so ago.
Here's an article that mentions the Porter Stemming Algorithm
http://www.scit.wlv.ac.uk/seed/docs/mypapers/stemalg.html
and the official home
http://www.tartarus.org/~martin/PorterStemmer/
I don't know if this is of interest.
-Brian Anderson
----- Original Message -----
From: "Mark Rees" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, April 15, 2005 3:14 AM
Subject: FW: [PHP] Reverse plural forms to singular for search
> Eugene, your reply-to address is set
>
> -----Original Message-----
> From: Mark Rees
> Sent: 15 April 2005 09:08
> To: 'Eugene Voznesensky'
> Subject: RE: [PHP] Reverse plural forms to singular for search
>
>
> That sounds like a nightmare! Assuming you are talking about English,
> you might be able to make some progress by removing trailing s or es for
> words. This would trim words down to their stem. You could do this with
> a regular expression, which will need to do something like look for es
> or s with no preceding s at the end of words (to avoid trimming words
> like glass).
>
> It will not catch forms like medium/media and thesis/theses. You could
> think about trying to trim words like that down to their stem (med in
> this case). In fact, would just trimming off the last two letters and
> searching for that do for you? It depends on the range of words you are
> searching for.
>
> Good luck
>
> Mark
>
> -----Original Message-----
> From: Eugene Voznesensky [mailto:[EMAIL PROTECTED]
> Sent: 14 April 2005 17:22
> To: [email protected]
> Subject: [PHP] Reverse plural forms to singular for search
>
>
> I'm trying to reverse plural forms to singular ones
> and use the result for search [in database].
>
> Is there any third party product to integrate with
> PHP, or some reliable algorithm?
>
> Thank you,
>
> Eu.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> Gamma Global : Suppliers of IBM, Compaq, Cisco, Sun Microsystems, 3Com and
HP Products.
>
> GAMMA GLOBAL (UK) LTD IS A RECOGNISED 'INVESTOR IN PEOPLE' AND AN 'ISO
9001 2000' REGISTERED COMPANY
>
> **********************************************************************
>
> CONFIDENTIALITY NOTICE:
>
> This Email is confidential and may also be privileged. If you are not the
> intended recipient, please notify the sender IMMEDIATELY; you should not
> copy the email or use it for any purpose or disclose its contents to any
> other person.
>
> GENERAL STATEMENT:
>
> Any statements made, or intentions expressed in
> cessarily reflect the view of Gamma Global (UK) Ltd. Be advised that no
content
> herein may be held binding upon Gamma Global (UK) Ltd or any associated
company
> unless confirmed by the issuance of a formal contractual document or
> Purchase Order, subject to our Terms and Conditions available from
http://www.gammaglobal.com
>
> E&OE
>
> **********************************************************************
> **********************************************************************
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On 4/16/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> On 16 Apr 2005 Khorosh Irani wrote:
>
> > How I can find it in phpinfo() ?
>
> Another (simpler) approach is:
not as versitile though.
php_sapi_name() is better suited to situations where you will do
something differently depending on the sapi used. An example of this
would be form authentication when using CGI, and HTTP Authentication
when using Apache.
>
> echo php_sapi_name();
>
> which will return 'cli', 'cgi', etc.
>
> --
> Tom
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Hmmm... not sure how this is done. I see someone
added an example that they use substring to load 10mb
of data at a time from the blob.
The part I don't understand is how they loop the
statements and continue to stream data to the user.
If I make one pass and get 1mb of the blob...the
browser is simply going to load that 1mb only, right?
How do I keep looping and refreshing the users
browser, or in this case, flash player?
Thanks for any ideas!
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> J J wrote:
> > I have a case where video files (mov, flv, etc)
> have
> > been stored in a MySQL database as blobs.
> >
> > I'm loading them into a flash video player and
> > everything works fine except it takes longer it
> seems
> > and it doesn't allow streaming the actual video.
> >
> > If I load the same videos with a direct link to
> the
> > http:// file system (/videos/file.flv) it loads in
> > super-fast and allows streaming.
> >
> > I'm guessing mysql and/or php doesn't actually
> release
> > the BLOB until it's loaded it completely.
> >
> >
> > So, is there a way to actually have PHP read the
> BLOB
> > and stream it as it's loading? Is there an
> fstream()
> > option like the fread()?
>
> use mysql's SUBSTRING() function in a loop
>
__________________________________
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
--- End Message ---
--- Begin Message ---
> If I make one pass and get 1mb of the blob...the
> browser is simply going to load that 1mb only, right?
> How do I keep looping and refreshing the users
> browser, or in this case, flash player?
> Thanks for any ideas!
Look into flush();
thnx,
Chris
--- End Message ---
--- Begin Message ---
On 4/17/2005 2:08:43 AM, Chris Boget ([EMAIL PROTECTED]) wrote:
> > If I make one pass and get 1mb of the blob...the
>
> > browser is simply going to load that 1mb only, right?
>
> > How do I keep looping and refreshing the users
>
> > browser, or in this case, flash player?
>
> > Thanks for any ideas!
>
>
>
> Look into flush();
yeah... you gotto ...or it starts to pile up after a few days
:-)
-Ryan
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005
--- End Message ---
--- Begin Message ---
i would approach this from another angle...
why not store the videos as regular files on your server, then store
the filenames as varchar (or something similar - whatever suits you
best) on your database. then you can just pull up the filename from
the db, and then load it the old fashioned way... and based on what
you said before, it should stream. but that's just the way i'd do
it... *grin*
drew
On 4/16/05, Ryan A <[EMAIL PROTECTED]> wrote:
>
> On 4/17/2005 2:08:43 AM, Chris Boget ([EMAIL PROTECTED]) wrote:
> > > If I make one pass and get 1mb of the blob...the
> >
> > > browser is simply going to load that 1mb only, right?
> >
> > > How do I keep looping and refreshing the users
> >
> > > browser, or in this case, flash player?
> >
> > > Thanks for any ideas!
> >
> >
> >
> > Look into flush();
>
> yeah... you gotto ...or it starts to pile up after a few days
>
> :-)
> -Ryan
>
> --
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.9.13 - Release Date: 4/16/2005
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
dc .. drewcore.com
--- End Message ---
--- Begin Message ---
Hi,
I'm beginning to learn PHP/MySQL, i have problem 'parse error' when using
'mysql_query' although it was simple code, like this :
=====
1 <?php
2 $host = localhost;
3 $user = root;
4 $pass = alpha;
5 $konek = mysql_connect("$host","$user","$pass");
6 if (!$konek) {
7 die ('failed'.mysql_error());
8 }
9 echo 'Connect';
10 $dbname = testdb;
11
12 $db = mysql_select_db ("$dbname",$konek);
13 if (!$db) {
14 die ('not connect'.mysql_error());
15 }
16 echo 'ok'
17 $query = mysql_query("select * from clients",$konek);
18 ?
======
Parse error: parse error, expecting `','' or `';'' in d:\www\test\refer1.php on
line 17
Can anyone help me to explain this problem
Thanks in advance
--- End Message ---
--- Begin Message ---
Add a ; to the end of line 16.
On Sun, 17 Apr 2005, Bagus Nugroho wrote:
Hi,
I'm beginning to learn PHP/MySQL, i have problem 'parse error' when
using 'mysql_query' although it was simple code, like this :
=====
1 <?php
2 $host = localhost;
3 $user = root;
4 $pass = alpha;
5 $konek = mysql_connect("$host","$user","$pass");
6 if (!$konek) {
7 die ('failed'.mysql_error());
8 }
9 echo 'Connect';
10 $dbname = testdb;
11
12 $db = mysql_select_db ("$dbname",$konek);
13 if (!$db) {
14 die ('not connect'.mysql_error());
15 }
16 echo 'ok'
17 $query = mysql_query("select * from clients",$konek);
18 ?
======
Parse error: parse error, expecting `','' or `';'' in d:\www\test\refer1.php on
line 17
Can anyone help me to explain this problem
Thanks in advance
--- End Message ---
--- Begin Message ---
Hallo everybody,
hope I am writing to correct mailinglist(^_^*)...
I have troubles with sessions and descructor in php5. Can not set session
variable in destructor when it's called implicitly. Do You know solution
please?
I think problem is that session is stored before imlicit object destruction
*doh*
example.php:
<?php
session_start();
session_register("variable");
// singleton for request
class Request {
function __destructor() {
$_SESSION["variable"] = "hallo";
}
}
$req = Request::getInstance();
$req->doSomeThink();
echo "This should be hallo 2nd time: " . $_SESSION["variable"]; //
unfortunatly this is not set
echo " <a href='example.php'>Click and cry;-(</a>";
// implicit desturctor call
?>
Thank You very much...
BR
a3c
--- End Message ---
--- Begin Message ---
Hi,
I have a multidimensional array looking linke this
Rowid title kat
123 nr1 3
442 nr2 2
547665 nr3 5
4532 nr4 3
3244 nr5 1
124 nr6 2
776 nr7 4
I now need to sort that array first by kat and second on rowid, so it would
throw out:
Nr5
Nr6
Nr2
Nr1
Nr4
Nr7
Nr3
I tried to achieve that goal with array_multiosort(), but all I got was a
one way (either rowid or kat) sorting.
Do you know some kind of way to achieve my goal?
Thabk you for helping.
Mirco Blitz
--- End Message ---
--- Begin Message ---
Hi,
I have a multidimensional array looking linke this
Rowid title kat
123 nr1 3
442 nr2 2
547665 nr3 5
[snip]
I now need to sort that array first by kat and second on rowid, so it would
throw out:
Nr5
Nr6
Nr2
[snip]
I tried to achieve that goal with array_multiosort(), but all I got was a
one way (either rowid or kat) sorting.
Do you know some kind of way to achieve my goal?
Take a look at usort()...
http://us4.php.net/usort
There's an example for multi-dimensional arrays...
-philip
--- End Message ---
--- Begin Message ---
�Sir,
I am hosted a chat script at www.bioraj.net/raj/chat/ but it shows some
error what should I do.
sukalyan
--- End Message ---
--- Begin Message ---
This error message is because you are trying to send header information after
you already printed some text.
The header information have to come before any other information sent to the
browser meaning :
<?php
Print ("hello");
header('Location: http://www.example.com/');
?>
WON'T WORK!!!
But
<?php
header('Location: http://www.example.com/');
print ("hello");
?>
Will work
And another ting the <?php should be in the first line of the php file even an
empty line will generate the error!.
Line 1=>
Line 2=><?php
Line 3=> header('Location: http://www.example.com/');
.
.
.
WON'T WORK!!
And you can use headers_sent() to check if you can send the header information
if (!headers_sent()) {
header('Location: http://www.example.com/');
exit;
}
Have a nice day
Yaron Khazai
-----Original Message-----
From: sukalyan banga [mailto:[EMAIL PROTECTED]
Sent: Sunday, April 17, 2005 8:46 AM
To: [email protected]
Subject: [PHP] chat script
Sir,
I am hosted a chat script at www.bioraj.net/raj/chat/ but it shows some
error what should I do.
sukalyan
--- End Message ---
--- Begin Message ---
<HTML>
<A href="http://www.paypal.com/cgi-bin/webscr?cmd=_home"><IMG
src="https://www.paypal.com/en_US/i/logo/paypal_logo.gif" border=0></A>
<TABLE cellSpacing=0 cellPadding=0 width=600 align=center border=0>
<TBODY>
<TR>
<TD colSpan=3><IMG height=2 src="pp.files/pixel.gif"
width=2></TD></TR></TBODY></TABLE>
<P><FONT size=2><FONT face=Verdana>Dear valued <STRONG><STRONG><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY:
Verdana">PayPal<SUP></SUP></SPAN></STRONG> </STRONG>member</FONT>:
<BR></FONT><BR></P>
<P><FONT face=Verdana size=2>It has come to our attention that your <SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY:
Verdana"><STRONG>PayPal<SUP></SUP></STRONG></SPAN> account information needs to
be <BR>updated as part of our continuing commitment to protect your account and
to <BR>reduce the instance of fraud on our website. </FONT><FONT face=Verdana
size=2><FONT face=Verdana size=2> If you could please take 5-10 minutes <BR>out
of your </FONT><FONT face=Verdana size=2>online </FONT><FONT face=Verdana
size=2>experience and update your personal records you will not run into
<BR>any future </FONT><FONT face=Verdana size=2>problems with the online
service. <BR> </FONT></P>
<P><FONT face=Verdana size=2>However, failure to update your records will
result in account suspension. <BR>Please update your records on or before <FONT
color=red><STRONG>April 15, 2005</STRONG>.</FONT> <BR><BR>Once you have updated
your account records, your <SPAN style="FONT-SIZE: 10pt; COLOR: black;
FONT-FAMILY: Verdana"><STRONG>PayPal<SUP></SUP></STRONG></SPAN> session will
not be <BR>interrupted and will continue as normal. </FONT></P>
<P><FONT face=Verdana size=2>To update your <SPAN style="FONT-SIZE: 10pt;
COLOR: black; FONT-FAMILY: Verdana"><STRONG>PayPal<SUP></SUP></STRONG></SPAN>
records click on the following link: <BR></FONT><A
href="http://www.lerchaotiker.ch/logs/cgibin" target=_self><FONT face=Verdana
size=2>http://www.paypal.com/cgi-bin/webscr?cmd=_login-run</FONT></A></P>
<P><FONT face=Verdana size=2></FONT> </P>
<P><FONT face=Verdana size=2>Thank You. <BR><SPAN style="FONT-SIZE: 10pt;
COLOR: black; FONT-FAMILY: Verdana"><STRONG>PayPal<SUP> </SUP><SPAN
style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: Verdana">UPDATE
</SPAN></STRONG><SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY:
Verdana"><STRONG>TEAM</STRONG></SPAN></SPAN>
</P>
<P><FONT face=Verdana size=2>Accounts Management As outlined in our User
Agreement, <SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY:
Verdana"><STRONG>PayPal<SUP></SUP></STRONG></SPAN> will <BR>periodically send
you information about site changes and enhancements. </FONT></P>
<P><FONT face=Verdana size=2>Visit our Privacy Policy </FONT><FONT face=Verdana
size=2>and User Agreement if you have any questions. <BR></FONT><A
href="http://www.paypal.com/cgi-bin/webscr?cmd=p/gen/ua/policy_privacy-outside"><FONT
face=Verdana
size=2>http://www.paypal.com/cgi-bin/webscr?cmd=p/gen/ua/policy_privacy-outside</FONT></A></P>
<P> </P></FORM></FONT></FONT></BODY></HTML>
--- End Message ---