Jump to content

Recommended Posts

Hi all,

 

I am trying to work on an existing script. There is a feature/button to EDIT info in the database. I need to add a feature/button to ADD a file to the database, but then in the add <div> I need to write code to direct a user to the EDIT <div> to complete the form...Also I need to create a DELETE within the EDIT.

 

At the top of my script (or anywhere?) don't I also need to create a new variable for this ADD button( !?) with 'INSERT INTO' ?

 

This is the existing EDIT button and form:

 

<div id="editbox" <? if($_SESSION['mode']!="editor" || $_GET['p_id']==""){ ?> style="display:none;"<? } ?>>
<div style="text-align:left;"><a href="?">CLOSE</a></div>
<?=$msg?>
<form method="post" action="?mode=editor&table=properties&p_id=<?=$_GET['p_id']?>">
<?
$sql_o = "SELECT * FROM pit_company WHERE p_id = ".$_GET['p_id']; 
$result_o = mysql_query($sql_o); //echo $sql_o;
while ($row_o = mysql_fetch_assoc($result_o)) {
?>
<input type="hidden" name="p_id" value="<?=$row_o['p_id']?>" />
ID : <?=$_GET['p_id'];?><br />
Name : <input name="p_name" value="<?=$row_o['p_name']?>" /><br />
Address 1 : <input name="p_address1" value="<?=$row_o['p_address1']?>" /><br />

 

Is this right for starters?:

<div id="addbox" <? if($_REQUEST['mode']!="add"){ ?> style="display:none;"<? } ?>>
<form method="post" action="?mode=editor&table=properties&action=addlocation">
Address 1 : <input name="p_address1" value="<?=$row_o['p_address1']?>" /><br />
</form>
</div>

 

I don't know if the 'Address 1...' part is necessary - At what point do I direct user to 'editbox', and how?

 

Any suggestions are greatly appreciated :)

Link to comment
https://forums.phpfreaks.com/topic/50971-add-file-and-edit-forms-need-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • 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.