Reply to Re: AW: [PHP] how can I CALL a PHP script from different TEXT LINKS with differentPARAMETERS?

Your name:

Reply:


Posted by xkorakidis on 10/05/15 11:32

Webmaster, thanks very much but I think it would be safer to do that by
post, not by get. Furthermore, if I use indivudual files
("searchProductInsertId.php", "searchMemberInsertId.php"...), I think it
is easy: in each link of the menu I can type:
<a href="searchProductInsertId.php">Search</a>,
<a href="searchMemberInsertId.php">Search</a> etc.
But, due to the fact that the html part of each SearchInsertId page
doesn't have many differences between various search pages (in first
case will show a message "type a productId to find" and will be
connected with "searchProduct.php", in second case will show a message
"type a memberId to find" and will be connected with "searchMember.php",
and so on), I thought to make a searchSomethingWithId page, where the
text and post php page will differentiate dependetly on what user had
clicked on menu. So I think that the problem I have, is what exactly
should be writen on each "Search", "Add" of menu so as to help the
searchSomethingWithId page to understand what "search" or "add" was
clicked, and secondly, what should be written on searchSomethingWithId
page so as to call the appropriate "search" or "add" php page.
I have some code about sessions and global values, I would preffer a
solution involving global values if it is safe. I used in past forms and
buttons to send information to php page but now I would like to use text
links instead of buttons.

I hope I helped you to understand and give me some help :)
Thaks a lot!
Korakidis Christos

Webmaster wrote:
> Hi,
> i hope I got you right.
>
> You can send data to the next php file by HTTP-GET.
> Simply add a ? behind the link and then <variablename>=<value>.
> Example ./jumpto.php?to=searchProduct
>
> In the jumpto.php you would ask the Global Array for Get Variables for the
> entry and then decide what to do.
>
> Example:
>
> sf($_GET["to"] == "searchProduct"){
> header("Location: ./searchProduct.php");
> }
>
> Or if you have a lot of locations to jump to you could do that by case.
>
> switch($_GET["to"]){
> case "seachProduct":
> header("Location: ./searchProduct.php");
> break;
> case "seachMember":
> header("Location: ./searchMember.php");
> break;
> }
>
> I hope that helped.
>
> Greetings
> Mirco Blitz

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация