php-general Digest 12 Apr 2004 03:58:45 -0000 Issue 2700

Topics (messages 183124 through 183139):

Re: trying to output a hyperlink
        183124 by: Michal Migurski

Re: adding items to a list or menu
        183125 by: Robert

PHP5 RC1 rpms for Mandrake 10
        183126 by: Andrei Verovski (aka MacGuru)

function imagecreatefromjpeg pb
        183127 by: Cosas minovela
        183128 by: Cosas minovela

creating log files out of a delete statement
        183129 by: Andy B
        183133 by: John W. Holmes
        183136 by: Andy B
        183138 by: Robert Sossomon

using $_SESSION inside of user functions
        183130 by: Andy B
        183131 by: daniel.electroteque.org
        183132 by: Andy B
        183134 by: John W. Holmes
        183135 by: daniel.electroteque.org

How do you handle device detection?
        183137 by: Richard Davey
        183139 by: Lukasz Karapuda

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 ---
>Although, it could be shortened even more, to:
>
><td><?php $link = "<a href=\"".$row[2]."\">Click here</a>";
>       echo $link;?></td>

Or still more, to:
        <td><a href="<?= $row[2] ?>">Click Here</a></td>

...which starts to approach the original legibility of HTML for me, and
the syntax hilighting in BBEdit is corrrect. I've been tending to use
constructions like that instead of templating classes like smarty or
printf constructiions, and I've been very pleased with em.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

--- End Message ---
--- Begin Message ---
"R.G. Vervoort" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...
> Not sure if it is a php question but since i am working in php here it is.
> 
> Ho can i add items to (the item label=visual text and the value=index
> number) a list object on a website.
> 
> I am having a list with 4 items and i would like to add the text from a
> textfield (textfield1.value) to the list object so it will hold 5 items.
> 
> thanks for any suggestions
> 
> Roy
> The Netherlands

PHP is server side, it looks like you want to send items to a client
side app (javascript?) you could do something like this:

--->Snip!

<?php

$array = array('item1', 'item2', 'item3', 'item4'); //I use an array
here for simplicity, you could do the same with a dB query or the like

echo "<html>\n<head></head><!--javascript-->"; //Not a javascript guy,
but you get the point

foreach($array as $key=>$item) {
   echo "\n textdata.item$key=$item";
}

?>
<body> etc.....

<---

Not sure how javascript looks (started working with it in last 2 days)
but you can change that echo statement to what it should be in
javascript

Cheers!

Robert

--- End Message ---
--- Begin Message ---
Hi,

Anyone can suggest me where I can get PHP5 RC1 rpms (with possible max# of 
extensions) for Mandrake 10? I have tried to make them myself, but run into 
numerous problems.

Thanks in advance for any suggestion(s)

Andrei Verovski (aka MacGuru)

--- End Message ---
--- Begin Message ---
about GD, Warning: imagecreatefromjpeg(): '/var/www/html/datos/2004/02/crio25.jpg' is 
not a valid JPEG file. how can i solve it please?

image pass the EOF and BOF test, so this is not the problem :)

--- End Message ---
--- Begin Message ---
about GD, Warning: imagecreatefromjpeg(): '/var/www/html/datos/2004/02/crio25.jpg' is not a valid JPEG file. how can i solve it please?
 
image pass the EOF and BOF test, so this is not the problem :)
 
here you got the image with problems , i'm sorry about the content of image...
 
 

--- End Message ---
--- Begin Message ---
hi...

i have a section of a website that deletes records from a mysql table...
right now all the query is is a delete statement but i need to make a "log
file" in this format:
current time::username who executed delete:: deleted(name of record)::delete
completed
or delete failed depending on what happened... i can do all of the log
except dont exactly know how to extract the "Name" field of the deleted
record before it actually gets dumped.. that way i can use it on the log...

any ideas how to do it in the best way??

--- End Message ---
--- Begin Message --- Andy B wrote:

i have a section of a website that deletes records from a mysql table...
right now all the query is is a delete statement but i need to make a "log
file" in this format:
current time::username who executed delete:: deleted(name of record)::delete
completed
or delete failed depending on what happened... i can do all of the log
except dont exactly know how to extract the "Name" field of the deleted
record before it actually gets dumped.. that way i can use it on the log...

There's no way to extract it from the DELETE. You'll have to do a SELECT with the same parameters that you're going to do the DELETE with. Grab your data with the SELECT then execute the DELETE.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
got it will try that instead..

----- Original Message ----- 
From: "John W. Holmes" <[EMAIL PROTECTED]>
To: "Andy B" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, April 11, 2004 8:23 PM
Subject: Re: [PHP] creating log files out of a delete statement


> Andy B wrote:
>
> > i have a section of a website that deletes records from a mysql table...
> > right now all the query is is a delete statement but i need to make a
"log
> > file" in this format:
> > current time::username who executed delete:: deleted(name of
record)::delete
> > completed
> > or delete failed depending on what happened... i can do all of the log
> > except dont exactly know how to extract the "Name" field of the deleted
> > record before it actually gets dumped.. that way i can use it on the
log...
>
> There's no way to extract it from the DELETE. You'll have to do a SELECT
> with the same parameters that you're going to do the DELETE with. Grab
> your data with the SELECT then execute the DELETE.
>
> -- 
> ---John Holmes...
>
> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>
> php|architect: The Magazine for PHP Professionals – www.phparch.com
>
>

--- End Message ---
--- Begin Message ---
How are you passing the name through??  If using a form to do it then just
use the $_POST[name] or $_GET[name] in the logfile.  You have to have the
name pull in the previous page, just pass it through:

<input type="hidden" name="delete_record_name" value="selection_1">

or:
<a href="delete.php?delete_record_name=selection_1


next page:
if (!$_GET[delete_record_name])
 $del_name = $_POST[delete_record_name];
else
 $del_name = $_GET[delete_record_name];


$delete_item = "delete from db where name = '$del_name'";
 mysql_query($delete_item) or die(mysql_error());

HTH,
Robert

> got it will try that instead..
>
> ----- Original Message -----
> From: "John W. Holmes" <[EMAIL PROTECTED]>
> To: "Andy B" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Sunday, April 11, 2004 8:23 PM
> Subject: Re: [PHP] creating log files out of a delete statement
>
>
>> Andy B wrote:
>>
>> > i have a section of a website that deletes records from a mysql
>> table...
>> > right now all the query is is a delete statement but i need to make a
> "log
>> > file" in this format:
>> > current time::username who executed delete:: deleted(name of
> record)::delete
>> > completed
>> > or delete failed depending on what happened... i can do all of the log
>> > except dont exactly know how to extract the "Name" field of the
>> deleted
>> > record before it actually gets dumped.. that way i can use it on the
> log...
>>
>> There's no way to extract it from the DELETE. You'll have to do a SELECT
>> with the same parameters that you're going to do the DELETE with. Grab
>> your data with the SELECT then execute the DELETE.
>>
>> --
>> ---John Holmes...
>>
>> Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
>>
>> php|architect: The Magazine for PHP Professionals – www.phparch.com
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
//log function
//writes log files

function WriteLog($LogType){
switch($LogType:
case "login":
//use session vars here...
....}

--- End Message ---
--- Begin Message ---
> //log function
> //writes log files
>
> function WriteLog($LogType){
> switch($LogType:
> case "login":
> //use session vars here...
> ....}
>

What is the question ?

--- End Message ---
--- Begin Message ---
didnt know if it was possible to use $_SESSION vars in that function or any
user defined functions for that matter...


----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 11, 2004 8:11 PM
Subject: Re: [PHP] using $_SESSION inside of user functions


> > //log function
> > //writes log files
> >
> > function WriteLog($LogType){
> > switch($LogType:
> > case "login":
> > //use session vars here...
> > ....}
> >
>
> What is the question ?
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message --- Andy B wrote:

//log function
//writes log files

function WriteLog($LogType){
switch($LogType:
case "login":
//use session vars here...
....}

Yes.


--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
> Andy B wrote:
>
>> //log function
>> //writes log files
>>
>> function WriteLog($LogType){
>> switch($LogType:
>> case "login":
>> //use session vars here...
>> ....}
>
> Yes.
>

yes in the latest, all request methods are in the super global scope,
$_POST, $_GET, $_SERVER, $_SESSION and constants can be used within the
function

--- End Message ---
--- Begin Message ---
Hi all,

This is just a general question to get some ideas from the "wider
world" as it were.

Say you've finished your site. It looks lovely and works perfectly.
You have a CSS file for modern browsers and one that degrades for
text-only devices also. You even have a special "small width" version
for PDAs and the like.

So how do you go about detecting just what is looking at your site?
How would you handle detecting and then serving the same site for a
standard browser, a screen-reader, a PDA device or a WAP/mobile
device?

Any tips/suggestions gratefully listened to.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

--- End Message ---
--- Begin Message ---
Richard,

You would do that by looking at the user_agent parameter that is being send
by the browser to the server. PHP automatically places the user_agent
information in the superglobal: $_SERVER['HTTP_USER_AGENT']. The user_agent
string might seems cryptic, therefore PHP provides you a built-in function
for representing the user agent information in an object with properties
representing the features of the browser. The function is get_browser().
Link to documentation of this function:

http://www.php.net/manual/en/function.get-browser.php

Good luck,

Lukasz Karapuda




"Richard Davey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi all,
>
> This is just a general question to get some ideas from the "wider
> world" as it were.
>
> Say you've finished your site. It looks lovely and works perfectly.
> You have a CSS file for modern browsers and one that degrades for
> text-only devices also. You even have a special "small width" version
> for PDAs and the like.
>
> So how do you go about detecting just what is looking at your site?
> How would you handle detecting and then serving the same site for a
> standard browser, a screen-reader, a PDA device or a WAP/mobile
> device?
>
> Any tips/suggestions gratefully listened to.
>
> --
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html

--- End Message ---

Reply via email to