Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:12:52+00:00 2026-05-24T21:12:52+00:00

How to call this function with url parameter function test($str, $str_){ if ($str ==

  • 0

How to call this function with url parameter

function test($str, $str_){

     if ($str == $str)
     echo "null";
     else
     echo "helloworld";
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:12:53+00:00Added an answer on May 24, 2026 at 9:12 pm

    Use this:

    switch($_GET['cmd']) {
    case 'hello':
        test($_GET['cmd'],'second_parameter_value');
    }
    

    The problem is that you aren’t passing a value for the second parameter. I execute previous code and prints “helloworld”

    Second part:

    If your intention is to call the function using two parameters in the Url you can use the follow (I’m only modifying the important parts in your own initial code):

    function test($str, $str_){
    
         if ($str == "null")
            echo "null";
         else
            echo "helloworld";
    }
    
    switch($_GET['cmd']) {
    case 'hello':
        test($_GET['cmd'],$_GET['cmd2']);
    }
    

    and the Url to call this is: execute.php?cmd=hello&cmd2=hello2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I retrive parameter url inside call back function? Function declared in global
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
When I call this function, everything works, as long as I don't try to
If I want to trigger an error in my interpreter I call this function:
I have a UDF in sql server. I want to call this function at
I intended for this function to call my MVC action method that returns a
I have this function: RegisterGlobalHotKey(Keys.F6, MOD_SHIFT | MOD_CONTROL); which call an API to register
I'm trying to call a function that contains jQuery code. I want this function
I've got an html page from where Im making this call periodically: function logon(id)
I have a JavaScript function, pop_item . I have to call this from PHP,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.