php-windows Digest 16 Sep 2012 09:49:38 -0000 Issue 4068

Topics (messages 30950 through 30951):

Re: Php doesn't calculate value
        30950 by: Niel Archer
        30951 by: Matt Matt

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
> Hi folks,
> 
> i have a problem with a value that it is not passed as POST variable from a
> php page to another.
> this is the error i have encountered :
> 
> *Notice*: Undefined index: idschema in *....\SubmitSchema.php* on line *22*
> 
> Follow the code of the main page :
> -----------------------
> <?php
> $c = oci_connect("system", "oramanager", "//localhost/XE");
> if (!$c) {
>    $m = oci_error();
>    echo $m['message'], "\n";
>    exit;
> }
> else {
>    print "Connesso!";
> }
> $s = oci_parse($c, 'select username from dba_users');
> oci_execute($s);
> print '<center>';
> print '<h2>Seleziona lo schema desiderato</h2>';
> print '<form name="SelezioneSchema" action="SubmitSchema.php" method=get>';
> print '<br>';
> print '<select name="selezioneSchema" id="idschema">';
> while ($row = oci_fetch_array($s, OCI_NUM+OCI_RETURN_NULLS)) {
>     foreach ($row as $item)
>         print '<option value="opzione1">'.htmlentities($item).'</option>';
> }
> 
> print '</select>';
> print '<input type=submit value="Invia">';
> print '</form>';
> //print 'Valore id_schema'.$idschema;
> 
> oci_free_statement($s);
> 
> oci_close($c);
> ?>
> -------------------------
> 
> 
> and this is the code of the SubmitSchema php page:
> 
> 
> 
> ---------------------------------------------
> <?php
> 
> 
> if ( isset($_POST['idschema']) ) {
>    echo "setted";}
> 
>    else
>    {
>    echo "not setted";
> }
> $query = $_POST['idschema'];
> print $query;
> 
> ?>
> -------------------------------
> 
> 
> I cannot retrieve the value being selected by the user with the dropdown
> list, do you have any idea or workarounds?Thankyou!
> 
> regards
> 
> Matt

You are using method=get in the form tag and trying to retrieve from the
$_POST variable. Either change the method to post or the variable to
$_GET

--
Niel Archer


--- End Message ---
--- Begin Message ---
Thank you guys, i have solved the problem by changing [name="idschema"] and
by substituing <option value="opzione1"> with only <option>.
Now i'm able to select a value from the dropdown list menu and to deliver
it across the page. :-)

Thank you and have a nice day!

Matt.




2012/9/15 Niel Archer <spam-f...@blueyonder.co.uk>

> > Hi folks,
> >
> > i have a problem with a value that it is not passed as POST variable
> from a
> > php page to another.
> > this is the error i have encountered :
> >
> > *Notice*: Undefined index: idschema in *....\SubmitSchema.php* on line
> *22*
> >
>  > Follow the code of the main page :
> > -----------------------
> > <?php
> > $c = oci_connect("system", "oramanager", "//localhost/XE");
> > if (!$c) {
> >    $m = oci_error();
> >    echo $m['message'], "\n";
> >    exit;
> > }
> > else {
> >    print "Connesso!";
> > }
> > $s = oci_parse($c, 'select username from dba_users');
> > oci_execute($s);
> > print '<center>';
> > print '<h2>Seleziona lo schema desiderato</h2>';
> > print '<form name="SelezioneSchema" action="SubmitSchema.php"
> method=get>';
> > print '<br>';
> > print '<select name="selezioneSchema" id="idschema">';
> > while ($row = oci_fetch_array($s, OCI_NUM+OCI_RETURN_NULLS)) {
> >     foreach ($row as $item)
> >         print '<option
> value="opzione1">'.htmlentities($item).'</option>';
> > }
> >
> > print '</select>';
> > print '<input type=submit value="Invia">';
> > print '</form>';
> > //print 'Valore id_schema'.$idschema;
> >
> > oci_free_statement($s);
> >
> > oci_close($c);
> > ?>
> > -------------------------
> >
> >
> > and this is the code of the SubmitSchema php page:
> >
> >
> >
> > ---------------------------------------------
> > <?php
> >
> >
> > if ( isset($_POST['idschema']) ) {
> >    echo "setted";}
> >
> >    else
> >    {
> >    echo "not setted";
> > }
> > $query = $_POST['idschema'];
> > print $query;
> >
> > ?>
> > -------------------------------
> >
> >
> > I cannot retrieve the value being selected by the user with the dropdown
> > list, do you have any idea or workarounds?Thankyou!
> >
> > regards
> >
> > Matt
>
> You are using method=get in the form tag and trying to retrieve from the
> $_POST variable. Either change the method to post or the variable to
> $_GET
>
> --
> Niel Archer
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---

Reply via email to