Jump to content

needing some advice on submitting


dmcg

Recommended Posts

i'm trying to build a cms.  I'm needing some advice on submitting.

 

have two senerios

1. embedded self referencing URL s

2. menu editor update

 

1.  embeded self refrencing URLs within the content its self such as

<a href="index.php?content=generic&action=viewlist&category=4" >category four, listing</a><br>
<a href="index.php?content=generic&action=view&item=43" >some other content</a> 

 

2.  Menu editor updating

when i set the url of the menu item to

'index.php?content=generic&action=viewlist&category=4'

then when i go to submit it, errors out.  Because the query keys are repeated within the query string.  How can i handle this, with out changing my query keys?

 

 
<form id="adminform" action="index.php" method="post" >		 
<input type="hidden" id="itemid" value="{contentid}" />
<table style="text-align: left; width: 65%;" border="01" cellpadding="2" cellspacing="2">
	<tbody>   
		<tr>
			<td style="vertical-align: top;text-align: right;">Section :</td>
			<td style="vertical-align: top;">{sectionid}</td>
		</tr> 
		<tr>
			<td style="vertical-align: top;text-align: right;">Category :</td>
			<td style="vertical-align: top;">{categoryid}</td>
		</tr> 
		<tr>
			<td style="vertical-align: top;text-align: right;">Title:</td>
			<td style="vertical-align: top;">{title}</td>
		</tr>   
		<tr>
			<td style="vertical-align: top;text-align: right;">body:</td>
			<td style="vertical-align: top;">{body}</td>
		</tr>
	</tbody>
</table>
</form>   
<script language="JavaScript"> 
function submitbutton(pressedbutton) {
/*var form = document.editform;*/
if (pressedbutton == 'cancel') { 
	window.location = 'index.php?content=frontpage&action=view';
	return;
}    
s = 'index.php?content=genericcontent&action=' + pressedbutton
	+ '&itemid=' + document.getElementById('itemid').value 
	+ '&sectionid=' + document.getElementById('sectionid').value
	+ '&categoryid=' + document.getElementById('categoryid').value
	+ '&title=' + document.getElementById('title').value  
	+ '&body=' + document.getElementById('body').value; 

window.location = s; 

}   
</script>

 

 

Link to comment
https://forums.phpfreaks.com/topic/47852-needing-some-advice-on-submitting/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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