Jump to content

Recommended Posts

Posted

Hi, 

I create this paypal form by paypal site.

 

<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="N922SN77XG7WE">
<table>
<tr><td><input type="hidden" name="on0" value="Scegli uno di questi PIANI DI ASSUNZIONE A DISTANZA. Grazie!">Seleziona e clicca. Grazie!</td></tr><tr><td><select name="os0">
    <option value="BRONZE - </option>
    <option value="SILVER - </option>
    <option value="GOLD - </option>
    <option value="PLATINUM - </option>
    <option value="DIAMOND - e</option>
</select> </td></tr>
</table>
<input type="hidden" name="currency_code" value="EUR">
<input type="image" src="https://www.paypalobjects.com/it_IT/IT/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal">
<img style="text-align:center;" alt="" border="0" src="https://www.paypalobjects.com/it_IT/i/scr/pixel.gif" width="1" height="1">
</form>

 

Now I put it into my html file template. Ok.

But can I put it into another file html?

It isn't part of the template!

The same template I use in another pages, but that form don't want is there and anywhere! 

Exist a form modules for processwire, with an api or code - string for link it from template file?

Excuse me if I don't explain my problem well. 

 

 

 

 

 

Posted

on the page where you want to output the form, you can just conditionally load that markup from a .php, .inc, or .html file, depending on what your needs are.

for example:

<?php

if($page->name == 'my-special-page') {
  	// html version
    $form = file_get_contents($config->paths->templates . 'forms/my-form.html');
  	// OR wireRender
    $form = wireRenderFile($config->paths->templates . 'forms/my-form.php');
  	echo $form;
  
  	// or
  	include($config->paths->templates . 'forms/my-form.php');
  
}

 

  • Like 2
Posted

so, do you think this code line is right?

<?php if($page->name == 'http://www.mysite.info') {include($config->paths->templates . 'assets/forms/paypal-form.html');} ?>

 

...but processwire haven't any "Form Field"?

Then, it's a php code into a html doc. Exist a way to separate file php and php code, from html code, putting it in another little file?

So, is it incorrect or don't work, I open read and rewrite only that little file.

 

 

 

Posted

i don't believe you can PHP 'include' an html file, that's what my example shows, e.g. if you include then you change it to .php, or .inc.
I don't know what you mean about 'form field', to confirm your question, there is no such field.

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...