• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

BUG Reading from an array

Jscudder

New member
Messages
3
Likes
1
Points
1
#1
The following piece of code worked very nicely with the old Insert PHP plugin. (The code below is just a portion of the entire page code)

Code:
[insert_php] echo ReadArray(); [/insert_php]
<div align="center">
<table style="border-style: none; border-width: 0;" border="0" width="100%">
<tbody>
<tr>
<td style="border-style: none;" width="100%">Please sign up by filling in the form below.  Then press the <b>Submit</b> button when you have entered your name and have checked the time slots you would like.
</td>
</tr>
<td style="border-style: none;" width="100%"><form action="../menprocess.php" method="POST">
<div align="center">
<table style="border-style: none; border-width: 0;" border="0" width="50%">
<tbody>
<tr>
<td style="border-style: none;" width="30%"></td>
<td style="border-style: none;" width="8%">First Name:</td>
<td style="border-style: none;" width="62%"><input name="First" size="36" type="text" /></td>
</tr>
<tr>
<td style="border-style: none;" width="30%"></td>
<td style="border-style: none;" width="8%">Last Name:</td>
<td style="border-style: none;" width="62%"><input name="Last" size="36" type="text" /></td>
</tr>
</tbody>
</table>
</div>
I made a PHP Woody snippet containing the line ' echo ReadArray(); ' and placed the shortcode in place of the previous [insert_php] tags.

Code:
[wbcr_php_snippet id="8332"]
<div align="center">
<table style="border-style: none; border-width: 0;" border="0" width="100%">
<tbody>
<tr>
<td style="border-style: none;" width="100%">Please sign up  by filling in the form below.  Then press the <b>Submit</b> button when you have entered your name and have checked the time slots you would like.
</td>
</tr>
<td style="border-style: none;" width="100%"><form action="../menprocess.php" method="POST">
<div align="center">
<table style="border-style: none; border-width: 0;" border="0" width="50%">
<tbody>
<tr>
<td style="border-style: none;" width="30%"></td>
<td style="border-style: none;" width="8%">First Name:</td>
<td style="border-style: none;" width="62%"><input name="First" size="36" type="text" /></td>
</tr>
<tr>
<td style="border-style: none;" width="30%"></td>
<td style="border-style: none;" width="8%">Last Name:</td>
<td style="border-style: none;" width="62%"><input name="Last" size="36" type="text" /></td>
</tr>
</tbody>
</table>
</div>
I am thinking it should work, but it completely trashes the page. What am I doing wrong??

John
 

Temyk

Developer & Support
Messages
1,129
Likes
42
Points
48
#2
Hi,

Each snippet is executed separately from the other snippets. So they don't see each other's variables.

Where do you have the ReadArray() function declared? Most likely you will need to include all the code of this function in the snippet [wbcr_php_snippet id= " 8332"]