Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
count
New Member
New Member



Joined: Jun 23, 2005
Posts: 16

PostPosted: Sat Jun 25, 2005 8:08 pm Reply with quote

This page has the following form in it. Lets call the address
modules.php?name=thispage
Code:
$class1 = $_REQUEST['class1'];

  $class2 = $_REQUEST['class2'];

  if ( isset( $_REQUEST['hide'] ) )
  { $hide = $_REQUEST['hide']; }
  else
  { $hide = ""; }

  echo "<form method=\"GET\">\n";
  echo "<select name=\"class1\">\n";

$sql = "SELECT C.name, S.name AS name_en
  FROM Classes AS C, SysStrings as S
  WHERE C.sys_id = S.id  AND C.min_level > 0
  ORDER BY S.name;";

  //echo "<pre>" . $sql . "</pre>";
  $result = mysql_query($sql);

  while ( $info = mysql_fetch_array( $result ) )
  {
    echo "<option value=\"" . $info['name'];
    if ( $info['name'] == $class1 )
      echo "\" selected>";
    else
      echo "\">";
    echo $info['name_en'] . "\n";
  }

  echo "</select>\n";
  echo "<select name=\"class2\">\n";

$sql = "SELECT C.name, S.name AS name_en
  FROM Classes AS C, SysStrings as S
  WHERE C.sys_id = S.id AND C.min_level > 0
  ORDER BY S.name;";

  //echo "<pre>" . $sql . "</pre>";
  $result = mysql_query($sql);

  while ( $info = mysql_fetch_array( $result ) )
  {
    echo "<option value=\"" . $info['name'];
    if ( $info['name'] == $class2 )
      echo "\" selected>";
    else
      echo "\">";
    echo $info['name_en'] . "\n";
  }

  echo "</select>\n";
  echo "<input type=\"checkbox\" name=\"hide\">Hide\n";
  echo "<input type=\"SUBMIT\" value=\"Compare\">\n";
  echo "</form>\n";


Problem I'm running into is;
While this page works great by itsself (thispage.php), inside a nuke module its failing. Once you press submit the page is returned as
modules.php?class1=****&class2**** instead of
modules.php?name=thispage&class1=****&class2=****

What did I do wrong? Or how can I fix this?



Thanks for any help that you can give.
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Jun 25, 2005 11:23 pm Reply with quote

Code:
echo "<form method=\"GET\">\n";

You need to add the action property like this

Code:
echo "<form action=\"modules.php?name=$module_name\" method=\"GET\">\n";
 
View user's profile Send private message
count







PostPosted: Sun Jun 26, 2005 5:00 pm Reply with quote

Tried hard coding that in there before
echo "<form action =\"modules.php?name=mymodulename\" method=\"GET\">

I know your way is best and allows for the user to change the folder name.
Will try this tonight.

Still have to go thru all the pages and clean them up, I'm still learning so its pretty nasty in there. Things that were added in a "hmmm I wonder what this does" and then forgot to take them out Smile

Also screwing around with this last night, simply changing GET to POST fixed it. I only posted the form cause I thought that was where my problem was. I didn't post the rest of the page, you probably would have screamed, slapped me with a trout and told me to change it to Post Smile


Thanks for the help mate
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©