Verifying current page to run a function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mozack
Forum Newbie
Posts: 2
Joined: Sun Dec 06, 2009 7:45 am

Verifying current page to run a function

Post by mozack »

Hi,

I'm new here and i really need your help. I'm doing a script to one online store, and it is an offline payment processor that generate a code to pay with credit card (Offline). When it generate the code, the script send an sms text message to customer with generated data... My problem is that it always send the sms in checkout and orders page....

I'm trying this:

Code: Select all

$message = $sms;
		 $finishorder = GetConfig('ShopPathSSL')."/finishorder.php?provider=".$this->GetId();
     		 $currentpage = GetConfig('ShopPathSSL').$_SERVER["REQUEST_URI"];
		 $accountpage = GetConfig('ShopPathSSL')."/account.php?acion=order_status";
		 if ($finishorder == $currentpage){
		 return $message;		 
		 }
		 elseif ($finishorder == $accountpage) {
			return false;
		 }

Is there something wrong? with this code it stops sending any sms, if i remove that it sends always, on checkout and in orders page.

If someone can help me, i appreciate.

Thanks

Mozack
Post Reply