Jump to content

edit option in php


Mohsin

Recommended Posts

hi to all!!!

 

i have the code in the following:

i have index.php

 

<html>

<head>

</head>

<body>

<form action="form.php" method="post" name="form">

 

enter your name<input type="text" name="txt" />

<input type="submit" value="1" name="submit" />

</form>

</body>

</html>

 

i have form.php

 

<?php

 

class myclass {

 

public function abc(){

$name = $_POST['txt'];

echo 'you have enter name:'.$name;

echo 'do you want to edit it <a href="edit.php">click here</a>';

}

 

 

}

 

$obj = new myclass();

$obj1 = $_POST['submit'];

if($obj1){

 

$obj->abc();}

 

 

 

?>

and in the end i have edit.php

<html>

<head>

</head>

<body>

<form action="form.php" method="post" name="form">

 

enter your name<input type="text" name="txt" value="<?php echo $name;?>" />

<input type="submit" value="1" name="submit" />

</form>

</body>

</html>

 

the problem is i want to create the edit option if the user have enter the wrong information

 

is there anyone to help me

!!!!

 

thnx in advance

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...