Jump to content

Recommended Posts

Hi all,

I am pretty new to php and am sure this is a simple task if you know what to google, however I do not.

My issue is that I have a page index.php which is a simple div layout with all of the content placed by using

"include ("pagename.php")"

.  I have a page that simply has a

$var=$_GET

form on it that works great on its own.  My menu calls the content by setting the

$page

variable to href's such as

 "index.php?page=home" 

.  the links all work great until i submit the form where it changes the addy in the bar from

lgmanagement/index.php?page=groupinfo&

to

lgmanagement/index.php?group=Deliberately+Different&select=Select

.  If I go and alter the addy to

lgmanagement/index.php?page=groupinfo&group=Deliberately+Different&select=Select

it works great.  Iv'e tried to change the form action to compensate but just cant quite figure it out...  I know it is possible to "stack actions" (if that is the right terminology) I just don't know how!

 

Thank for helping us noobs!

Toby

Can you post your form code. I'm not quite sure what you're asking here.

 

It looks like maybe your form is posting its data with method="GET"??? If so, that would probably override the page variable in the url. But like I said, your post is confusing so I don't know for sure what the issue is.

Sorry for being unclear..  I'm only a 2 week old php user so i'm not sure how detailed to be...  ;)

 

Form Code:

// Query the database to gather Group info
$sqlgroups="SELECT id, name FROM lifegroups ORDER BY name;";
$resultgroups=mysql_query($sqlgroups) or die(mysql_error());

// The form
<form action="<?php echo $_SERVER['PHP_SELF']; ?>?page=groupinfo&" method="get" name="GatherInfo">
<select name="group" id="group">
	       <option value="">Select a LIFE Group</option>
	   <?php $i=0;
		  while ($i<mysql_num_rows($resultgroups)) { ?><option value="<?php echo stripslashes(mysql_result($resultgroups,$i,name)); ?>"><?php echo stripslashes(mysql_result($resultgroups,$i,name)); ?></option><?php $i++; } ?>
  </select>

<input type="submit" name="select" id="select" value="Select" />
</form>

 

I hope this is what you needed,  I could also send the index and menu if needed....

 

Thanks

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.