Jump to content

Recommended Posts

I have a form with a field(url) that is retrieved from database and other things are entered into some fields in the form ,now I am submitting this form and sending it to another script which updates my table of urls with the value of other fields submitted in that page.Now Next time i want to display the same page with next url so i can update the table for that url value,I am retrieving the url with id's ,i cannot figure out how to send this information so it displays the same view with next url.Please help.

Link to comment
https://forums.phpfreaks.com/topic/240239-form-query/
Share on other sites

url.php

$id=1;
$query5="SELECT url_string from `$pl.$sid.$nextweek` where id=$id";
$result5=mysql_query($query5);
//echo $result5;
$num_rows2=mysql_num_rows($result5);
for($i=0;$i<$num_rows2;$i++){
$urlid=mysql_result($result5,$i,0);
?>
<div id="load" align="center"></div>
<form action="comment.php" method="post" id="form1" >
Current URl:<ul><li> <a href="<?php echo $urlid; ?>" target="somframe"> <?php echo $urlid; ?></a></li></ul>  </br>
Enter your comment: <input type="text" name="comment" value=""/></br>
<input type="hidden" id="url" name="v" value="<?php echo $urlid; ?>"/>
<input type="hidden" id="hidden1" name="c" value=""/>
<input type="hidden" name="idcall" value="<?php echo $id?>"/>
<input type="hidden" id="platform" name="pid" value="<?php echo $pl;?>"/>
<input type="hidden" id="software" name="sid" value="<?php echo $sid; ?>"/>
<input type="hidden" id="timestamp" name="time" value="<?php echo $nextweek;?>"/>
<button type="submit">submit</button>
</form>

comment.php
$db = mysql_connect($settings['MYSQL_host'],$settings['MYSQL_name'], $settings['MYSQL_password']); //Should be moved to config file
if (!$db)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db("drop_down");
$query="UPDATE `$plat_id.$soft.$ti` SET comment='$com',loadtime='$time' WHERE url_string='$url'";
$result=mysql_query($query);

 

Now I want after teh value is updated in tabel is updated in comment.php ,url.php should be displayed and with next url with id =2 so i can update the vale of that url

Link to comment
https://forums.phpfreaks.com/topic/240239-form-query/#findComment-1234033
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.