OSEC

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 28 Jan 2006 20:47:26 -0000 Issue 3932

php-general-digest-helplists.php.net
Date: Sat Jan 28 2006 - 14:47:26 CST


php-general Digest 28 Jan 2006 20:47:26 -0000 Issue 3932

Topics (messages 229393 through 229406):

ID vs NAME in different browsers
        229393 by: Niels
        229401 by: Jason Petersen
        229404 by: Niels
        229405 by: David Hall

Re: Apache is not parsing .php files
        229394 by: sanjay

Re: Please help with apache 2
        229395 by: PHP

Re: A black thumbnail.
        229396 by: tedd
        229397 by: tedd
        229398 by: tedd
        229403 by: Weber Sites LTD

A black thumbnail. (Solved)
        229399 by: tedd

query regarding forms
        229400 by: suresh kumar
        229406 by: Miles Thompson

Re: absolute vs relative path?
        229402 by: Jason Petersen

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hi,

when making an input field for submission from a form, I need to put a
name='something' in it. For CSS I often use an id='something'. Some
browsers apparently submit the field properly if name is missing and id is
present. Others might not. Can anyone tell me about what browsers do what?

Thanks,
Niels

attached mail follows:


On 1/28/06, Niels <zorglub_olsenhotmail.com> wrote:

when making an input field for submission from a form, I need to put a
> name='something' in it. For CSS I often use an id='something'. Some
> browsers apparently submit the field properly if name is missing and id is
> present. Others might not. Can anyone tell me about what browsers do what?

HTML Forms should always use the NAME attribute to pass values, never ID.
You can use print_r($_REQUEST); at the top of your script to debug.

Jason

attached mail follows:


On Saturday 28 January 2006 16:47, Jason Petersen wrote:

> HTML Forms should always use the NAME attribute to pass values, never ID.
> You can use print_r($_REQUEST); at the top of your script to debug.
>

Thank you for your answer. W3C says:

[http://www.w3.org/TR/html4/interact/forms.html]

name = cdata [CI]
This attribute names the element so that it may be referred to from style
sheets or scripts. Note. This attribute has been included for backwards
compatibility. Applications should use the id attribute to identify
elements.

So my question remains: How well do browsers support using only id?

//Niels

attached mail follows:


Niels wrote:

> name = cdata [CI]
> This attribute names the element so that it may be referred to from style
> sheets or scripts. Note. This attribute has been included for backwards
> compatibility. Applications should use the id attribute to identify
> elements.
>

Uh, sorry to disappoint, but that's a description of the form element,
not of the input element or select input.

In fact, if you go to
http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.4.2
, you will see that the example form quite clearly uses name. And for
the input element,
http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#h-17.4.2
says that name assigns the control name.

The attributes for the form element are completely independent of the
input elements. (Note, for things like radio buttons, using id makes no
sense. You must have multiple elements with the same name. If you used
id for these multiple elements, you would be breaking the rules of html
saying only one element can have a certain id . . .)

David Hall

attached mail follows:


Thanks for the help.

Yeah problem was with php.ini file.

Entry for memory limit is 12MB in the file actually it should read 12M (not 12MB).

sanjay
www.apptility.com

Richard Lynch wrote:

>On Thu, January 26, 2006 2:19 pm, sanjay wrote:
>
>
>>I have a strange problem while trying to run php based applications.
>>
>>Lets start with phpMyAdmin, a very popular open source tool to manage
>>MySQL written in php.
>>I have already installed phpMyAdmin and was running fine.
>>One day suddenly when I pointed my browser at :
>>http://localhost/phpMyAdmin
>>Instead of running the phpMyAdmin browser opened a message window with
>>options-
>>"Open With" or "Save to disk" .
>>I am sure its not browser problem because I tried on Firefox-1.5,
>>Mozilla, Epiphany and Konqueror.
>>
>>One more point I would like to add here that if I write one small php
>>program and
>>save it in as php file (test.php) then
>>http://localhost/test.php
>>executes properly
>>
>>I am using Fedora 2 and apache2, php-4.3x and mysql-3.x were part of
>>the
>>Fedora installation.
>>The only change I made in the /etc/php.ini file was to increase the
>>memory limit from 8MB to 12MB.
>>(Then restarted the http server)
>>Now even php.ini file is in the original state but problem is still
>>there.
>>The http.conf file is unchanged.
>>
>>
>>Can any one give me some sort of idea.
>>
>>
>
>My first WILD GUESS is that way long time ago, you changed httpd.conf
>and/or php.ini, but forgot to re-start Apache, and then tested, and
>everything worked, so you went on.
>
>Now, when you HAVE re-started Apache, your "fix" from ages ago is
>finally kicking in, and you have no recollection of that change.
>
>If you have log files or notes of changes made previously, especially
>to httpd.conf, php.ini, or .htaccess, review them -- Keep in mind that
>what you are calling your "original" httpd.conf and php.ini file are,
>in fact, the ones you modified oh so long ago.
>
>Another tack you can take is to go ahead and save what the browser is
>sending you and look at it and see what it looks like.
>
>PHP Source?
>
>Or something else?
>
>Also use telnet or curl (from another box) or similar to get the
>headers and HTML that is coming out from the broken pages.
>
>
>

attached mail follows:


Hi,
Thanks, putting the addtype in the <directory> section seems to have solved
the problem.

----- Original Message -----
From: "Dan Trainor" <infohostinthebox.net>
To: "PHP" <php_listibcnetwork.net>
Sent: Friday, January 27, 2006 6:09 PM
Subject: Re: [PHP] Please help with apache 2

> PHP wrote:
>> Help, I can't find anything on this.
>> I upgraded from apache 1.3 to apache 2.2
>> My problem is, I currently have .htm files being parsed as php, that
>> works fine.
>> However, if I have the php_engine turned off for a directory, any .htm
>> files will now prompt firefox to download it.
>> How do I stop this? I need to keep .htm files parsed for php, but I also
>> need to be able to turn php off for certain directories and still allow
>> regular .htm files to be seen.
>> Thanks.
>>
>
> Hi -
>
> Looks like AddType can be used on a per-container (directory container,
> virtual host container, or even from htaccess, that is)-basis. Consider
> using this to parse PHP via .html pages. Then, you could leave php_engine
> on for the rest of the site.
>
> Hope that helps
> -dant
>
>

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 1/27/2006

attached mail follows:


Hi again:

I said:

>I'm trying to create a thumbnail from a jpeg stored in a long blob in mySQL.

---
-philip said:

>imagecreatefromjpeg takes a *filename* not the actual contents of
>the file itself.

Yes, you are correct that in the statement:

$image = imagecreatefromjpeg($fileContent);

The variable $fileContent should be a file name -- but it's the
contents of the file that the function uses. So, what's the
difference between a filename and its contents? Is there a header I
should add? Or does the routine require a read operation?

I'll look at some other functions.

Thanks for your help.

tedd
--
--------------------------------------------------------------------------------
http://sperling.com/

attached mail follows:


Hi again:

I said:

>I'm trying to create a thumbnail from a jpeg stored in a long blob in mySQL.

---
Richard said:

Dynamic Thumbnail generation:
<http://www.weberdev.com/ViewArticle-388.html>http://www.weberdev.com/ViewArticle-388.html

Yes, that's for generating a thumbnail from a file -- but I want to
do it directly from a stored image from mySQL.

Any ideas?

Thanks for your help.

tedd
--
--------------------------------------------------------------------------------
http://sperling.com/

attached mail follows:


Hi again:

I said:

>I'm trying to create a thumbnail from a jpeg stored in a long blob in mySQL.

---
berber said:

Check out this article : http://www.weberdev.com/ViewArticle-3.html

This article is for uploading, storing and displaying images from
mySQL, but no thumbnail.

Any ideas?

Thanks for your help.

tedd

--
--------------------------------------------------------------------------------
http://sperling.com/

attached mail follows:


I don't see any article / example that takes care of it all and also shows a
thumb :)
So the previous article shoed everything but the thumb, try this one for the
thumb :

http://www.weberdev.com/ViewArticle-388.html

berber

-----Original Message-----
From: tedd [mailto:teddsperling.com]
Sent: Saturday, January 28, 2006 4:56 PM
To: php-generallists.php.net
Subject: Re: [PHP] A black thumbnail.

Hi again:

I said:

>I'm trying to create a thumbnail from a jpeg stored in a long blob in
mySQL.

---
berber said:

Check out this article : http://www.weberdev.com/ViewArticle-3.html

This article is for uploading, storing and displaying images from mySQL, but
no thumbnail.

Any ideas?

Thanks for your help.

tedd

--
----------------------------------------------------------------------------
----
http://sperling.com/

--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php

attached mail follows:


Hi:

The following works for me. It takes an image from mySQL (which is
stored as a string, duh!) and creates a thumbnail "on the fly".

Many thanks for your ideas -- you made me think.

tedd

<code>

$dbQuery = "SELECT image_type, image, image_width, image_height ";
$dbQuery .= "FROM pictures ";
$dbQuery .= "WHERE image_Id = $pic_id";
$result = mysql_query($dbQuery) or die("Couldn't get file list");

if(mysql_num_rows($result) == 1)
{
$fileType = mysql_result($result, 0, "image_type");
$fileContent = mysql_result($result, 0, "image");
$width_orig = mysql_result($result, 0, "image_width");
$height_orig = mysql_result($result, 0, "image_height");

// Set a maximum height and width
$width = 200;
$height = 200;

if ($width && ($width_orig < $height_orig))
    {
    $width = ($height / $height_orig) * $width_orig;
    }
else
    {
    $height = ($width / $width_orig) * $height_orig;
    }

// Resample
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefromstring($fileContent);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height,
$width_orig, $height_orig);

// Output
imagejpeg($image_p, null, 100);
}

</code>
--
--------------------------------------------------------------------------------
http://sperling.com/

attached mail follows:


hi,
    i am having 3 files Login.php,home.php and
home1.php when i entered username and passwd in my
first login page i want want i entered as username and
passwd in my third page ie home1.php.

                                        A.suresh

                
__________________________________________________________
Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com

attached mail follows:


At 11:20 AM 1/28/2006, suresh kumar wrote:

>hi,
> i am having 3 files Login.php,home.php and
>home1.php when i entered username and passwd in my
>first login page i want want i entered as username and
>passwd in my third page ie home1.php.
>
> A.suresh

That's nice.

Now go check out the basic tutorials on the main PHP page. Click "Getting
help", then the "links" under the heading "Sample Code". When the PHP Links
page loads, scroll down to Tutorials.

http://ca3.php.net/links.php

Work through a couple, then check out how PHP does sessions so you do not
have to pass stuff through the URL.

Cheers - Miles

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 267.14.23/243 - Release Date: 1/27/2006

attached mail follows:


On 1/25/06, William Stokes <kallesoperamail.com> wrote:
>
>
> I Have a web site on one server and a test site on another. How can I
> build
> the hyperlinks so that they work on both servers without modification.
>

The cleanest solution is to use relative paths so that your site will work
regardless of where it's placed on the web server. Sometimes it can be
tricky to determine what the relative path should be, but PHP can help solve
that. Simply write a function or method to calculate the path to the base
directory of the site. Make this a global variable and echo it before any
path to a resource on the site.

global $PATH;

echo "<a href=\"{$PATH}images/blah.gif\" />\n";

Jason