| View previous topic :: View next topic |
| Author |
Message |
Mike63740 I might as well work here


Joined: Jan 07, 2010 Posts: 127 Location: Washington, DC
|
|
| Back to top |
|
 |
Mike63740 I might as well work here


Joined: Jan 07, 2010 Posts: 127 Location: Washington, DC
|
Posted: Mon May 14, 2012 5:14 pm Post subject: |
|
|
I am not sure what I have done, but it works, and it don't work.
1. I created a basic HTML page.
2. I then Inserted a table with no rows or columns.
3. I then inserted the HTML form tag.
4. I save the HTML file as \blocks\ block-Test.php
The form looks as should, when clicked, it carries out the job correctly. There is a block below it that reads, There isn't content right now. The original block.
Why is there two?
Thanks. _________________ Open-source software has been changing lives since 1998. |
|
| Back to top |
|
 |
Mike63740 I might as well work here


Joined: Jan 07, 2010 Posts: 127 Location: Washington, DC
|
|
| Back to top |
|
 |
bobby Site Admin


Joined: Jan 20, 2009 Posts: 779 Location: North Carolina
|
|
| Back to top |
|
 |
Mike63740 I might as well work here


Joined: Jan 07, 2010 Posts: 127 Location: Washington, DC
|
|
| Back to top |
|
 |
bobby Site Admin


Joined: Jan 20, 2009 Posts: 779 Location: North Carolina
|
Posted: Mon May 14, 2012 6:35 pm Post subject: |
|
|
The first thing you want to do is to keep people from accessing the file unless it is as a block. Use the opening php tag and this code to secure it.
php Code:<?php
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
|
Than you will add the heart of the code to it. Blocks wrap the content in the variable $content like so.
php Code:
$content='<form action="" method="post">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="" />
<input name="submit" type="image" src="" alt="" align="middle" border="0" />
<img alt="" border="0" src="" width="1" height="1" />
</form>';
|
You only need the form content since the theme takes care of the rest.
The only thing left is to close it with the closing php tag.
The finished block should look like this:
php Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
$content='<form action="" method="post">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="" />
<input name="submit" type="image" src="" alt="" align="middle" border="0" />
<img alt="" border="0" src="" width="1" height="1" />
</form>';
?>
|
Some html would need a few structural changes to work in the single quotes. Most will work like this. There are a lot of resources on the Internet about using html in php. Most older ones will show the double quote method which requires a few other changes to the html code. _________________ Tricked Out News |
|
| Back to top |
|
 |
Mike63740 I might as well work here


Joined: Jan 07, 2010 Posts: 127 Location: Washington, DC
|
|
| Back to top |
|
 |
bobby Site Admin


Joined: Jan 20, 2009 Posts: 779 Location: North Carolina
|
|
| Back to top |
|
 |
Mike63740 I might as well work here


Joined: Jan 07, 2010 Posts: 127 Location: Washington, DC
|
Posted: Mon May 14, 2012 7:34 pm Post subject: |
|
|
DONE!
It looks too good!
Current: \blocks\block-Test.phpphp Code:<?php
if ( !defined('BLOCK_FILE') ) {
Header('Location: ../index.php');
die();
}
$content='<form action="" method="post">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="" />
<input name="submit" type="image" src="" alt="" align="middle" border="0" />
<img alt="" border="0" src="" width="1" height="1" />
</form>';
?>
|
Bobby, as always, THANK YOU!  _________________ Open-source software has been changing lives since 1998. |
|
| Back to top |
|
 |
Mike63740 I might as well work here


Joined: Jan 07, 2010 Posts: 127 Location: Washington, DC
|
|
| Back to top |
|
 |
|
|