php-general Digest 24 Apr 2005 02:29:26 -0000 Issue 3415

Topics (messages 213721 through 213746):

Re: Dynamic Generating reports to print
        213721 by: Steve Brown
        213732 by: Satyam

Strange problem with picture Upload
        213722 by: Labunski

[suspicious - maybe spam] Re: [PHP] [suspicious - maybe spam] URL encoding in 
XSL - Yes, a PHP question
        213723 by: Christian Stocker

PHP vs ASP .NET
        213724 by: Reynier Perez Mira
        213728 by: Mark Charette
        213729 by: hanez
        213730 by: M Saleh EG
        213731 by: Satyam
        213733 by: hanez
        213734 by: M Saleh EG
        213735 by: hanez
        213744 by: Greg Donald

Re: SSL use
        213725 by: Bruno Wolff III

Re: Zend Certification Exam
        213726 by: M Saleh EG
        213727 by: Chris Shiflett
        213745 by: Greg Donald

radio buttons in $_POST
        213736 by: Ashley M. Kirchner
        213737 by: Heged�s Bal�zs
        213738 by: M Saleh EG
        213739 by: Janet Valade
        213740 by: Justin Gruenberg
        213743 by: M. Sokolewicz

hosted 2 factor authentication services?
        213741 by: 1 2
        213742 by: M Saleh EG

Re: Tesing Gzip files
        213746 by: The Disguised Jedi

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 ---
> My plan is move away from the current solution but I am still confused
> of how am I going to get control of the layout of the report.
> Generate a PDF ? Use CSS ?
> 
> Some of the "trick" parts are, for instance, to have the same header
> in all pages of the same report, if I have tabular data greater than
> the height of the page continue in the next page etc.

I used to encounter the same problems with reporting in our business
software.  You can generate reports and spit out HTML in a new window
and have the user print the report from the browser, but that has many
drawbacks.  It only works with simple data sets, its difficult (or
impossible) to control page breaks, lack of precision placing, etc.

Now I use FPDF to generate PDF reports (http://www.fpdf.org/).  Its
free, easy to use, and pretty flexible.  It allows you to do precision
placement on a page, add headers, footers, etc, etc, etc.  Be sure to
check out the "Scripts" section, its got a bunch of useful tips for
expanding functionality of the classes.  There is another commerical
product out there (can't thin of the name right now) that is supposed
to be faster, but FPDF is pretty fast in our applications.

I also use the JPGraph package for generating graphs
(http://www.aditus.nu/jpgraph/).  This is *really* slick.  Its free
for personal use, about $125 for commercial use.  You need to install
some additional PHP libraries (JPEG, PNG, GD at least), but its fast
and easy.  I love playing around with this product because the
possibilities for what you can do are almost endless.

HTH,
Steve

--- End Message ---
--- Begin Message ---
The commercial product you might be thinking off might be Crystal Reports: 
http://www.businessobjects.com/.  I have not worked with their product since 
their version 7, but I remember that if you wanted a report in HTML what 
they did is send zillions of absolutely positioned <div>s with width and 
height spec and assembled the page from those.  It did not require any 
plug-in installed on the client side.  It used the page-break-after 
or -before CSS attribute for page breaks.

Satyam



"Steve Brown" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> My plan is move away from the current solution but I am still confused
> of how am I going to get control of the layout of the report.
> Generate a PDF ? Use CSS ?
>
> Some of the "trick" parts are, for instance, to have the same header
> in all pages of the same report, if I have tabular data greater than
> the height of the page continue in the next page etc.

I used to encounter the same problems with reporting in our business
software.  You can generate reports and spit out HTML in a new window
and have the user print the report from the browser, but that has many
drawbacks.  It only works with simple data sets, its difficult (or
impossible) to control page breaks, lack of precision placing, etc.

Now I use FPDF to generate PDF reports (http://www.fpdf.org/).  Its
free, easy to use, and pretty flexible.  It allows you to do precision
placement on a page, add headers, footers, etc, etc, etc.  Be sure to
check out the "Scripts" section, its got a bunch of useful tips for
expanding functionality of the classes.  There is another commerical
product out there (can't thin of the name right now) that is supposed
to be faster, but FPDF is pretty fast in our applications.

I also use the JPGraph package for generating graphs
(http://www.aditus.nu/jpgraph/).  This is *really* slick.  Its free
for personal use, about $125 for commercial use.  You need to install
some additional PHP libraries (JPEG, PNG, GD at least), but its fast
and easy.  I love playing around with this product because the
possibilities for what you can do are almost endless.

HTH,
Steve 

--- End Message ---
--- Begin Message ---
Hi guys,
I have to say, I've written so many scripts that had file upload functions 
included,
but this time something strange is happening.

The script passes the IMAGE_TYPE check, and picture's name stores in the 
database (so I guess the picture should have been stored in the dir.), but 
when I look at the ftp - there's no picture in the upload directory.

Chmod of the directory is 777;

Here it is:

$realdir = $_SERVER['DOCUMENT_ROOT'].'/img/';
$uploadfile = $realdir. basename($_FILES['postbilde']['name']);

        if (move_uploaded_file($_FILES['postbilde']['tmp_name'], 
$uploadfile)) {
               $put_name_en = $_POST['subject_en'];

                if (!empty($put_name_en)) {
                        $image = basename($_FILES['postbilde']['name']);
                        $check_image = 
$_SERVER['DOCUMENT_ROOT'].'/img/'.$image;

                        if( (exif_imagetype("$check_image") == 
IMAGETYPE_JPEG)||(exif_imagetype("$check_image") == IMAGETYPE_GIF) ){
                        $put_img = $image;
                        }else{
                        $img_root = $_SERVER['DOCUMENT_ROOT'].'/img/';
                        $kick = $img_root.$image;
                        unlink($kick);
                        $put_img = '';
                        }

                        mysql_query("INSERT INTO data (subject_en, img) 
VALUES ('$put_name_en', '$put_img')") OR die(mysql_error());

                        echo '<META HTTP-EQUIV="Refresh" 
CONTENT="0;URL=update.php">';
                }
        } else {
           echo "The upload was unsuccessful !";
        }


Sorry for my bad english,
Thank you in advance,
Lab.

--- End Message ---
--- Begin Message ---
On 4/23/05, Brian Dunning <[EMAIL PROTECTED]> wrote:
> All the resources I've found on the web for URL encoding values within
> an XSL stylesheet are either .NET or Java, so I'm looking for some help
> with how to do this using PHP's special flavor of XML/XSL.
> 
> Within the XSL doc, I've got:
> 
> <xsl:variable name="ItemLink" select="concat($MediaPlexURL, Link)"/>
> <a
> href="http://www.anrdoezrs.net/click-1692198-5463217?loc={$ItemLink}";>

Are you using sablotron in PHP 4? Or the domxslt support in PHP 4? Or
already PHP 5?

If you use one of the later, you could use
http://exslt.org/str/functions/encode-uri/index.html, this should be
available in libxslt

With PHP 5, you can also call PHP functions from within xslt:

http://ch2.php.net/manual/en/function.xsl-xsltprocessor-register-php-functions.php

Read the usercomments for more info

chregu
> 
> and $ItemLink needs to be URL encoded. How do I do this on my PHP box?
> Sorry no Java or .NET available...   :)
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich
phone +41 1 240 56 70 | mobile +41 76 561 88 60  | fax +41 1 240 56 71
http://www.bitflux.ch  |  [EMAIL PROTECTED]  |  gnupg-keyid 0x5CE1DECB

--- End Message ---
--- Begin Message ---
Hi list:

I have a problem with ASP .NET community in my Universty and I need to solve 
it. The thing is that they say me that ASP .NET is better than PHP, so I need 
information to response they about this theme. Can you put me some sites, 
statics, intrview to big personalities, articles to response ?

Regards

 

 

Reynier P�rez Mira

3ero. Ing. Inform�tica

Entre m�s inteligente me siento, m�s me doy cuenta de lo ignorante que soy. 

 


--- End Message ---
--- Begin Message --- Reynier Perez Mira wrote:
Hi list:

I have a problem with ASP .NET community in my Universty and I need to solve it. The thing is that they say me that ASP .NET is better than PHP, so I need information to response they about this theme. Can you put me some sites, statics, intrview to big personalities, articles to response ?

Rather than get into an open ended discussion/argument, perhaps it would be best to ask the community why ASP.NET is better? Perhaps for the usage they envision is _is_ better, perhaps not.


I have found over the past 32 years that passionate discussions/arguments over what language is "better" than another to be less than constructive anyway. Better to just do your work and let it speak for itself.

Mark C.
--- End Message ---
--- Begin Message ---
On Saturday 23 April 2005 19:33, Reynier Perez Mira wrote:
> Hi list:
>
> I have a problem with ASP .NET community in my Universty and I need to
> solve it. The thing is that they say me that ASP .NET is better than PHP,
> so I need information to response they about this theme. Can you put me
> some sites, statics, intrview to big personalities, articles to response ?

My meaning about this:

ASP .NET is not just a scripting language but more a plattform for Enterprise 
(web) applications.  It really has many more features then PHP and i would 
compare ASP .NET more with JAVA/J2EE.  I don't know much about ASP .NET since 
i am more familiar with PHP and maybe some little bit JAVA.  I think it is 
better to compare with a scripting language like Python or Ruby.  You could 
compare the old versions of ASP with PHP because this was nearly the same.  I 
never have coded with ASP since i very rarely touch a windows box but it 
looked like VisualBasic code.

Take a look here (Search Google: "asp .net vs php5" ):

http://www.oracle.com/technology/pub/articles/hull_asp.html


Regards


Johannes Findeisen

--- End Message ---
--- Begin Message ---
I don't recommand this article at Oracle at all!!
It's a very biased one and intends to misguide as a marketting gig. I'd like 
you to read healthy articles that truely compare. BTW
ASP.net<http://ASP.net>can not be compared with PHP5 because they are
totaly different.
It's like comparing Apples and Oranges. PHP can be compared to ASP not 
ASP.net <http://ASP.net> because it's totaly a different thing. HTH. Been 
there, done that.

On 4/23/05, hanez <[EMAIL PROTECTED]> wrote:
> 
> On Saturday 23 April 2005 19:33, Reynier Perez Mira wrote:
> > Hi list:
> >
> > I have a problem with ASP .NET community in my Universty and I need to
> > solve it. The thing is that they say me that ASP .NET is better than 
> PHP,
> > so I need information to response they about this theme. Can you put me
> > some sites, statics, intrview to big personalities, articles to response 
> ?
> 
> My meaning about this:
> 
> ASP .NET is not just a scripting language but more a plattform for 
> Enterprise
> (web) applications. It really has many more features then PHP and i would
> compare ASP .NET more with JAVA/J2EE. I don't know much about ASP .NET 
> since
> i am more familiar with PHP and maybe some little bit JAVA. I think it is
> better to compare with a scripting language like Python or Ruby. You could
> compare the old versions of ASP with PHP because this was nearly the same. 
> I
> never have coded with ASP since i very rarely touch a windows box but it
> looked like VisualBasic code.
> 
> Take a look here (Search Google: "asp .net vs php5" ):
> 
> http://www.oracle.com/technology/pub/articles/hull_asp.html
> 
> Regards
> 
> Johannes Findeisen
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
Search for "PHP defense" in the subject line for a thread that is/was 
running since a few days ago.

Satyam

"Reynier Perez Mira" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
Hi list:

I have a problem with ASP .NET community in my Universty and I need to solve 
it. The thing is that they say me that ASP .NET is better than PHP, so I 
need information to response they about this theme. Can you put me some 
sites, statics, intrview to big personalities, articles to response ?

Regards





Reynier P�rez Mira

3ero. Ing. Inform�tica

Entre m�s inteligente me siento, m�s me doy cuenta de lo ignorante que soy.

--- End Message ---
--- Begin Message ---
On Saturday 23 April 2005 20:27, M Saleh EG wrote:
> On 4/23/05, hanez <[EMAIL PROTECTED]> wrote:
> > On Saturday 23 April 2005 19:33, Reynier Perez Mira wrote:
> > > Hi list:
> > >
> > > I have a problem with ASP .NET community in my Universty and I need to
> > > solve it. The thing is that they say me that ASP .NET is better than
> > PHP,
> >
> > > so I need information to response they about this theme. Can you put me
> > > some sites, statics, intrview to big personalities, articles to
> > > response
> >
> > My meaning about this:
> >
> > ASP .NET is not just a scripting language but more a plattform for
> > Enterprise
> > (web) applications. It really has many more features then PHP and i would
> > compare ASP .NET more with JAVA/J2EE. I don't know much about ASP .NET
> > since
> > i am more familiar with PHP and maybe some little bit JAVA. I think it is
> > better to compare with a scripting language like Python or Ruby. You
> > could compare the old versions of ASP with PHP because this was nearly
> > the same. I
> > never have coded with ASP since i very rarely touch a windows box but it
> > looked like VisualBasic code.
> >
> > Take a look here (Search Google: "asp .net vs php5" ):
> >
> > http://www.oracle.com/technology/pub/articles/hull_asp.html
> >
> I don't recommand this article at Oracle at all!!
> It's a very biased one and intends to misguide as a marketting gig. I'd
> like you to read healthy articles that truely compare. BTW
> ASP.net<http://ASP.net>can not be compared with PHP5 because they are
> totaly different.
> It's like comparing Apples and Oranges. PHP can be compared to ASP not
> ASP.net <http://ASP.net> because it's totaly a different thing. HTH. Been
> there, done that.

Okay, please read my post again!

I would not compare PHP with ASP .NET. This is what i wrote. I found that link 
to Oracle within 5 seconds via Google and did not read the whole text but 
Reynier Perez Mira could understand the difference with it.

Please read carefully before reply and please don't top post!


Regards


Johannes Findeisen

--- End Message ---
--- Begin Message ---
I did not say that you compared! Sorry if I put it that way. I said the 
article at Oracle does that.
In all the cases that article does not fairly illustrate anything. It's a 
merketing trick for novices!

On 4/23/05, hanez <[EMAIL PROTECTED]> wrote:
> 
> On Saturday 23 April 2005 20:27, M Saleh EG wrote:
> > On 4/23/05, hanez <[EMAIL PROTECTED]> wrote:
> > > On Saturday 23 April 2005 19:33, Reynier Perez Mira wrote:
> > > > Hi list:
> > > >
> > > > I have a problem with ASP .NET community in my Universty and I need 
> to
> > > > solve it. The thing is that they say me that ASP .NET is better than
> > > PHP,
> > >
> > > > so I need information to response they about this theme. Can you put 
> me
> > > > some sites, statics, intrview to big personalities, articles to
> > > > response
> > >
> > > My meaning about this:
> > >
> > > ASP .NET is not just a scripting language but more a plattform for
> > > Enterprise
> > > (web) applications. It really has many more features then PHP and i 
> would
> > > compare ASP .NET more with JAVA/J2EE. I don't know much about ASP .NET
> > > since
> > > i am more familiar with PHP and maybe some little bit JAVA. I think it 
> is
> > > better to compare with a scripting language like Python or Ruby. You
> > > could compare the old versions of ASP with PHP because this was nearly
> > > the same. I
> > > never have coded with ASP since i very rarely touch a windows box but 
> it
> > > looked like VisualBasic code.
> > >
> > > Take a look here (Search Google: "asp .net vs php5" ):
> > >
> > > http://www.oracle.com/technology/pub/articles/hull_asp.html
> > >
> > I don't recommand this article at Oracle at all!!
> > It's a very biased one and intends to misguide as a marketting gig. I'd
> > like you to read healthy articles that truely compare. BTW
> > ASP.net <http://ASP.net><http://ASP.net>can not be compared with PHP5 
> because they are
> > totaly different.
> > It's like comparing Apples and Oranges. PHP can be compared to ASP not
> > ASP.net <http://ASP.net> <http://ASP.net> because it's totaly a 
> different thing. HTH. Been
> > there, done that.
> 
> Okay, please read my post again!
> 
> I would not compare PHP with ASP .NET. This is what i wrote. I found that 
> link
> to Oracle within 5 seconds via Google and did not read the whole text but
> Reynier Perez Mira could understand the difference with it.
> 
> Please read carefully before reply and please don't top post!
> 
> 
> Regards
> 
> Johannes Findeisen
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
On Saturday 23 April 2005 20:57, M Saleh EG wrote:
> On 4/23/05, hanez <[EMAIL PROTECTED]> wrote:
> > On Saturday 23 April 2005 20:27, M Saleh EG wrote:
> > > On 4/23/05, hanez <[EMAIL PROTECTED]> wrote:
> > > > On Saturday 23 April 2005 19:33, Reynier Perez Mira wrote:
> > > > > Hi list:
> > > > >
> > > > > I have a problem with ASP .NET community in my Universty and I need
> >
> > to
> >
> > > > > solve it. The thing is that they say me that ASP .NET is better
> > > > > than
> > > >
> > > > PHP,
> > > >
> > > > > so I need information to response they about this theme. Can you
> > > > > put
> >
> > me
> >
> > > > > some sites, statics, intrview to big personalities, articles to
> > > > > response
> > > >
> > > > My meaning about this:
> > > >
> > > > ASP .NET is not just a scripting language but more a plattform for
> > > > Enterprise
> > > > (web) applications. It really has many more features then PHP and i
> >
> > would
> >
> > > > compare ASP .NET more with JAVA/J2EE. I don't know much about ASP
> > > > .NET since
> > > > i am more familiar with PHP and maybe some little bit JAVA. I think
> > > > it
> >
> > is
> >
> > > > better to compare with a scripting language like Python or Ruby. You
> > > > could compare the old versions of ASP with PHP because this was
> > > > nearly the same. I
> > > > never have coded with ASP since i very rarely touch a windows box but
> >
> > it
> >
> > > > looked like VisualBasic code.
> > > >
> > > > Take a look here (Search Google: "asp .net vs php5" ):
> > > >
> > > > http://www.oracle.com/technology/pub/articles/hull_asp.html
> > >
> > > I don't recommand this article at Oracle at all!!
> > > It's a very biased one and intends to misguide as a marketting gig. I'd
> > > like you to read healthy articles that truely compare. BTW
> > > ASP.net <http://ASP.net><http://ASP.net>can not be compared with PHP5
> >
> > because they are
> >
> > > totaly different.
> > > It's like comparing Apples and Oranges. PHP can be compared to ASP not
> > > ASP.net <http://ASP.net> <http://ASP.net> because it's totaly a
> >
> > different thing. HTH. Been
> >
> > > there, done that.
> >
> > Okay, please read my post again!
> >
> > I would not compare PHP with ASP .NET. This is what i wrote. I found that
> > link
> > to Oracle within 5 seconds via Google and did not read the whole text but
> > Reynier Perez Mira could understand the difference with it.
> I did not say that you compared! Sorry if I put it that way. I said the
> article at Oracle does that.
> In all the cases that article does not fairly illustrate anything. It's a
> merketing trick for novices!

Okay, but it defenitly says this:

<snip from=http://www.oracle.com/technology/pub/articles/hull_asp.html>
The latest incarnation of ASP, ASP.NET, is not completely backward-compatible 
with previous versions of ASP, as it is a complete rewrite of the software. 
Previous ASP technology actually has a lot more in common with PHP than with 
ASP.NET, which is a complete framework for building Web applications. One of 
the principal features of this model is the flexibility to choose your 
programming language. ASP.NET works with scripted languages such as VBScript, 
JScript, Perlscript, and Python, as well as compiled languages such as VB, 
C#, C, Cobol, Smalltalk, and Lisp. The new framework uses the common language 
runtime (CLR); your language source is compiled into Microsoft Intermediate 
Language code, which the CLR then executes.
</snip>

This text says, that ASP .NET is a complete framework for building web 
applications.  All the other stuff maybe is some marketing strategy for 
selling Oracle software but i don't take care about that.

BTW, i think there is some more usefull information in this article (Anyway, i 
will not buy Oracle software).

Sorry for starting this flamewar. This was not my goal... ;-)

Regards

-- 
Johannes Findeisen

--- End Message ---
--- Begin Message ---
On 4/23/05, Reynier Perez Mira <[EMAIL PROTECTED]> wrote:
> I have a problem with ASP .NET community in my Universty and I need to solve
> it. The thing is that they say me that ASP .NET is better than PHP, so I need
> information to response they about this theme. Can you put me some sites,
> statics, intrview to big personalities, articles to response ?

.NET is a framework, not a language.  Many other languages qualify as
.NET languages besides just C# and VB.net.  So if you don't like the
Microsoft ones you can try others:

http://php-sharp.sourceforge.net/
http://www.startvbdotnet.com/dotnet/languages.aspx


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

--- End Message ---
--- Begin Message ---
On Fri, Apr 22, 2005 at 16:38:29 -0400,
  "ruel.cima" <[EMAIL PROTECTED]> wrote:
>  hi,
> 
>  im handling some important information that needs to be stored in my
>  postgresql database via a php script. i�ve been reading the mails sent on
>  this mailing list on SSL use. my postgresql server allows SSL connections
>  but im not sure how to make use of this.id like to know more about ssl and
>  how to take advantage of its security features. any references?
> 
>   from my php script, do i need to make a special connection to the database
>  or is the same e.g pg_connect(host= localhost dbname=test user=p
>  password=p)?

If postgres is running on the same machine as php there isn't much point
in using encryption of the connection. You are probably better off using
domain sockets instead of a network connection in this case.

--- End Message ---
--- Begin Message ---
Anyone who passesd?

On 4/22/05, Aaron Gould <[EMAIL PROTECTED]> wrote:
> 
> M Saleh EG wrote:
> > Hi everyone.. kind of OT
> > Anyone who's passed it in the list? I'm having my exam on May 7th. Gone
> > through the guide book once. Sounds easy according to the guide.
> > I dont think it's as easy as i'm thinking it is........ any experience?
> > Thanx in advance.
> 
> My advice -- take the full amount of time given to you, and go back over
> your answers should you have time left over.
> 
> I took it at the "2005 PHP Quebec Conference" (it was part of the fee).
> I finished it in an hour, but had 90 minutes alotted. I did not pass,
> and still regret not taking the time to go back over the answers I was
> unsure of. I think that if I had taken the full time, I would have had
> a better shot.
> 
> You'll likely have better luck, as I normally don't do well with exams
> in general.
> 
> As an aside, I think the exam needs to mature a bit more. I was confused
> a few times, and found a few questions that involved cases I had
> certainly experienced in five plus years of PHP development. I'm sure
> that'll happen in due time as the certification is only a couple years 
> old.
> 
> --
> Aaron Gould
> Programmer/Systems Administrator
> PARTS CANADA
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message --- M Saleh EG wrote:
Anyone who's passed it in the list? I'm having my exam on May 7th. Gone
through the guide book once. Sounds easy according to the guide.
I dont think it's as easy as i'm thinking it is........ any experience?

If you think it's easy based on the guide, you're probably fine, particularly if you think the practice questions were easy. Those questions were ones that were thrown out due to being too tricky or difficult, so the questions on the exam are more straightforward.


I posted the answers to Zend's self test (plus explanations), in case you fine it helpful:

http://shiflett.org/archive/115

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

--- End Message ---
--- Begin Message ---
On 4/23/05, M Saleh EG <[EMAIL PROTECTED]> wrote:
> Anyone who passesd?

If I can pass..  well, good luck!  :)


-- 
Greg Donald
Zend Certified Engineer
http://destiney.com/

--- End Message ---
--- Begin Message ---

I have this form.html:


<form method="post" action="form.php"> text input <input type="text" name="input_test"><br /> radio input1 <input type="radio" name="radio_test" value="test1" /> radio input2 <input type="radio" name="radio_test" value="test2" /> <input type="submit" value="Submit"> </form>


Then I have this script (form.php):

<?php
foreach ($_POST as $key => $val)
echo "$key = $val\n";
?>


If I simply submit the form empty, all I get back from the script is the text input $key. The radio button doesn't show up. Why is that and how can I have it show up? (the radio input does show up once one of the radios is checked, but I need it to show up when empty as well.)


--
H | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Imaging . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.





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

You solve the problem yourself: "the radio input does show up once one of the radios is checked". When it is unchecked is isn't set...if you need to assign it a value in any circumstances you should test it with <?php $chkbox1 = (isset($_POST["radio_test"])) ? true : false; ?> for example (of course you may omit the ternary operator...isset() will do the same).

Ashley M. Kirchner wrote:


I have this form.html:


<form method="post" action="form.php"> text input <input type="text" name="input_test"><br /> radio input1 <input type="radio" name="radio_test" value="test1" /> radio input2 <input type="radio" name="radio_test" value="test2" /> <input type="submit" value="Submit"> </form>


Then I have this script (form.php):

<?php
foreach ($_POST as $key => $val)
echo "$key = $val\n";
?>


If I simply submit the form empty, all I get back from the script is the text input $key. The radio button doesn't show up. Why is that and how can I have it show up? (the radio input does show up once one of the radios is checked, but I need it to show up when empty as well.)



--- End Message ---
--- Begin Message ---
That's because Radio Buttons and Check Boxes do not return anything if not 
checked or selected.
So you gotta explicitly do it ur self. That is u gotta check for it's 
validity and non-empiness.
e.g. in ur scenario
if(!isset($_POST['radio_test'])) { //print out all the options unselected } 
else
{ // print the value and show the rest empty in the report }

On 4/23/05, Ashley M. Kirchner <[EMAIL PROTECTED]> wrote:
> 
> 
> I have this form.html:
> 
> <form method="post" action="form.php">
> text input <input type="text" name="input_test"><br />
> radio input1 <input type="radio" name="radio_test" value="test1" />
> radio input2 <input type="radio" name="radio_test" value="test2" />
> <input type="submit" value="Submit">
> </form>
> 
> Then I have this script (form.php):
> 
> <?php
> foreach ($_POST as $key => $val)
> echo "$key = $val\n";
> ?>
> 
> If I simply submit the form empty, all I get back from the script is
> the text input $key. The radio button doesn't show up. Why is that and
> how can I have it show up? (the radio input does show up once one of
> the radios is checked, but I need it to show up when empty as well.)
> 
> --
> H | I haven't lost my mind; it's backed up on tape somewhere.
> +--------------------------------------------------------------------
> Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
> IT Director / SysAdmin / WebSmith . 800.441.3873 x130
> Photo Craft Imaging . 3550 Arapahoe Ave. #6
> http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
Ashley M. Kirchner wrote:


I have this form.html:


<form method="post" action="form.php"> text input <input type="text" name="input_test"><br /> radio input1 <input type="radio" name="radio_test" value="test1" /> radio input2 <input type="radio" name="radio_test" value="test2" /> <input type="submit" value="Submit"> </form>


Then I have this script (form.php):

<?php
foreach ($_POST as $key => $val)
echo "$key = $val\n";
?>


If I simply submit the form empty, all I get back from the script is the text input $key. The radio button doesn't show up. Why is that and how can I have it show up? (the radio input does show up once one of the radios is checked, but I need it to show up when empty as well.)




One way would be to have a selection "None" and have it selected by default. As in,

None <input type="radio" checked name="radio_test"  value="None" />

Or you can just do something like,

 <?php
 if(!isset[$_POST['radio_test']))
    echo "radio_test = none\n";
 foreach ($_POST as $key => $val)
 echo "$key = $val\n";
 ?>


Janet



--
Janet Valade -- janet.valade.com

--- End Message ---
--- Begin Message ---
> None <input type="radio" checked name="radio_test"  value="None" />

And if you didn't want it to show to the user (because they have to
make a choice anyway) . . . you can use this css:

input[value="None"]
{
        display: none;
}

You should then always have a value to play with in PHP, and the user
doesn't see any extra clutter.

--- End Message ---
--- Begin Message --- Justin Gruenberg wrote:
None <input type="radio" checked name="radio_test" value="None" />


And if you didn't want it to show to the user (because they have to
make a choice anyway) . . . you can use this css:

input[value="None"]
{
        display: none;
}

You should then always have a value to play with in PHP, and the user
doesn't see any extra clutter.
which unfortunately currently only works in a couple of browsers (mozilla, (and thus firefox), and opera I think (?))
--- End Message ---
--- Begin Message ---
Hi

I am using php and apache 2 on linux for a web
application.

Don't know if this is off topic but I don't know where
else to ask.....

I am looking for some place relatively cheap that
could provide hosted authentication services along
with time based authenticater fobs like those found
from securID, verisign etc.

Ideally I would like to hook this into my current
login page with the hosted server returning a a yes/no
for a specific user.

Anyone know of a company that does this sort of thing?
I am in the UK and ideally would like to find
someplace nearby or with good links UK/Europe/N
America/India

Many thanks for any pointers.

Jack


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--- End Message ---
--- Begin Message ---
www.dreamhost.com <http://www.dreamhost.com> is the best choice and the best 
value for money! Check it out.

On 4/23/05, 1 2 <[EMAIL PROTECTED]> wrote:
> 
> Hi
> 
> I am using php and apache 2 on linux for a web
> application.
> 
> Don't know if this is off topic but I don't know where
> else to ask.....
> 
> I am looking for some place relatively cheap that
> could provide hosted authentication services along
> with time based authenticater fobs like those found
> from securID, verisign etc.
> 
> Ideally I would like to hook this into my current
> login page with the hosted server returning a a yes/no
> for a specific user.
> 
> Anyone know of a company that does this sort of thing?
> I am in the UK and ideally would like to find
> someplace nearby or with good links UK/Europe/N
> America/India
> 
> Many thanks for any pointers.
> 
> Jack
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---
--- Begin Message ---
I'd generate an MD5 sum on a file you know is valid, and compare it against 
that in your script.

On 4/23/05, Prathaban Mookiah <[EMAIL PROTECTED]> wrote:
> 
> Hello,
> 
> Is there a way to test if a .gz file is in a valid format. Functions like
> gzread, gzfile don't seem to care if the file is corrupt or not.
> 
> gzeof also didn't work for me. I guess it is because it does not check for 
> a
> valid .gz termination. Any ideas to go about doing this?
> 
> Thanks in advance.
> 
> Cheers,
> 
> Prathap
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
The Disguised Jedi
[EMAIL PROTECTED]

Now you have my $0.02. Or .01 Pounds, .014 Euros, or $0.025 CAN. I'm 
world-wide BABY!
PHP rocks!
"Knowledge is Power. Power Corrupts. Go to school, become evil"

Disclaimer: Any disclaimer attached to this message may be ignored. However, 
I must say that the ENTIRE contents of this message are subject to other's 
criticism, corrections, and speculations.

This message is Certified Virus Free

--- End Message ---

Reply via email to