testing php script?anyone can test thist for me or tell me how to test this code

<?php //S101, S102, S103, S104, S105 // include the language file $_SESSION['site_lang'] = _ADMIN_SHOW("xt_languages WHERE lang_default='t'",lang_name); require("../Files/LANG/{$_SESSION['site_lang']}.lang.php"); $_SESSION['cur'] = _ADMIN_SHOW("xt_config_currency WHERE cur_default='t' AND cur_status='t' ORDER BY id ASC LIMIT 1",id); $_REQUEST['m'] = strtolower($_REQUEST['m']); //print_r($_REQUEST); //echo _CHECKIT('xt_phones','pnumber',"pnumber='{$_REQUEST['p']}'",phone); // check if mobile is already in the db $_REQUEST['p'] = str_replace("+","",$_REQUEST['p']); $_REQUEST['p'] = str_replace(" ","",$_REQUEST['p']); $_REQUEST['p'] = str_replace("-","",$_REQUEST['p']); $_REQUEST['p'] = str_replace("(","",$_REQUEST['p']); $_REQUEST['p'] = str_replace(")","",$_REQUEST['p']); $_REQUEST['p']= str_replace("[","",$_REQUEST['p']); $_REQUEST['p'] = str_replace("]","",$_REQUEST['p']); $_REQUEST['p'] = str_replace("011","",$_REQUEST['p']); $_REQUEST['p'] = str_replace("001","",$_REQUEST['p']); // seperate the body list($key, $body) = split(' ', $_REQUEST['m']); $sitename = _ADMIN_SHOW(xt_config_page,'site_title'); // check to match -- yes! if(_CHECKIT('xt_phones','pnumber',"pnumber='{$_REQUEST['p']}'",phone)){ // verify phone if(preg_match('/^ver/', $key, $matches, PREG_OFFSET_CAPTURE)){ require("sms-jobs/verify-phone.php"); // balance }else{ // make sure phone is verified first if(_ADMIN_SHOW("xt_phones WHERE pnumber='{$_REQUEST['p']}' LIMIT 1",status) == 'v'){ if(preg_match('/^bal/', $key, $matches, PREG_OFFSET_CAPTURE)){ require("sms-jobs/balance.php"); // request funds }elseif(preg_match('/^req/', $key, $matches, PREG_OFFSET_CAPTURE)){ require("sms-jobs/request-money.php"); // confirm }elseif(preg_match('/^conf/', $key, $matches, PREG_OFFSET_CAPTURE)){ require("sms-jobs/confirm-sms.php"); // confirm }elseif(preg_match('/^sen/', $key, $matches, PREG_OFFSET_CAPTURE)){ require("sms-jobs/send-money.php"); }else{ echo "Unable to process keyword, make sure it is correct and in the beginning of message. EC: S102"; } // end keywords }else{ echo "You must verify your mobile number first. Login to your $sitename account and follow phone verification instructions."; } }// end verify }else{ echo "Mobile number doesn't appear to be in our database. Please add it to your account first. EC: S101-{$_REQUEST['p']}"; } // end check match //echo "$key"; ?>

This code will not work as-is!

First, you should NOT set $_REQUEST variables. To parse thru them or remove info in them you must first assign them to a variable. If not, there would be odd results.

So this: $_REQUEST[‘p’] = str_replace("+","",$_REQUEST[‘p’]);

should be something like:
$p = str_replace("+","",$_REQUEST[‘p’]);
$p = str_replace(" “,”",$_REQUEST[‘p’]); etc…

Next, you set two session variables without a session running and you do not set them to strings. You set them to a class sub-function “_ADMIN_SHOW”… Not sure if that would work that way. But, no session has been started, so it would not work with just that code!

And, further down you use more class sub-functions which will not work.

So, I think you do not understand classes. Basically, you create a class, let’s say we call it “myRoutines”.
Next we create functions in the class, let’s say we create one and call it “CHECKIT".
So, calling this function would be handled something, in general, like: myRoutines->CHECKIT(option,option);
Or something like $x=myRoutines->ADMIN_SHOW(opt1,opt2);
Which may or may not make sense. We would need all of your code to make sense of this.
Also, If you posted a “template”, that is another story as an underscore ("
”) could be your indication of an area that can be altered by the calling program…

Sorry, can’t make full sense of this code…

can i send all my code as an email to you , so you can show me how it will work ?
maybe you can help me out i stick this code about 3 months , with the sms function to get it work .

Well, if it is a lot of code, yes. You can private message me and I will send my email to you.
If it is not too large, you can post it here and others will help too.

If you do post here, please put the code inside the PHP tags above. It’s easier to work with that way.
And, of course, do not post your userid’s or passwords to your database…

(I am leaving for an hour, but, will be home later!)

ok , i’ll send by email , waiting for your email adress . see pm message . thx

ok thx , let me know when you have the file already .

There is no file attached in those emails. Sorry!

Sponsor our Newsletter | Privacy Policy | Terms of Service