Jump to content
MakeWebGames

Recommended Posts

Posted

ok. i'm scripting a page and have a few problems.

1. It says that the scrpit requires an action when it has the following action.

<form action='police_investigation.php?action=policeisub' method='post'>

and at the begining of the scrpit i have.

case 'policeisub': police_investigation_submit(); break;

 

2. Even though i have used the print code within a function none of the stuff i'm supposed to print shows up. why is this?

Posted

Re: this scrpit requires an action

Ya here is an example...

 

switch($_GET['action'])
{
case "one" : blah_one(); break;
case "two" : blah_two(); break;
default : echo 'This script requires an action'; break;
}
function blah_one()
{
echo 'Blah one';
}
function blah_two()
{
echo 'Blah two';
}

Now to access it you would do.
[url="scriptname.php?action=one"]Action one[/url]

[url="scriptname.php?action=two"]Action two[/url]

 

See if you under stand that.

Where is the one, two coming from?

case "blah" :          blah_one(); break;
       ^ name here   ^ function name here
Posted

Re: this scrpit requires an action

thats exactly what i have except for instead of " i use ' and instead of "echo" i use "print" and instead of Action one

i use

<form action='filename.php?action=one' method='post'>

then i use a dropbox (which doesn't show up)

then i use

<input type='submit' value='button name' /></form>";

Posted

Re: this scrpit requires an action

Your making it say that...with the Default switch sounds like you took it from a staff page cuase thats what they do if you go straight to the page it says that. You need to set a default for the apge.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...