|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 21 Jun 2004 01:53:39 -0000 Issue 2833
php-general-digest-help
lists.php.net
Date: Sun Jun 20 2004 - 20:53:39 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 21 Jun 2004 01:53:39 -0000 Issue 2833
Topics (messages 188692 through 188720):
Re: variable question
188692 by: Daniel Clark
Re: umm i am confused...
188693 by: Daniel Clark
Re: how to iterate over fields names with mysql_fetch_assoc
188694 by: franciccio
Re: is there any application ,
188695 by: Marek Kilimajer
188696 by: Greg Donald
Re: Auth_User
188697 by: Gerben
Mysql fetch_row()
188698 by: Gerben
188699 by: Greg Donald
188700 by: rich
188702 by: Daniel Clark
188707 by: Kim Steinhaug
Re: Why is PHP Segmentation Faulting?!?!?!?
188701 by: Marek Kilimajer
MySql Close problem
188703 by: Erik Gjertsen
comparing timestamps
188704 by: Chris Mach
188705 by: Kim Steinhaug
188709 by: Marek Kilimajer
Re: is there any application , by using i can produce php exe files in windows ?
188706 by: Kim Steinhaug
188708 by: Marek Kilimajer
188718 by: David Bevan
Re: Can I detect size of files which are too large to upload?
188710 by: Kim Steinhaug
Printing invoices
188711 by: bskolb
188712 by: Manuel Lemos
188713 by: Larry Brown
hi all can you read me ?
188714 by: Pierre
188715 by: Joel Kitching
188716 by: Marek Kilimajer
188717 by: Michael Lauzon
plz help!compiled php but iam still getting old version ???
188719 by: Ravi
188720 by: Michael Lauzon
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
How about:
eval( '$lie' . x ) ;
>>is there a way to use one variable to create another?
>>Example
>>$poo=1
>>and i want
>>$lie1
>>OR
>>$poo=2
>>and i want
>>$lie2
attached mail follows:
Looks like several lines need quotes around the print statements and \" inside.
print("<tr><td><form Method=\"GET\" action=\"module/personal/delete.php\">delete</td></tr>");
>><?php
>>//the function for adding new addresses
>>function loop_new_address($loopnum,$url,$name){
>>//the ${'link' . $loopnum} says put $link and add $loopnum to the end
>>if(isset(${'link' . $loopnum . '})){
>>loop_new_adderss($loopnum+1,$url,$name);
>>};
>>else{
>>setcookie("link" . $loopnum . "",$url,time()+3600*200);
>>setcookie("name" . $loopnum . "",$name,time()+3600*200);
>>print(<a href=$url>$name</a> was added);
>>};
>>};
>>if(isset($_GET[new])) {
>>loop_new_address(1,$_GET[name],$_GET[url]);
>>};
>>print(<table>);
>>print(<tr><td><form Method="GET"
>>action="module/personal/delete.php">delete</td></tr>);
>>//write code
>>$writenum=1;
>>while(isset(${'link' . $writenum . ''}));
>>print(<a href=${'link' . $writenum . ''}>${'name' . $writenum . ''}</a>);
>>};
>>include('links.htm')
>>?>
>><tr><td><input type=submit value="Delete Checked"></form></td></tr>
>></table>
>><table>
>><tr><td><form METHOD="GET" ACTION="module/personal/links.php"><input
>>type=hidden name=new value=1></td><td></td></tr>
>><tr><td>Site name</td><td><INPUT TYPE=text NAME="name" VALUE=""></td></tr>
>><tr><td>site url (if it is not on this site it MUST contain
>>"http://")</td><td><INPUT TYPE=text NAME="url" VALUE=""></td></tr>
>><tr><td></td><td><INPUT TYPE="SUBMIT" VALUE="Continue"></form></td></tr>
>></table>
attached mail follows:
Something easier:
while ($row=mysql_fetch_assoc($result)) {
foreach ($row as $k=> $val) {
switch ($k) {
case 'artist_name':
// do sometihing here, you may want to use $val;
break;
case 'urlPath':
// do something here you may want to use $val;
break;
default:
// do default action in case none is matching case value
(default is optional)
}//end switch
}//end foreach
}//end while
You need to go through the $result anyway, remember that $result is a
"resource" type it is wath is called a "recordset" in asp, it's kind of
object you have to "manipulate" to extract information from.
Franciccio
<grahama
siren.cc> ha scritto nel messaggio
news:C2D83DA6-C23B-11D8-A60C-0050E4509E27
siren.cc...
> thanks...that is what I had used previously :)
>
> Another php coder had given me a hint that I could just take each
> incoming row on the fly with $row['artist_name'] without reading
> everything into an array:
>
> What I had previously was:
> while ($row = mysql_fetch_assoc($result))
> {
> $playlist[] = $row; //read in entire array before doing anything
> }
>
> # get row count
> $c= count($playlist);
>
> for ($x = 0; $x < $c; $x++)
> {
> foreach($playlist[$x] as $key => $val)
> {
> switch ($key)
> {
> # if key name is 'artist_name', do something
> case 'artist_name' :
>
> break;
>
> # if key name is 'urlPath', do something
> case 'urlPath' :
>
> break;
> }
> }
> }
>
> is there a way to grab the info on the fly without reading the $result
> into an array ?
>
> many thanks as I am on my 3rd week with php....
>
>
>
> On Jun 19, 2004, at 1:45 PM, Robin Vickery wrote:
>
> > On Sat, 19 Jun 2004 13:25:54 -0700, grahama
siren.cc
> > <grahama
siren.cc> wrote:
> >>
> >> How do I iterate over fields when I perform the below script:
> > ...
> >> If I write the below code, I only get the first field name of each
> >> row...which makes sense
> >> In this case, I get 'artist_name'
> >>
> >> while ($row = mysql_fetch_assoc($result))
> >> {
> >> $fieldName= key($row);
> >> echo 'fieldName is: '.$fieldName."\n";
> >> }
> >
> > <?php
> > while ($row = mysql_fetch_assoc($result)) {
> > foreach ($row as $fieldName => $fieldValue) {
> > echo 'fieldName is: '.$fieldName."\n";
> > echo 'fieldValue is: '.$fieldValue."\n";
> > }
> > }
> > ?>
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
attached mail follows:
Lester Caine wrote --- napísal::
> Ravi wrote:
>
>> is there any windows application , by using we can produce standalone php
>> ..exe files ?
Try http://www.roadsend.com/home/index.php?pageID=compiler
>
>
> No - PHP runs on the server and produces pages for any browser.
Not true, php can be also used from commad line, php-gtk even enables
you to create window gui applications.
attached mail follows:
On Sun, 20 Jun 2004 16:46:04 +0200, Marek Kilimajer <lists
kilimajer.net> wrote:
>
> Not true, php can be also used from commad line, php-gtk even enables
> you to create window gui applications.
Yeah.. the little PHP/OpenGL thingy on /. last week was pretty much
standalone, no apache server was distributed with that. People seem
to be doing all sorts of things with PHP lately.
I've made a couple little php-gtk apps, it's pretty simple and the run
really fast too.
--
Greg Donald
http://destiney.com/
attached mail follows:
This var means something else
when you write the following code:
Header("WWW-Authenticate: Basic realm=\"Enter username and password\"");
Header("HTTP/1.0 401 Unauthorized");
Your browser will produce a popup requesting a username an password
This it what you get returned when using $_SERVER['AUTH_USER']
"Gabor NiederläNder" <gabor.niederlaender
wu-wien.ac.at> wrote in message
news:20040620111141.22566.qmail
pb1.pair.com...
> Hi!
>
> I have installed a Apache Server (+php) in a Windows NT network. I
> would like to identify the Windows NT user visiting my php pages.
> When I was using IIS, I think it was quite easy to find it out through
> the $_SERVER['AUTH_USER'] variable. But it doesn't seem to work with
> apache. Is there another way?
>
> Cheers,
> Gabor
attached mail follows:
when I call mysql_fetch_row() I get an array, but this Array doesn't have
the fieldnames as array-keys.
I've seen several codes from others where they use something like
print $row['key'];
This doesn't work on my server. Is this because my server-software is too
old or am I using the wrong function?
PHP Version 4.3.4
mySQL version: 3.23.54
attached mail follows:
On Sun, 20 Jun 2004 19:05:31 +0200, Gerben <gerbendekeijzer
12move.nl> wrote:
>
> when I call mysql_fetch_row() I get an array, but this Array doesn't have
> the fieldnames as array-keys.
> I've seen several codes from others where they use something like
>
> print $row['key'];
'key' simply needs to be the primary key's field name you made when
you made the table or whatever. If you named you primary key 'key'
then your good, else use what it's really named. You can use PHP's
key() function with an associative array but I find I rarely need it
as I usually already know the field names and the primary keys of all
my tables.
--
Greg Donald
http://destiney.com/
attached mail follows:
> when I call mysql_fetch_row() I get an array, but this Array doesn't have
> the fieldnames as array-keys.
> I've seen several codes from others where they use something like
>
> print $row['key'];
>
> This doesn't work on my server. Is this because my server-software is too
> old or am I using the wrong function?
...the wrong function - use mysql_fetch_assoc()
rich
attached mail follows:
Use mysql_fetch_assoc() for fieldnames
>>when I call mysql_fetch_row() I get an array, but this Array doesn't have
>>the fieldnames as array-keys.
>>I've seen several codes from others where they use something like
>>
>>print $row['key'];
>>
>>This doesn't work on my server. Is this because my server-software is too
>>old or am I using the wrong function?
>>PHP Version 4.3.4
>>mySQL version: 3.23.54
attached mail follows:
Whatabout :
mysql_fetch_array()
or
mysql_fetch_object()
Both gives you both the results and the names of the coloumns.
Maby I didnt get the question right but since nobody else mentioned it, .)
--
--
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------
"Gerben" <gerbendekeijzer
12move.nl> wrote in message
news:20040620170525.85393.qmail
pb1.pair.com...
> when I call mysql_fetch_row() I get an array, but this Array doesn't have
> the fieldnames as array-keys.
> I've seen several codes from others where they use something like
>
> print $row['key'];
>
> This doesn't work on my server. Is this because my server-software is too
> old or am I using the wrong function?
> PHP Version 4.3.4
> mySQL version: 3.23.54
attached mail follows:
Jeff wrote --- napísal::
> Hey all....
>
> Total PHP newbie here. I posted a day ago about php working
> 'intermittently'. I was told to check my apache logs which was a good hint
> cause php is seg faulting. I've broken it down to my connection script to my
> database and I ran it in gdb to see if it would tell me anything. Since I am
> linux-tarded I don't have any clue what the problem is.
>
>
>
> WTF is the problem. I have a feeling my script sucks and I am doing
> something totally stupid
>
The problem is certainly not in your script, php should handle
gracefully any code. You did not mention what php version you are using,
try to upgrade to the latest version and see if it helps. Also try to
run your script with another php installation, if that helps recompile
your own installation.
The script works fine here, php-5.0.0RC3
attached mail follows:
I have problem with mysql_close
I dont understand why.
Are ther someone that have any proposal?
Thank for any help
Erik Gjertsen
Here is the code
$query = "SELECT usrid FROM users WHERE username";
$result =
mysql_query ($query); //Run the query
if (mysql_num_rows($result) == 0) { // Make the query
$query = "INSERT INTO users (username, name, email, password, registration_date) VALUES
('$username', '$name', '$email', '$password', NOW() )";
$result =
mysql_query ($query);
if ($result) { // IF it ran OK
// Send an email, if desired
echo '<p><b>You have been registered!</b></P>';
include("./footer.inc");
exit();
} else { // If it did not ron OK.
$message = '<p>You cout not be registered due to a system error. We apologize for any inconvenience</p>';
}
} else {
$message = '<p>That username is alredy taken.</p>';
}
mysql_close();
} else {
$message = '<p>Please try again.</p>';
}
} // End of the main submit conditional.
// Print the error message if ther is one
if (isset($message)) {
echo '<font color="red">', $message, '</font>';
)
attached mail follows:
I want to compare a timestamp in my database with the current time. I want to be able to tell if the timestamp is within 5 mins of the current time. How would I do this?
Please?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.708 / Virus Database: 464 - Release Date: 18-Jun-2004
attached mail follows:
Well,
Since the current timestamt is now, and 5 minutes equals 60seconds * 5
minutes = 300,
this would give you your range as :
$range = time() - 300;
If you are working with time() in your database your select would be
something like :
select * from table where timestamp >= $range
--
--
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------
"Chris Mach" <cjmach
gto.net> wrote in message
news:20040620222623.65589.qmail
pb1.pair.com...
I want to compare a timestamp in my database with the current time. I want
to be able to tell if the timestamp is within 5 mins of the current time.
How would I do this?
Please?
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.708 / Virus Database: 464 - Release Date: 18-Jun-2004
attached mail follows:
Chris Mach wrote --- napísal::
> I want to compare a timestamp in my database with the current time. I want to be able to tell if the timestamp is within 5 mins of the current time. How would I do this?
>
> Please?
>
timestamp_column BETWEEN UNIX_TIMESTAMP(NOW() - INTERVAL 5 MINUTE) AND
UNIX_TIMESTAMP(NOW() + INTERVAL 5 MINUTE)
attached mail follows:
Well,
You could have a look at this one, http://gtk.php.net/
Though I never had the lucury of getting anywhere with it, it
has the possibility to create standalone EXE. There is (Atleast the last
time i checked) still a problem with the EXE opening an extra command prompt
window, which makes it look abit "unprofessional" if your thinking of
applying
somthing for your business customer.
--
--
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------
"Ravi" <ravi
guduru.com> wrote in message
news:33024.192.168.50.2.1087806028.squirrel
192.168.50.2...
> HI,
>
> is there any windows application , by using we can produce standalone php
> .exe files ?
>
>
> --- knowledge is power share it ---
attached mail follows:
Kim Steinhaug wrote --- napísal::
> Well,
>
> You could have a look at this one, http://gtk.php.net/
> Though I never had the lucury of getting anywhere with it, it
> has the possibility to create standalone EXE. There is (Atleast the last
> time i checked) still a problem with the EXE opening an extra command prompt
> window, which makes it look abit "unprofessional" if your thinking of
> applying
> somthing for your business customer.
>
That extension does not create exe files, they are normal php scripts
that use gtk functions.
The "window issue" can be solved, there is some kind of wrapper available.
attached mail follows:
Hi Ravi,
Not that I'm that far through the book yet, but Professional PHP4 by
Apress (ISBN: 1590592484) has a chapter about "Non-Web PHP Programming"
that you may want to check out.
Regards,
David Bevan
GetAnyIdeas Web Design
P. 416.452.9410
F. 416.570.4529
E. david.bevan
getanyideas.com
W. http://www.getanyideas.com
-----Original Message-----
From: Ravi [mailto:ravi
guduru.com]
Sent: Monday, June 21, 2004 4:20 AM
To: php-general
lists.php.net
Subject: [PHP] is there any application , by using i can produce php exe
files in windows ?
HI,
is there any windows application , by using we can produce standalone
php .exe files ?
--- knowledge is power share it ---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Well, there is really a short answer for this one.
NO!
I guess you want to inform the user that a 30MB file is
to much to handle for the default 2MB barrier of PHP.
Uploading the 30MB file to inform the user that 2MB is
what we can handle is kinda to late..
Ive been looking several times for systems that can tell me
the filesize before I upload the files / images. Javascript
doesnt have the rights, maby some javaapplet where the
user accepts the applet could do it. The best function Ive
seen so far is the image upload applet from the Gallery
team, ther are very close to being able to confront this
problem.
If you find a sollution be sure to inform me, I would love
to know it.
Happy hunting!
--
--
Kim Steinhaug
----------------------------------------------------------------------
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
----------------------------------------------------------------------
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
----------------------------------------------------------------------¨
"Pablo Gosse" <gossep
unbc.ca> wrote in message
news:68B99CBE9259DC4E8A788367AFD4D4D503058AB5
pg-adr-exch-01.adr.unbc.ca...
Hi folks. I'm just tweaking the file manager portion of my CMS, and am
wondering if there is any way I can identify the size of an uploaded
file which exceeded the upload_max_filesize? I'd like to be able to
tell the user the size of the file they tried to upload, in addition to
telling them the allowable maximum size.
It would seem logical to me that I would not be able to do this, since
if the file exceeds the limit set by upload_max_filesize then the upload
should not continue past that point.
Is this an accurate assumption?
Cheers and TIA.
Pablo
attached mail follows:
Could someone direct me to a printing solution from a static document that
would render variable data elements to be sent to a printer queue? I was
thing perhaps of an RTF for the static page, but can't seem to locate any
way of inserting the variable data, then spit out each occurrance to a
printer.
Thanks in advance!
attached mail follows:
Hello,
On 06/20/2004 08:30 PM, Bskolb wrote:
> Could someone direct me to a printing solution from a static document that
> would render variable data elements to be sent to a printer queue? I was
> thing perhaps of an RTF for the static page, but can't seem to locate any
> way of inserting the variable data, then spit out each occurrance to a
> printer.
If HTML would not do, how about sending in PDF as attachament?
You may want to try this class that can either send HTML messages or
messages with attachments:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
attached mail follows:
I would highly recommend pdf. I use it for different reports. I use
pdflib which my employer has gratiously afforded; however, I believe
there is an open source version. I don't know how well it works, but
pdflib creates some really attractive results.
Larry.
On Sun, 2004-06-20 at 19:33, Manuel Lemos wrote:
> Hello,
>
> On 06/20/2004 08:30 PM, Bskolb wrote:
> > Could someone direct me to a printing solution from a static document that
> > would render variable data elements to be sent to a printer queue? I was
> > thing perhaps of an RTF for the static page, but can't seem to locate any
> > way of inserting the variable data, then spit out each occurrance to a
> > printer.
>
> If HTML would not do, how about sending in PDF as attachament?
>
> You may want to try this class that can either send HTML messages or
> messages with attachments:
>
> http://www.phpclasses.org/mimemessage
>
>
> --
>
> Regards,
> Manuel Lemos
>
> PHP Classes - Free ready to use OOP components written in PHP
> http://www.phpclasses.org/
>
> PHP Reviews - Reviews of PHP books and other products
> http://www.phpclasses.org/reviews/
>
> Metastorage - Data object relational mapping layer generator
> http://www.meta-language.net/metastorage.html
attached mail follows:
Hi all just wanna check if you can read me
Thx
attached mail follows:
I'm not quite sure, do you have something written on you?
On Mon, 21 Jun 2004 01:51:51 +0200, Pierre <pierre
web-lance.com> wrote:
>
> Hi all just wanna check if you can read me
>
> Thx
>
>
attached mail follows:
Pierre wrote --- napísal::
> Hi all just wanna check if you can read me
>
> Thx
http://www.amazon.com/exec/obidos/tg/detail/-/0064432521/qid=1087779137
Well, I feel a little old to read you :-)
attached mail follows:
That's just to funny!
On Mon, 21 Jun 2004 02:55:58 +0200, Marek Kilimajer <lists
kilimajer.net> wrote:
>
> Pierre wrote --- napísal::
>
> > Hi all just wanna check if you can read me
> >
> > Thx
>
> http://www.amazon.com/exec/obidos/tg/detail/-/0064432521/qid=1087779137
>
> Well, I feel a little old to read you :-)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Michael Lauzon, Founder
The Quill Society
http://www.quillsociety.org/
mlauzon
quillsociety.org
attached mail follows:
HI,
existing configuration :
PHP Version 4.3.4 ( default rpm with fedora fc2 install)
Server version: Apache/2.0.49 (default with fedora fc2 install)
Server built: May 6 2004 07:15:13
NOw i want to install 4.3.3 , so i compiled and install ( with no errors )
if i type " php -v " at shell iam getting correct version *BUT if tried
phpinfo() in browser iam getting still OLD version :( restarted apache but
no use.
please help
- thanks for your time.
--- knowledge is power share it - ravi.us ---
attached mail follows:
Why do you want to install 4.3.3, when the latest version is 4.3.7?
On Mon, 21 Jun 2004 19:07:32 -0400 (EDT), Ravi <ravi
guduru.com> wrote:
>
> HI,
>
> existing configuration :
> PHP Version 4.3.4 ( default rpm with fedora fc2 install)
> Server version: Apache/2.0.49 (default with fedora fc2 install)
> Server built: May 6 2004 07:15:13
>
> NOw i want to install 4.3.3 , so i compiled and install ( with no errors )
> if i type " php -v " at shell iam getting correct version *BUT if tried
> phpinfo() in browser iam getting still OLD version :( restarted apache but
> no use.
>
> please help
>
> - thanks for your time.
>
> --- knowledge is power share it - ravi.us ---
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Michael Lauzon, Founder
The Quill Society
http://www.quillsociety.org/
mlauzon
quillsociety.org
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]