Hi,

Can you help me edit my script because I'm used to doing the approach that I
did in the script editform01.php. I'm quite confused. Actually in my edit
script I used 3 php scripts. One is to view (editform01.php), the other one
is the form to display the fields that you want to edit (editform02.php),
and the last one is the update script whch does all the editing
(editing03.php). I would appreciate any help that you can provide. Attached
below are my 3 scripts for reference :

editform01.php
-----------------

<html>
<head><title>Mode International e-Bulletin Board</title>
</head>

<body bgcolor=#ffffff>

<p align="center"><font face="Arial"><b>M o d e&nbsp;&nbsp; I n t e r n a t
i o
n a l&nbsp;&nbsp;&nbsp; I n c.</b></font></p>
<p align="center"><b><font face="Arial" size="2" color="#003399">e - B u l l
e t
i n&nbsp; B o a r d</font></b></p>


<?
mysql_connect(localhost, root, mypassword) or die ("Problem connecting to
DataBase");
$query = "select * from czz";
$result = mysql_db_query("e-bulletin", $query);

if ($result) {
echo "<table width=90% align=center border=0><tr>
<td align=center bgcolor=#0099CC><font color=#FFFFFF face=Arial><b>D a t
e</b></font></td>
<td align=center bgcolor=#0099CC><font color=#FFFFFF face=Arial><b>S u b j e
c t</b></font></td>
<td align=center bgcolor=#0099CC><font color=#FFFFFF face=Arial><b>P o s t e
d  b y</b></font></td>
<td align=center bgcolor=#FFFFFF></td>

</tr>";

while ($r = mysql_fetch_array($result)) {
$idx = $r["idx"];
$date = $r["date"];
$too = $r["too"];
$subject = $r["subject"];
$carbon = $r["carbon"];
$body = $r["body"];
$postedby = $r["postedby"];

//URL Encode

$idx = urlencode($idx);
$date = urlencode($date);
$too = urlencode($too);
$subject = urlencode($subject);
$carbon = urlencode($carbon);
$body = urlencode($body);
$postedby = urlencode($postedby);


//URL Decode

$date = urldecode($date);
$subject = urldecode($subject);
$carbon = urldecode($carbon);
$postedby = urldecode($postedby);


echo "<tr>
<td bgcolor=lightblue align=center><font face=Arial>$date</font></td>
<td bgcolor=lightblue align=center><font face=Arial>$subject</font></td>
<td bgcolor=lightblue align=center><font face=Arial>$postedby</font></td>
<td bgcolor=lightblue alignt=center><font face=Arial><a
href=\"editform02.php?idx=$idx&date=$date&too=$too&subject=$subject&carbon=$
carbon&body=$body&postedby=$postedby\">Edit</a></font></td>
</tr>";

}

echo "</table>";

} else {

echo "No data.";

}

mysql_free_result($result);

include("links.y");

?>
</body>
</html>




editform02.php
----------------
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Mode International e-Bulletin Board</title>
</head>

<body>

<p align="center"><font face="Arial" size="3"><b>M o d e&nbsp; I n t e r n a
t i
o n a l&nbsp; I n c.</b></font></p>
<p align="center"><font face="Arial" size="3" color="#003399"><b>e - B u l l
e t
i n&nbsp; B o a r d</b></font></p>
<form method="post" action="editform03.php">
<table border="0" width="76%" align="center">
<tr>
    <td width="17%" align="right" bgcolor="#0099CC"><font face="Arial"
color="#FFFFFF">Date:</font></td>
    <td width="53%" bgcolor="#0099CC"><font color="#FFFFFF"><?php
$date=date("m/d/Y H:i:s");echo "$date";?></font></td>
  </tr>
  <tr>
    <td width="17%" align="right" bgcolor="#0099CC"><font face="Arial"
color="#FFFFFF">To:</font></td>
    <td width="53%" bgcolor="#0099CC"><input type="text" name="too"
size="70" value="<?php echo "$too";?>"></td>
  </tr>
<tr>
    <td width="17%" align="right" bgcolor="#0099CC"><font face="Arial"
color="#FFFFFF">Subject:</font></td>
    <td width="53%" bgcolor="#0099CC"><input type="text" name="subject"
size="70" value="<?php echo "$subject";?>"></td>
  </tr>
<tr>
    <td width="17%" align="right" bgcolor="#0099CC"><font face="Arial"
color="#FFFFFF">Cc:</font></td>
    <td width="53%" bgcolor="#0099CC"><input type="text" name="carbon"
size="58" value="<?php echo "$carbon";?>"></td>
  </tr>
<tr>
    <td width="17%" align="right" bgcolor="#0099CC">&nbsp;</td>
    <td width="53%" bgcolor="#0099CC"><textarea name="body" rows="18"
cols="71"><?php echo "$body";?></textarea></td>
  </tr>
<tr>
    <td width="17%" align="right" bgcolor="#0099CC"><font face="Arial"
color="#FFFFFF">Postedby:</font></td>
    <td width="53%" bgcolor="#0099CC"><font color="#FFFFFF"><?php
$postedby=getenv("REMOTE_USER");echo "$postedby";?></font></td>
</tr>
<tr>
    <td width="17%" align="right" bgcolor="#0099CC">&nbsp;</td>
    <td width="53%" bgcolor="#0099CC"><input type="submit" value="Update"
name="B1"></td>
  </tr>


  <p>&nbsp;</p>

<input type=hidden name=idx value="<? echo "$idx";?>">
<input type=hidden name=date value="<? echo "$date";?>">
<input type=hidden name=postedby value="<? echo "$postedby";?>">


</form>
</table>
</body>

</html>


editform03.php
---------------

mysql_connect(localhost, root, mypassword) or die ("Problem connecting to
DataBase");

$query = "UPDATE czz SET
idx='$idx',date='$date',too='$too',subject='$subject',carbon='$carbon',body=
'$body',postedby='$postedby' WHERE idx='$idx'";

$result = mysql_db_query("e-bulletin", $query);
$query = "SELECT * FROM czz";
$result = mysql_db_query("e-bulletin", $query);
mysql_free_result($result);

include("links.y");

?>




----- Original Message -----
From: "ds" <[EMAIL PROTECTED]>
To: "delz" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, March 12, 2002 4:02 AM
Subject: Re: Request-URI Too Large


> If all the data is in your database, why are you passing it in your
> query-string ?!?!?!!?
> Why don't you simply pass the idx like:
>
> <a href=\"editform02.php?idx=$idx\"....
>
> Then, in editform02.php you only need to do a
>
> $query = "select * from czz where idx=$idx";
>
> to get your data to edit.
> Also, one more note: you encode and after you decode... You must decide
> your self! ;-)  You can get the results from database, show them while
> they are decoded, then encode the data and put the url "Edit".
> Hope this helps!
>
>




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to