Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#13 2011-09-06 02:25:11
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: Inserting php into code
There’s nothing to repost as it’s still the same error. See here; http://txpshadow.apatalk.com/services/welcome-to-your-site#
I simply just copied and pasted Jakob’s code along with installing the suggested plugin . Thanks!
Last edited by dreamer (2011-09-06 02:25:24)
Offline
Re: Inserting php into code
I don’t see how Jakob’s code could cause that error, so I suspect it’s something else… unless you put the entire block of Jakob’s code inside <txp:php> tags (don’t do that).
Offline
#15 2011-09-07 05:16:01
- dreamer
- Member
- Registered: 2007-06-08
- Posts: 242
Re: Inserting php into code
Thanks for pointing that out. I deleted the <txp:php> tags and am closer.
I slightly modified Jakob’s code here
<label for=file_upload>Have Files?</label><input id=“file_upload” name=“file_upload” type=“file” />
and turned it into this;
“<label for=file_upload>Have Files?</label><input id=”\file_upload\” name=”\file_upload\” type=”\file\” />”;
so that the “Have Files’ field would appear. However
a) it won’t allow me to upload any files
b)the submit button won’t work
Last edited by dreamer (2011-09-07 05:16:14)
Offline
Offline
Re: Inserting php into code
I slightly modified Jakob’s code here
<label for=file_upload>Have Files?</label><input id=“file_upload” name=“file_upload” type=“file” />and turned it into this;
“<label for=file_upload>Have Files?</label><input id=”\file_upload\” name=”\file_upload\” type=”\file\” />”;
This will most likely have the effect of breaking your file input tag and maybe the label.
The quotes were only there in your originally code because php was being used to echo (output) that line of text. In that case, php needs to know where the line of text starts and ends and these are defined by quotes. But as there are further quote marks within the line of text, the php echo statement needs to know that it should skip any interim quotes by putting a slash in front of them. That is only necessary if you are echo-ing the line of text with php. In my code block above we’re outputting the tag normally so none of that is necessary.
Using my original code:
- Can you see
<label for="file_upload">Have Files?</label>
in your source code. If it is there in the source code, you have some css in there hiding the label. - Is the variable
uploadify
set to yes at the top of the code (if you didn’t include that or you set it to something other than yes that whole section of code will not be output)
TXP Builders – finely-crafted code, design and txp
Offline
Re: Inserting php into code
^^ yes, change this:
"<label for=file_upload>Have Files?</label><input id="\file_upload\" name="\file_upload\" type="\file\" />";
into this:
<label for=file_upload>Have Files?</label><input id="file_upload" name="file_upload" type="file" />
And you’ll at least have an input field that allows you to select a file (though you may have to style it a bit to make it look better). That also makes the submit button work (work = it responds, not necessarily performing any action server-side).
Offline