. macro and $_GET in scriptInit event

Hello,
I need to get a variable value from an url parameter and use sc_select_where(add) macro on scriptinit event like this :

sc_select_where(add) = " where Code_Affaire =’".$_GET[‘paramGl’]."’ " ;
The problem is the variable is usually empty or null.

Can you help me please?

AFAIK ScriptCase doesn’t modify the $_GET variable.

Where and how are you adding the paramGI in the url? And are you sure the original value isn’t empty?

The problem could be that Scriptcase is treating the variable as a global. The quotes I’m uncertain of. Try this:

$myvar = $_GET[‘paramGI’];
sc_select_where(add) = " where Code_Affaire =’$myvar’" ;

If paramGI is still not right then do a dumpvar of your $_GET because I’m pretty certain that the url is wrong.

Hi,
In my application I put the url into a variable
$lien="<a href='http://127.0.0.1:97/Aff1/controlMail/controlMail.php?paramGl=’.{Code_Affaire}.’></a>";
and i send it on email.
controlMail is a control apllication ,it contains login and password ,when the user logged on successfully he will be redirected
to an another application that contains the specific record.
The problem is: the parameter is usually empty ,i tried to display on controlMail apllication and it was also empty.
Please help :confused:

Use this

if ( !empty($_REQUEST) && !empty($_REQUEST[‘parmGI’]) ) {

**** your code here*****

example code

sc_select_where(add) = ( $_REQUEST[‘parmGI’] );

}

use onappini or onscriptini

above is a example, I’m not sure of your full code and trying to help maybe needs to be like this in the if event

​$details=( $_REQUEST[‘parmGI’] );

then use $details for anything

I can solve for you but need more details

Hi,
This is how i send the email on php buttuon event:
$rows=array(“ismo@x.com”);;
$smtp=“test”;
$usr =“user@user”;
$pw = “testtest”;
$out = “user@user.”;
$sbj = “”;

$lien="<a href=‘http://127.0.0.1:97/Aff1/controlMail/controlMail.php? paramGl’.{Code_Affaire}’>";
$msg = “<h4>Bonjour,</h4>”;
$mail_port = ‘’;
foreach ($rows as $in)
{
sc_mail_send ($smtp, $usr,$pw, $out, $in, $sbj, $msg,‘H’, ‘’, ‘’, $mail_port);
}

When i display {Code_Affaire},it contains a value .
I think that the assignment is not done.

What does the url look like when it is processed ? can you copy and paste the url here please

I think your issue is here <a href=‘http://127.0.0.1:97/Aff1/controlMail/controlMail.php? paramGl’.{Code_Affaire}’>";

paramGI=’.{Code_Affaire}’>"; you forgot the =

The url is like this:
http://127.0.0.1:97/Aff1/controlMail/controlMail.php?paramGl=

is it blank after the paramGl= ?

Yes it is a blank.

So nothing is being passed can you change this bit paramGl’.{Code_Affaire}’>"; to /controlMail.php?paramGl="’.{Code_Affaire}’; and try that please

Basecly i tried it like this :
"<a href=‘http://127.0.0.1:97/Aff1/controlMail/controlMail.php?paramGl=’.{Code_Affaire}’></a>
The assignment paramGl=’.{Code_Affaire}’ fail unless the {Code_Affaire} contains value.
Can i find a function or another way to send this parameter?

I can Skype you to help, its really hard without seeing fully the full code and logic. pm me