Jump to content

URL enconding problem

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
Thevenin

Thevenin

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
Hi guys, I have a little problem in the URL encoding.

The working URL should be this:

Quote


Instead I have this:

Quote


The problem is in this portion of code, but I can't find it and solve:
echo "Select Number of records per page: <form method=get action=$action_url>

<select name=page=testlist.php&limit>

<option value=10 $select10>10 Records</option>

<option value=5 $select5>5 Records</option>

<option value=2 $select2>2 Records</option>

</select>

<input type=submit value=GO>";

Any hint please?

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
what is $action_url set to? I think that is your problem
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#3
Thevenin

Thevenin

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
Sorry I forgot, $action_url is:

Quote



#4
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
your problem is here:
<select name=page=testlist.php&limit>

This is falsy html. do this instead:

<select name="page=testlist.php"limit">

On the other hand, that is a non suitable name. even better would be:

<input type="hidden" name="page" value="testlist.php">
<select name="limit">

__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#5
Thevenin

Thevenin

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
Finally done and finished!
Fixed with the second method:

Quote

<input type="hidden" name="page" value="testlist.php">
<select name="limit">

How can I live without this forum!? :D

Thank you so much.

#6
Thevenin

Thevenin

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
Sorry again :(
But if I had to use also a mySQL query result and my URL has to be something like this:

Quote

The "id", "id_nation" are two fields of a database mySQL.

#7
Thevenin

Thevenin

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
I mean something like this (I know it's wrong, but just to explain what I meant):
<?
$page_name = "es_ES";
$id_nation = ($_POST['id_nation']);
?>
<input type=hidden name=u value="<?php echo $page_name ?>" name1=id_nation value1="<?php echo $id_nation ?>">


#8
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
just do this?
<input type=hidden name=id_nation value="<?php echo $id_nation ?>">
<input type=hidden name=u value="<?php echo $page_name ?>">

__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall

#9
Thevenin

Thevenin

    Learning Programmer

  • Members
  • PipPipPip
  • 58 posts
Wonderful, I didn't think I could do it.
Many thanks for you big help. :thumbup: