Jump to content

site problem


adv

Recommended Posts

hello

 

i have this:

this is the index.html

Description:</b> <input name="desc" maxlength="15"  type="text">
<a name="go" id="go" href="check.php"><img src="index_files/funny_desc.gif" alt=""  border="0"></a></td>

 

how do i do it in the check.php

when someone press the icon it goes to check.php and in check.php i wanna check

something like this:

 

$desc = $_POST['desc'];

if (icon_pressed) {

  if (empty($desc)) {

          echo "need description";

} else {

    header("location:success.php");

}

 

i know how to do this with <input >

with input u just add a hidden value bellow it

<input type=submit value=submit name=submit>

<input type=hidden value=1 name=enter>

 

and in the .php

 

if ($_POST['enter'] == "1") {

      $desc =  $_POST['desc'];

          if (empty($desc)) {

            echo "error";

    }

}

 

something like this

i duno how to explain :|

this is the best i can

thanks in advance

 

 

Link to comment
https://forums.phpfreaks.com/topic/56889-site-problem/
Share on other sites

set a on click on the image call the php page what

ever it is so that it go to that page or more simple set a form and get it to do a php self on the code on post either way i would use sessions.

 

failing that do it in java client side

 

but best bet is use a onclick call the php page

 

spooke2k

Link to comment
https://forums.phpfreaks.com/topic/56889-site-problem/#findComment-281087
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.