ShaolinF Posted February 2, 2008 Share Posted February 2, 2008 Hi Guys, I have an area on my website where you can edit events. I have a dropdown, you select an option and it adds the variables into text boxes in the following way: Add dropdown option: function loop() { //took long bits of code out while ($row = mysql_fetch_assoc($result)) { echo "<option value=\"".'home.htm?en='.$row['eventName'].'&ts='.$row['TicketsOnSale'].'&sp='.$row['TicketPrice'].'&id='.$row['eventid']."\">".$row['eventName']."</option>" . "\n\t\t"; } } *page refreshes* Html: <form action="update.htm?id=update&action=event" name="event" method="post"> <select id="menu" name="menu"> Select Event to Edit: <option value="">- Select -</option> <? loop("update"); //Run loop function ?><br /> <label for="eventnm">Event Name:</label> <input type="text" name="eventnm" value="<? echo $_GET['en']; ?>" /><br /> <label for="tickno">Number of tickets on sale:</label> <input type="text" name="tickno" value="<? echo $_GET['ts']; ?>" /><br /> <label for="tickprice">Single ticket price:</label> <input type="text" name="tickprice" value="<? echo $_GET['sp']; ?>" /><br /> <input type="hidden" name="id" value="<? echo $_GET['id']; ?>" /> <input type="submit" value="Update >>"/></p> </form> Now the problem is, is I intend to add the description field too. The description field can be VERY VERY long and I don#t know if it is a good idea to put it to URL and use the $_GET method. What alternatives are there ? Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/ Share on other sites More sharing options...
resago Posted February 2, 2008 Share Posted February 2, 2008 use $_POST instead of $_GET usually you have at least 4meg for post. Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/#findComment-455813 Share on other sites More sharing options...
ShaolinF Posted February 2, 2008 Author Share Posted February 2, 2008 That would work once I have made the edits and submitted the form. But how would I get it from the db ? Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/#findComment-455815 Share on other sites More sharing options...
ShaolinF Posted February 2, 2008 Author Share Posted February 2, 2008 Anyone ? Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/#findComment-455940 Share on other sites More sharing options...
p2grace Posted February 2, 2008 Share Posted February 2, 2008 What do you mean how do you get it from the db? Are you asking how to construct the query, or how to setup the db table? Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/#findComment-455943 Share on other sites More sharing options...
ShaolinF Posted February 2, 2008 Author Share Posted February 2, 2008 Well, I use a query to get the description field, this field can be extremely long. Once the javascript has finished and the query has finished the page automatically reloads and thus it loads the query into the URL, and I will have to use $_GET to get all the data. The problem is, is I don't think it is practical for me do this in such a method considering the size of such a field. Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/#findComment-455946 Share on other sites More sharing options...
p2grace Posted February 2, 2008 Share Posted February 2, 2008 Why do you do it that way? Why don't you just run the and show it in the page, what's the thought behind doing the redirect? Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/#findComment-456169 Share on other sites More sharing options...
haku Posted February 2, 2008 Share Posted February 2, 2008 How exactly are you using javascript here? Is this part of an ajax query? Link to comment https://forums.phpfreaks.com/topic/89004-description-field-problem/#findComment-456172 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.