Hi,

I don't know if I have just been working too much or have gone brain dead (or both), but the solution to this eludes me.

I am using PHORM ( a PHP form processor) which uses variable substitution to allow you to quickly create user interaction pages etc. What I am doing here is creating an application over two pages. On the first page, we are collecting membership application info, including the type of membership and how they would like to pay for their membership (PayPal or invoicing). How PHORM works is that when you submit the form, the output is sent to the phorm.php script which does certain things, depending on the config for that form. In this case, it sends an email to the site owner, a confirmation email to the user and then redirects them to an acknowledgment page (page 2 of our little app). What I want is for all of this to happen as stated but, on the acknowledgment page, based on on the type of membership and payment preferences, build a Paypal button to submit the appropriate payment or, if they are being billed, simply indicate that they will receive an invoice via mail or email, as the case may be.

PHORM uses variables in the form of {{field name from form}}. So in our case here, the values that I need are available on the acknowledgment page as {{howPay}} and {{appType}}. However, I am trying to use variations on the following in order to show or not show certain info on the page:

<?php if ({{howpay}} == paypal) { ?>

or

<?php if ($_POST['howpay'] == paypal) { ?>

but with no success. In the first case, when you look at the code, you just see

<?php if (paypal == paypal) { ?>

which does not seem to work. I even tried:

<? $pay = {{howpay}} ?>

but that does not work either.

I would appreciate a fresh pair of eyes on this and a fresh brain.

Thanks

Dave

Recommended Answers

All 3 Replies

Member Avatar for diafol

Do you need to enclose paypal within quotes?
This is a templating engine I take it.

<?php 
  if({{howpay}} == "paypal"){
...
}
?>

Do you need to enclose paypal within quotes?
This is a templating engine I take it.

<?php 
  if({{howpay}} == "paypal"){
...
}
?>

I have tried using quotes but that did not work either.

Phorm is not really a templating engine. It is simply a big PHP script that handles various types of form submits. See http://www.php-form.net

Dave

Member Avatar for diafol

I have tried using quotes but that did not work either.

Phorm is not really a templating engine. It is simply a big PHP script that handles various types of form submits. See http://www.php-form.net

Dave

Can't see any documentation on the site, and I ain't gonna download the app.

How about:

if($_POST[{{howpay}}] == "paypal") ...

If so, I fail to see the use of the variable name swapping.

Can you do a print_r($_POST)?

That should give you the name of all the form posted variable keys and values.

Hmm, just thought, I expect you are passing variables via POST and not GET.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.