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!
>
>
> On Sat, 2002-03-09 at 02:52, delz wrote:
> > Hi,
> >
> > To give you all an idea, i have a script named editform01.php that first
> > displays the data in a table. ThenI have this link called "Edit" in
which it
> > goes to another script called editform02.php which is where the data is
> > displayed and then you can edit it there. My problem is I cannot proceed
to
> > the other script editform02.php because it gives me the error "Request
URI
> > Too Large", this only appears whenever I have a big amount of data in
one of
> > my textbox.
> >
> > Below is my script editform01.php for your reference.
> >
>
> --------------------------------------------------------------------------
--
> > -----------
> > <html>
> > <head><title>My Database</title>
> > </head>
> >
> > <body bgcolor=#ffffff>
> >
> >
> > <?
> > 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>D a t
> > e</font></td>
> > <td align=center bgcolor=#0099CC><font color=#FFFFFF face=Arial>S u b j
e c
> > t</font></td>
> > <td align=center bgcolor=#0099CC><font color=#FFFFFF face=Arial>P o s t
e d
> > b y</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);
> > ?>
> > </body>
> > </html>
> >
> >
> > Thanks.
> >
> > Delz
> >
> > ----- Original Message -----
> > From: "Andreas Frosting" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, March 09, 2002 10:06 AM
> > Subject: RE: Request-URI Too Large
> >
> >
> > > > I'm using php and mysql as my server, when I'm updating a large
> > > > page on my database using a browser I get
> > > > "Request-URI Too Large
> > > > the requested URL's length exceeds the capacity limit for this
server.
> > > > request failed: URI too long"
> > > > Why is this so? Do I need to adjust something on mysql or my
> > > > phpscript?
> > >
> > > Try putting method="post" in your <form>
> > >
> > > I.e:
> > >
> > >   <form action="foo.php" method="post">
> > >
> > > :wq
> > > //andreas
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
> >
> >
> > ---------------------------------------------------------------------
> > 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
> >
> --
> dsoares
> (sql)
>
> ---------------------------------------------------------------------
> 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


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