| | |
Syntax Errors
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2008
Posts: 30
Reputation:
Solved Threads: 0
Hello,
I'm having trouble with these syntax errors & need some help. Thanks!
Parse error: syntax error, unexpected T_STRING in /home/a3933825/public_html/require.inc.php on line 43
function footer() {
?>
<CENTER>
<table>
<tr>
<td class="font"align=center><a href="start.php?option=contact">-contact us-</a> <a href="privacy.htm" target="_NEW">-privacy policy-</a> <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr>
</table>
</CENTER>
<?
}
?>
I also get the following syntax error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '{' in /home/a5957980/public_html/includes/functions.php on line 18
Here's the code:
<?
$conf = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE id = 1"));
function get_num_websites()
{
$query = mysql_query("SELECT * FROM urls");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_banners()
{
$query = mysql_query("SELECT * FROM banners");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_users()
{
$query = mysql_query("SELECT * FROM users");
$numrows = mysql_num_rows($query); <<<<<<<<<<<< line 18
return $numrows;
}
I don't understand why i'm getting an error since I have the same string earlier in the code & I don't get an error on that.
Thank you,
StreeRodFanatik
I'm having trouble with these syntax errors & need some help. Thanks!
Parse error: syntax error, unexpected T_STRING in /home/a3933825/public_html/require.inc.php on line 43
function footer() {
?>
<CENTER>
<table>
<tr>
<td class="font"align=center><a href="start.php?option=contact">-contact us-</a> <a href="privacy.htm" target="_NEW">-privacy policy-</a> <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr>
</table>
</CENTER>
<?
}
?>
I also get the following syntax error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '{' in /home/a5957980/public_html/includes/functions.php on line 18
Here's the code:
<?
$conf = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE id = 1"));
function get_num_websites()
{
$query = mysql_query("SELECT * FROM urls");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_banners()
{
$query = mysql_query("SELECT * FROM banners");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_users()
{
$query = mysql_query("SELECT * FROM users");
$numrows = mysql_num_rows($query); <<<<<<<<<<<< line 18
return $numrows;
}
I don't understand why i'm getting an error since I have the same string earlier in the code & I don't get an error on that.
Thank you,
StreeRodFanatik
and post all of your code from require.inc.php because this is not 43 lines
php Syntax (Toggle Plain Text)
function footer() { ?> <CENTER> <table> <tr> <td class="font"align=center><a href="start.php?option=contact">-contact us-</a> <a href="privacy.htm" target="_NEW">-privacy policy-</a> <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr> </table> </CENTER> <? } ?>
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
•
•
Join Date: Oct 2008
Posts: 30
Reputation:
Solved Threads: 0
<td class="font"align=center><a href="start.php?option=contact">-contact us-</a> <a href="privacy.htm" target="_NEW">-privacy policy-</a> <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr>
^^^^^^^^^^^^^^^^^^^this is line 43
as far as "It would be better if you put your code in code tag. Easier to look through."
I don't know what that means. This is how it is in the script.
^^^^^^^^^^^^^^^^^^^this is line 43
as far as "It would be better if you put your code in code tag. Easier to look through."
I don't know what that means. This is how it is in the script.
Last edited by streetrodfanati; Oct 4th, 2008 at 9:24 pm.
•
•
•
•
as far as "It would be better if you put your code in code tag. Easier to look through."
I don't know what that means. This is how it is in the script.
.... Read the rules of the forum before posting, the code tags are explained in the paragraph at the top of the PHP forum main page which also links to this page you should read the last paragraph on there which details the repercussions of not using code tags.
Also, you would have been asked to provide the code since problems can't be seen in the code you posted, it is possible PHP is reporting a line other than the one it appears to be which could be above or below what you quoted.
Last edited by Will Gresham; Oct 4th, 2008 at 9:37 pm.
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
Join Date: Oct 2008
Posts: 30
Reputation:
Solved Threads: 0
PHP Syntax (Toggle Plain Text)
<td class="font"align=center><a href="start.php?option=contact">-contact us-</a> <a href="privacy.htm" target="_NEW">-privacy policy-</a> <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr>
PHP Syntax (Toggle Plain Text)
<? $conf = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE id = 1")); function get_num_websites() { $query = mysql_query("SELECT * FROM urls"); $numrows = mysql_num_rows($query); return $numrows; } function get_num_banners() { $query = mysql_query("SELECT * FROM banners"); $numrows = mysql_num_rows($query); return $numrows; } function get_num_users() { $query = mysql_query("SELECT * FROM users"); $numrows = mysql_num_rows($query); <<<<<<<<<<<< line 18 return $numrows; }
Last edited by streetrodfanati; Oct 5th, 2008 at 12:48 am. Reason: added data
•
•
•
•
^^^ line 43PHP Syntax (Toggle Plain Text)
<td class="font"align=center><a href="start.php?option=contact">-contact us-</a> <a href="privacy.htm" target="_NEW">-privacy policy-</a> <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr>
Cannot be diagnosed until you post all the code from require.inc.php.
Last edited by R0bb0b; Oct 5th, 2008 at 12:58 am.
“Be who you are and say what you feel because those who mind don't matter and those who matter don't mind.” - Dr. Seuss
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
-- The documentation is inevitable, you may get away with it for a little while but eventually you too will have to do the deed.
•
•
Join Date: Oct 2008
Posts: 30
Reputation:
Solved Threads: 0
ok here it is
PHP Syntax (Toggle Plain Text)
<? global $username; require 'dconn.php'; session_start(); $username = @$_SESSION["username"]; $connection = mysql_connect($db_server,$db_user,$db_pass) or die(mysql_error()); mysql_select_db($db_name, $connection) or die(mysql_error()); // A few important variables to set $title = "Surfanatiks SuperSurf"; $motto = "Free hits without the bandwidth"; $siteUrl = "http://www.surfanatiks.site50.net/new/"; // remember to include the end slash $contact_email = "streetrodfanatik@gmail.com"; $paypal= "streetrodfanatik@yahoo.com"; $emailFooter = " - You are receiving this email because you are currently a member of ".$title."Surfanatiks"; // misc settings $signPoints = 1000; //points for signing up $surfTime = 20; //time to view each website $goldSurfTime = 15; //time for each gold member to surf $maxSites = 10; //total links one can put in the system $goldPrice = 1; // the monthly price of gold membership. Changing this will not affect current gold members $sreturn = .75; // points user gets per site visited (1 point = 1 hit) $goldreturn = 1; // points gold members get per site visited // advertising $bannerCost = 5; //cost per month of banners. // this is shown on the main page. This can be any html code $mainText = "Welcome to Surfanatiks Supersurf, the no-fuss traffic exchange website, where you can get visits to your websites for absolutely free, just by visiting others. We have a <b>4:3</b> ratio, that means for however many sites you visit, you get 75% of those back!<br><br> // *********************************** // ** Do not edit beyond this point ** // *********************************** function footer() { ?> <CENTER> <table> <tr> <td class="font"align=center><a href="start.php?option=contact">-contact us-</a> <a href="privacy.htm" target="_NEW">-privacy policy-</a> <a href="spam.htm" target="_NEW">-spam policy-</a><br></td></tr> </table> </CENTER> <? } ?>
Theres the problem, the line above the comment telling you not to edit, line 32, does not have an " or ; on the end and that is whats causing the problem here.
change
to
change
php Syntax (Toggle Plain Text)
$mainText = "Welcome to Surfanatiks........you visit, you get 75% of those back!<br><br>
to
php Syntax (Toggle Plain Text)
$mainText = "Welcome to Surfanatiks........you visit, you get 75% of those back!<br><br>";
AJAX is not a programming language, scripting language or any other sort of language.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
It is acheived by using JavaScript http functions.
So, AJAX = JavaScript.
•
•
Join Date: Oct 2008
Posts: 30
Reputation:
Solved Threads: 0
Great that did it! TY any ideas on the other error, it says :
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a5957980_monte'@'192.168.0.9' (using password: YES) in /home/a5957980/public_html/includes/.connect.php on line 6
Free Web Hosting
PHP Error Message
Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/a5957980/public_html/includes/.connect.php on line 7
Free Web Hosting
PHP Error Message
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/a5957980/public_html/includes/.connect.php on line 7
Free Web Hosting
PHP Error Message
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '{' in /home/a5957980/public_html/includes/functions.php on line 18
Free Web Hosting
[code<?
$conf = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE id = 1"));
function get_num_websites()
{
$query = mysql_query("SELECT * FROM urls");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_banners()
{
$query = mysql_query("SELECT * FROM banners");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_users()
{
$query = mysql_query("SELECT * FROM users");
$numrows = mysql_num_rows($query);
return $numrows;
}
function email_content($layout)
{
$GetConfig = mysql_query("SELECT * FROM config WHERE id = 1");
$conf = mysql_fetch_array($GetConfig);
$fp = fopen("includes/email_messages/".$layout.".txt", "r");
$content = '';
while(!feof($fp)) {
$content .= fread($fp, 1024);
}
fclose($fp);
$content = str_replace("{site_name}", $conf[site_name], $content);
$content = str_replace("{site_url}", $conf[site_url], $content);
return $content;
}
function optimize_tables()
{
$query = mysql_query("OPTIMIZE TABLE coonfig,users,banners,urls,sessions ");
}
function get_user_info($id)
{
$query = mysql_query("SELECT * FROM users WHERE id = '$id'");
$rows = mysql_fetch_array($query);
return $rows;
}
function get_banner_info($id)
{
$query = mysql_query("SELECT * FROM banners WHERE id = '$id'");
$rows = mysql_fetch_array($query);
return $rows;
}
function get_url_info($id)
{
$query = mysql_query("SELECT * FROM urls WHERE id = '$id'");
$rows = mysql_fetch_array($query);
return $rows;
}
function get_num_user_website($id)
{
$query = mysql_query("SELECT * FROM urls WHERE user_id = '$id'");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_user_banners($id)
{
$query = mysql_query("SELECT * FROM banners WHERE user_id = '$id'");
$numrows = mysql_num_rows($query);
return $numrows;
}
function check_email_exists($email)
{
$query = mysql_query("SELECT * FROM users WHERE email = '$email'");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_user_info_email($email)
{
$query = mysql_query("SELECT * FROM users WHERE email = '$email'");
$rows = mysql_fetch_array($query);
return $rows;
}
?>[/code]
thanks.
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'a5957980_monte'@'192.168.0.9' (using password: YES) in /home/a5957980/public_html/includes/.connect.php on line 6
Free Web Hosting
PHP Error Message
Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'nobody'@'localhost' (using password: NO) in /home/a5957980/public_html/includes/.connect.php on line 7
Free Web Hosting
PHP Error Message
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/a5957980/public_html/includes/.connect.php on line 7
Free Web Hosting
PHP Error Message
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '{' in /home/a5957980/public_html/includes/functions.php on line 18
Free Web Hosting
[code<?
$conf = mysql_fetch_array(mysql_query("SELECT * FROM config WHERE id = 1"));
function get_num_websites()
{
$query = mysql_query("SELECT * FROM urls");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_banners()
{
$query = mysql_query("SELECT * FROM banners");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_users()
{
$query = mysql_query("SELECT * FROM users");
$numrows = mysql_num_rows($query);
return $numrows;
}
function email_content($layout)
{
$GetConfig = mysql_query("SELECT * FROM config WHERE id = 1");
$conf = mysql_fetch_array($GetConfig);
$fp = fopen("includes/email_messages/".$layout.".txt", "r");
$content = '';
while(!feof($fp)) {
$content .= fread($fp, 1024);
}
fclose($fp);
$content = str_replace("{site_name}", $conf[site_name], $content);
$content = str_replace("{site_url}", $conf[site_url], $content);
return $content;
}
function optimize_tables()
{
$query = mysql_query("OPTIMIZE TABLE coonfig,users,banners,urls,sessions ");
}
function get_user_info($id)
{
$query = mysql_query("SELECT * FROM users WHERE id = '$id'");
$rows = mysql_fetch_array($query);
return $rows;
}
function get_banner_info($id)
{
$query = mysql_query("SELECT * FROM banners WHERE id = '$id'");
$rows = mysql_fetch_array($query);
return $rows;
}
function get_url_info($id)
{
$query = mysql_query("SELECT * FROM urls WHERE id = '$id'");
$rows = mysql_fetch_array($query);
return $rows;
}
function get_num_user_website($id)
{
$query = mysql_query("SELECT * FROM urls WHERE user_id = '$id'");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_num_user_banners($id)
{
$query = mysql_query("SELECT * FROM banners WHERE user_id = '$id'");
$numrows = mysql_num_rows($query);
return $numrows;
}
function check_email_exists($email)
{
$query = mysql_query("SELECT * FROM users WHERE email = '$email'");
$numrows = mysql_num_rows($query);
return $numrows;
}
function get_user_info_email($email)
{
$query = mysql_query("SELECT * FROM users WHERE email = '$email'");
$rows = mysql_fetch_array($query);
return $rows;
}
?>[/code]
thanks.
Last edited by streetrodfanati; Oct 7th, 2008 at 2:21 pm.
![]() |
Similar Threads
- XML syntax error "){" (RSS, Web Services and SOAP)
- Invalid Syntax Error MS Explorer - Please help! (Web Browsers)
- syntax errors and the check module command? (Python)
- Need help with some syntax errors (C++)
- Understanding Syntax errors for C++ (C++)
- Simple Programming Errors (Computer Science)
Other Threads in the PHP Forum
- Previous Thread: Virus scanner file(php) cannot be executed
- Next Thread: help with 3 selector
| Thread Tools | Search this Thread |
# 5.2.10 action address apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display dissertation domain dynamic echo echo$_get[x]changingitintovariable... email error errorlog fatalerror file files folder form forms function functions google href htaccess html if-else image images include insert ip javascript joomla legislation limit link load login mail masterthesis menu mlm multiple mysql mysqlquery oop open paypal pdf persist php popup problem query radio random record recursion remote script search server sessions sms sockets source space sql syntax system table tutorial update upload url validator variable video web youtube





