Re: Php doesn't calculate value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-free@xxxxxxxxxxxxxxxx>

> > 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
>
>

[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux