I’m getting this error:
Parse error: syntax error, unexpected T_CLASS, expecting ‘,’ or ‘;’ in /home/public_html/uploader.php on line 6"
Can you help me find how/where to correct the error?
if(isset($_SESSION['channel_id'])) {
echo '<input type="hidden" name="channel" value="1" />
} else {
echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">
[var.fields_all;htmlconv=no]</select>';
}
Any help will be appreciated.
ChrisjChrisj:
I’m getting this error:
Parse error: syntax error, unexpected T_CLASS, expecting ‘,’ or ‘;’ in /home/public_html/uploader.php on line 6"
What program or browser give the error?
I think there are too many single quotes.
I have very little knowledge of JavaScript. With most other languages it is possible to add line feed to make the script more readable.
<script type="text/javascript">
if( isset($_SESSION['channel_id']) )
{
echo '<input type="hidden" name="channel" value="1" />'
}else{
echo ''
+ '<select class="upload-video-form-input"'
+ ' name="channel"'
+ ' onchange="javascript:ahahscript.ahah([var.base_url]/uploader.php?sub_cat='
+ document.form_upload.channel.value
, 'sub_change'
, ''
, 'GET'
, ''
, this);> [var.fields_all;htmlconv=no]
</select>';
}
</script>
<!--
<script type="text/javascript">
if(isset($_SESSION['channel_id'])) {
echo '<input type="hidden" name="channel" value="1" />'
} else {
echo '<select class="upload-video-form-input" name="channel" onchange="javascript:ahahscript.ahah('[var.base_url]/uploader.php?sub_cat='+ document.form_upload.channel.value, 'sub_change', '', 'GET', '', this);">'
[var.fields_all;htmlconv=no]</select>';
}
</script>
-->
Thank you for your reply.
I added '; on the end of:
echo '<input type="hidden" name="channel" value="1" />
as instructed, but now I see this:
Parse error: syntax error, unexpected ‘[’, expecting ‘,’ or ‘;’ in /home/public_html/uploader.php on line 6
any help with fixing this error will be appreciated.
I would be tempted to create another very simple script and gradually include parameters until the script breaks.
Also test variables using alerts.
Maybe someone more knowledgeable can rectify the problem?
Yes, the second echo statement seems to be delimited by single-quotes, but also contain single quotes as part of the JavaScript function call. Might be easier to surround it with double quotes and change the html option values to use single ones.
1 Like
system
Closed
November 6, 2016, 2:20am
8
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.