944,137 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Marked Solved
  • Views: 904
  • PHP RSS
You are currently viewing page 1 of this multi-page discussion thread
Nov 4th, 2009
0

php code error

Expand Post »
When I run my fie and open this one folder, I get this error message
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/ezbiz/public_html/ar/templates/a_settings.html on line 61


Any help will be greatly appreciated.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ez123 is offline Offline
4 posts
since Nov 2009
Nov 4th, 2009
0
Re: php code error
Why don't you show the code near those lines? You look like having forgotten a ";" at the end of line 60
Reputation Points: 22
Solved Threads: 1
Light Poster
kolibrizas is offline Offline
45 posts
since May 2009
Nov 4th, 2009
0
Re: php code error
why would you post 'php code error' in the java forum?
Reputation Points: 874
Solved Threads: 352
Posting Maven
BestJewSinceJC is offline Offline
2,758 posts
since Sep 2008
Nov 4th, 2009
-1
Re: php code error
moved
Moderator
Featured Poster
Reputation Points: 2786
Solved Threads: 874
Code tags enforcer
peter_budo is offline Offline
6,659 posts
since Dec 2004
Nov 4th, 2009
0

PHP error

Click to Expand / Collapse  Quote originally posted by kolibrizas ...
Why don't you show the code near those lines? You look like having forgotten a ";" at the end of line 60
Thanks for the response. Unfortunely I am not a PHP programmer. I have ascritp with this error.

Here is the total file, if you would review it I would appreciate it much.

PHP Syntax (Toggle Plain Text)
  1. <script language=javascript>
  2. function validateForm(frm)
  3. {
  4. var pass=frm.pass.value;
  5. var repass=frm.repass.value;
  6.  
  7. if(pass!=repass)
  8. {
  9. alert("Password confirmation failed");
  10. return false;
  11. }
  12.  
  13. frm.submit();
  14. }
  15. </script>
  16.  
  17. <h1 align=center>Future 2019 AD Autoresponder Settings</h1>
  18.  
  19. <form method=post>
  20. <table align=center style="border:1px solid black;" cellpadding=7>
  21. <tr><th colspan=2>Administrator login info</th></tr>
  22. <tr><td width=150>Change Password:</td>
  23. <td width=300><input type=password name=pass size=30></td></tr>
  24. <tr><td width=150>Confirm New Password:</td>
  25. <td width=300><input type=password name=repass size=30></td></tr>
  26. <tr><td colspan=2 align=center>
  27. <input type=hidden name=admin value=1>
  28. <input type=button onclick="javascript:validateForm(this.form);" value="Save Admin Info">
  29. </td></tr>
  30. <tr><td colspan=2>&nbsp;</td></tr>
  31. <tr><th colspan=2>General Site Settings</th></tr>
  32. <?php
  33. if($register)
  34. {
  35. ?>
  36. <tr><td>Double opt-in:</td>
  37. <td><select name=optin>
  38. <option value=1 <?if(get_setting('optin')) echo 'selected'?>>On</option>
  39. <option value=0 <?if(!get_setting('optin')) echo 'selected'?>>Off</option>
  40. </select></td></tr>
  41. <?php
  42. }
  43. ?>
  44. <tr><td>Email sending*:</td>
  45. <td><select name=send>
  46. <option value=1 <?if($send) echo 'selected'?>>Immediate</option>
  47. <option value=0 <?if(!$send) echo 'selected'?>>Delayed (Cron job)</option>
  48. </select></td></tr>
  49. <?php
  50. if(!$send)
  51. {
  52. ?>
  53. <tr><td>Mails per hour</td>
  54. <td><input type=text name=mph value="<?=$mph?>" size=6></td></tr>
  55. <?php
  56. }
  57. ?>
  58. <tr><td>Delay between mails**:</td>
  59. <td><input type=text name=delay value="<?=$delay?>" size=6> seconds</td></tr>
  60. <tr><td>Website name:</td>
  61. <td><input type=text name=site value="<?=get_setting("site") size="20"?>" size=30></td></tr>
  62. <tr><td>Default sender:</td>
  63. <td><input type=text name=sender value="<?=$sender?>" size=30></td></tr>
  64. <tr><td colspan=2 align=center><br>
  65. <input type=submit name=general value="Save General Settings">
  66. </td></tr>
  67. </table>
  68. </form>

Thanks again for any help you will offer.
Jim
Last edited by Ezzaral; Nov 4th, 2009 at 6:55 pm. Reason: Added [code] [/code] tags. Please use them to format any code that you post.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ez123 is offline Offline
4 posts
since Nov 2009
Nov 4th, 2009
0
Re: php code error
PHP Syntax (Toggle Plain Text)
  1. <?=$delay?>
look at this place and similar ones
what i can say (maybe I am not experienced in such things), but if you say this is php, then I think it is quite a bad code here. I think it should be
PHP Syntax (Toggle Plain Text)
  1. <?php echo $delay; ?>
So there are 3 things to fix:
1. always use <?php instead of <?
2. if you want $delay to be printed, write echo $delay
3. add a semicolon ";" at the end of each sentence
Hope that helps you with problem, cause when I opened this file in my server, I saw many strange things, because my server does not understand <? ?> as being php. Fix like this and I am sure you will make a step forward. If I failed at understanding the problem, then I am sorry. I still hope I helped a bit.
Reputation Points: 22
Solved Threads: 1
Light Poster
kolibrizas is offline Offline
45 posts
since May 2009
Nov 4th, 2009
-1

PHP ERROR

Click to Expand / Collapse  Quote originally posted by kolibrizas ...
PHP Syntax (Toggle Plain Text)
  1. <?=$delay?>
look at this place and similar ones
what i can say (maybe I am not experienced in such things), but if you say this is php, then I think it is quite a bad code here. I think it should be
PHP Syntax (Toggle Plain Text)
  1. <?php echo $delay; ?>
So there are 3 things to fix:
1. always use <?php instead of <?
2. if you want $delay to be printed, write echo $delay
3. add a semicolon ";" at the end of each sentence
Hope that helps you with problem, cause when I opened this file in my server, I saw many strange things, because my server does not understand <? ?> as being php. Fix like this and I am sure you will make a step forward. If I failed at understanding the problem, then I am sorry. I still hope I helped a bit.
Thanks for the information. I will tinker with it tonight and hopefully these suggestions will solve my delimna.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ez123 is offline Offline
4 posts
since Nov 2009
Nov 4th, 2009
1
Re: php code error
Click to Expand / Collapse  Quote originally posted by kolibrizas ...
PHP Syntax (Toggle Plain Text)
  1. <?=$delay?>
look at this place and similar ones
what i can say (maybe I am not experienced in such things), but if you say this is php, then I think it is quite a bad code here. I think
That is an acceptable way to echo a variable within HTML code,

The problem is this line (Line 61):
PHP Syntax (Toggle Plain Text)
  1. <td><input type=text name=site value="<?=get_setting("site") size="20"?>" size=30></td></tr>
size="20" is within the PHP braces.
Reputation Points: 96
Solved Threads: 124
Master Poster
Will Gresham is offline Offline
728 posts
since May 2008
Nov 5th, 2009
0
Re: php code error
@ez123 : Apart from above, there is one more mistake on the same line-
PHP Syntax (Toggle Plain Text)
  1. name=site
should be like -
PHP Syntax (Toggle Plain Text)
  1. name="site"
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 5th, 2009
0
Re: php code error
That is an acceptable way to echo a variable within HTML code,

The problem is this line (Line 61):
PHP Syntax (Toggle Plain Text)
  1. <td><input type=text name=site value="<?=get_setting("site") size="20"?>" size=30></td></tr>
size="20" is within the PHP braces.
Click to Expand / Collapse  Quote originally posted by network18 ...
@ez123 : Apart from above, there is one more mistake on the same line-
PHP Syntax (Toggle Plain Text)
  1. name=site
should be like -
PHP Syntax (Toggle Plain Text)
  1. name="site"
OK, thanks, I will know that from now
Reputation Points: 22
Solved Threads: 1
Light Poster
kolibrizas is offline Offline
45 posts
since May 2009

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Check Boxes Update A Simple Y/N Field in mysql using php
Next Thread in PHP Forum Timeline: Displaying files from database





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC