Jump to content

Loading function


vividona

Recommended Posts

The only thing browsers can make to web servers are HTTP/HTTPS requests. They cannot directly 'call' php code on a page or php functions within that code. They make requests for URL's.

 

The HTTP/HTTPS request that results from clicking on each individual tab/link must contain enough information so that the php code on the requested page can determine what action to take.

 

One way to do this would be to use a GET parameter on the end of the URL, something like http://your_domain.com/some_page.php?tab=some_value1, http://your_domain.com/some_page.php?tab=some_value2, http://your_domain.com/some_page.php?tab=some_value3, ... You would then access the value of the GET parameter 'tab' by referencing $_GET['tab'] in your code.

Link to comment
https://forums.phpfreaks.com/topic/194311-loading-function/#findComment-1022328
Share on other sites

Given that information... you really only have two options in the matter (well four if you count POST)

 

1.) You can use the browser to make this request.. onClick ; known as client-side

2.) You can do as PFM suggested and set the tabs as anchor links to preset URLs .. containing relevant GET/POST information to perform a server-side function.

 

There is no wrong option here, though the second one is less of a hassle.  In a client-side request.. data can be manipulated.  Also since it's client-side, users have the ability to disable their functionality on your site;Most people call this "turning off Javascript"  This rendering all your work and motives pretty useless.  Though it's really all in how you code it.  A good programmer knows how to use the noscript tag as well.

Link to comment
https://forums.phpfreaks.com/topic/194311-loading-function/#findComment-1022419
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.