Avatar billede winpower Nybegynder
29. december 2003 - 03:10 Der er 11 kommentarer og
1 løsning

Kan i se fejlen?

Hejsa.

Nu har jeg sat og stirret mig blind på disse linier... er der en der kan finde fejlen?

jeg får denne fejl:
Parse error: parse error in /home/dan10466/public_html/online/includes/languages/english/define_mainpage.php on line 5

Her er noget af koden fra toppen:
<table width="100%" cellpadding="5" cellspacing="0" border=0>
    <tr>
    <td class="main" width=50% valign="top" align="right">
<?php
$mainpage_title = "We've just installed the "Define Mainpage" module!";
$mainpage_info = "
"Define Mainpage" module v1.3 by Matthijs (mattice@xs4all.nl)
<p>
This module demonstrates how easy it can be to adapt existing code in OSC.<br>
All I had to do was add one single line to define_languages.php (admin) to make
sure it always looks for the mainpage.php file. Obviously I had to then implement it
in the Admin & Catalog side, but that's not a big deal as you've just found out.<p>
You can edit the contents of this file from within the Admin ( -> CATALOG -> DEFINE MAINPAGE)<br>
For other, less advanced layouts choose either German or Spanish from the language menu. (Provided you've installed
those languages)<p>If you can't open/edit the /[language]/mainpage.php file you should probably set the right permissions. You'll get a warning anyway.
<p>Todo? Future plans? World peace through superior fire power... ehmm.. <br>no I mean a preview option ;)<br>
And perhaps make a few templates for the layout...<p>
I'd appreciate an e-mail if you use this, I'm curious...<br>
Later,<br>
Mattice
";

på forhånd tak!
Avatar billede elskermad.dk Nybegynder
29. december 2003 - 03:14 #1
<?php
$mainpage_title = "We've just installed the \"Define Mainpage\" module!";


man kan ikk have en " i mellem "'er.. skal escapes med et \ ved ikk om der er andre fejl... prøv det først!
Avatar billede elskermad.dk Nybegynder
29. december 2003 - 03:15 #2
det samme her:
$mainpage_info = "
\"Define Mainpage\" module v1.3 by Matthijs (mattice@xs4all.nl)
<p>
Avatar billede elskermad.dk Nybegynder
29. december 2003 - 03:17 #3
hov så ikke at du havde givet 200 points, hvis mit svar var til hjælp var det selvfølgelig ikke så meget værd!
ta 170 af dem selv...
Avatar billede martinbk Nybegynder
29. december 2003 - 03:27 #4
det aller hurtigste ville være at udskifte start og slut " med ' eks:

$streng = "jeg elsker folk med "flyveører""; // dette vil give en parse error
$streng = 'jeg elsker folk med "flyveører'; // dette vil ikke give en parse error
Avatar billede elskermad.dk Nybegynder
29. december 2003 - 03:53 #5
efter jeg er begyndt på php skriver jeg alt mit html med ' istedet for " dette gør det meget nemmere hvis man kan vende sig til det! :)
Avatar billede winpower Nybegynder
29. december 2003 - 04:00 #6
Det hjælper ikke...
Den laver fejl i linie 6 nu:

Den ser sådan ud nu:

?><!-- MAIN PAGE EXAMPLE START //-->
<table width='100%' cellpadding='5' cellspacing='0' border=0>
    <tr>
    <td class='main' width=50% valign='top' align='right'>
<?php
$mainpage_title = 'We've just installed the 'Define Mainpage' module!';
$mainpage_info = '
'Define Mainpage' module v1.3 by Matthijs (mattice@xs4all.nl)
<p>
This module demonstrates how easy it can be to adapt existing code in OSC.<br>
All I had to do was add one single line to define_languages.php (admin) to make
sure it always looks for the mainpage.php file. Obviously I had to then implement it
in the Admin & Catalog side, but that's not a big deal as you've just found out.<p>
You can edit the contents of this file from within the Admin ( -> CATALOG -> DEFINE MAINPAGE)<br>
For other, less advanced layouts choose either German or Spanish from the language menu. (Provided you've installed
those languages)<p>If you can't open/edit the /[language]/mainpage.php file you should probably set the right permissions. You'll get a warning anyway.
<p>Todo? Future plans? World peace through superior fire power... ehmm.. <br>no I mean a preview option ;)<br>
And perhaps make a few templates for the layout...<p>
I'd appreciate an e-mail if you use this, I'm curious...<br>
Later,<br>
Mattice 
';
Avatar billede elskermad.dk Nybegynder
29. december 2003 - 04:04 #7
hehe det er fordi du har lavet det hele til ' nu... det skal være sådan at det bliver rammet ind af 2 "'er, og derinde kan du så bruger ''er
Avatar billede winpower Nybegynder
29. december 2003 - 04:10 #8
Kunne jeg få dig til at rette det?

Jeg kan slet ikke styre det lige nu.. måske er det for sent...

Hele siden er her:

?><!-- MAIN PAGE EXAMPLE START //-->
<table width="100%" cellpadding="5" cellspacing="0" border=0>
    <tr>
    <td class="main" width=50% valign="top" align="right">
<?php
$mainpage_title = '"We've just installed the "Define Mainpage" module!"';
$mainpage_info = "
"Define Mainpage" module v1.3 by Matthijs (mattice@xs4all.nl)
<p>
This module demonstrates how easy it can be to adapt existing code in OSC.<br>
All I had to do was add one single line to define_languages.php (admin) to make
sure it always looks for the mainpage.php file. Obviously I had to then implement it
in the Admin & Catalog side, but that's not a big deal as you've just found out.<p>
You can edit the contents of this file from within the Admin ( -> CATALOG -> DEFINE MAINPAGE)<br>
For other, less advanced layouts choose either German or Spanish from the language menu. (Provided you've installed
those languages)<p>If you can't open/edit the /[language]/mainpage.php file you should probably set the right permissions. You'll get a warning anyway.
<p>Todo? Future plans? World peace through superior fire power... ehmm.. <br>no I mean a preview option ;)<br>
And perhaps make a few templates for the layout...<p>
I'd appreciate an e-mail if you use this, I'm curious...<br>
Later,<br>
Mattice 
";
  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $mainpage_title );
  new infoBoxHeading($info_box_contents, true, true);

  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $mainpage_info);
  new infoBox($info_box_contents);
?>
  </td>
<td width=30% valign="top" align="center">
<?
$somebox_title = "Ratings...";
$somebox_info = tep_image(DIR_WS_IMAGES . 'stars_1.gif') . ' Sucks!<br>' . tep_image(DIR_WS_IMAGES . 'stars_2.gif') . ' Mwoah<br>' . tep_image(DIR_WS_IMAGES . 'stars_3.gif') . ' Okay<br>' . tep_image(DIR_WS_IMAGES . 'stars_4.gif') . ' Cool!';


  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_title );
  new infoBoxHeading($info_box_contents, true, true);

  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_info);
  new infoBox($info_box_contents);
?>
<p>
<?
$somebox_title = "Anouncement:";
$somebox_info = "<center>This website is powered by the best OpenSource e-commerce solution available on the market today:<p>" . tep_image(DIR_WS_IMAGES . 'oscommerce.gif') . '<p>Please contribute to this fantastic project!<br>Visit http://www.oscommerce.com for more details.</center>'; 


  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_title );
  new infoBoxHeading($info_box_contents, true, true);

  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_info);
  new infoBox($info_box_contents);
?>

</td>
</table>
<!-- MAIN PAGE EXAMPLE END //-->
Avatar billede winpower Nybegynder
29. december 2003 - 04:12 #9
Sorry.... det kunne da godt være jeg skulle gå i seng :P

Den er her:

?><!-- MAIN PAGE EXAMPLE START //-->
<table width="100%" cellpadding="5" cellspacing="0" border=0>
    <tr>
    <td class="main" width=50% valign="top" align="right">
<?php
$mainpage_title = "We've just installed the "Define Mainpage" module!";
$mainpage_info = "
"Define Mainpage" module v1.3 by Matthijs (mattice@xs4all.nl)
<p>
This module demonstrates how easy it can be to adapt existing code in OSC.<br>
All I had to do was add one single line to define_languages.php (admin) to make
sure it always looks for the mainpage.php file. Obviously I had to then implement it
in the Admin & Catalog side, but that's not a big deal as you've just found out.<p>
You can edit the contents of this file from within the Admin ( -> CATALOG -> DEFINE MAINPAGE)<br>
For other, less advanced layouts choose either German or Spanish from the language menu. (Provided you've installed
those languages)<p>If you can't open/edit the /[language]/mainpage.php file you should probably set the right permissions. You'll get a warning anyway.
<p>Todo? Future plans? World peace through superior fire power... ehmm.. <br>no I mean a preview option ;)<br>
And perhaps make a few templates for the layout...<p>
I'd appreciate an e-mail if you use this, I'm curious...<br>
Later,<br>
Mattice 
";
  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $mainpage_title );
  new infoBoxHeading($info_box_contents, true, true);

  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $mainpage_info);
  new infoBox($info_box_contents);
?>
  </td>
<td width=30% valign="top" align="center">
<?
$somebox_title = "Ratings...";
$somebox_info = tep_image(DIR_WS_IMAGES . 'stars_1.gif') . ' Sucks!<br>' . tep_image(DIR_WS_IMAGES . 'stars_2.gif') . ' Mwoah<br>' . tep_image(DIR_WS_IMAGES . 'stars_3.gif') . ' Okay<br>' . tep_image(DIR_WS_IMAGES . 'stars_4.gif') . ' Cool!';


  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_title );
  new infoBoxHeading($info_box_contents, true, true);

  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_info);
  new infoBox($info_box_contents);
?>
<p>
<?
$somebox_title = "Anouncement:";
$somebox_info = "<center>This website is powered by the best OpenSource e-commerce solution available on the market today:<p>" . tep_image(DIR_WS_IMAGES . 'oscommerce.gif') . '<p>Please contribute to this fantastic project!<br>Visit http://www.oscommerce.com for more details.</center>'; 


  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_title );
  new infoBoxHeading($info_box_contents, true, true);

  $info_box_contents = array();
  $info_box_contents[] = array('align' => 'left',
                              'text'  => $somebox_info);
  new infoBox($info_box_contents);
?>

</td>
</table>
<!-- MAIN PAGE EXAMPLE END //-->

Den anden var den jeg rettede i :P
Avatar billede Slettet bruger
29. december 2003 - 05:53 #10
$mainpage_title = "We've just installed the \"Define Mainpage\" module!";
$mainpage_info = "
\"Define Mainpage\" module v1.3 by Matthijs (mattice@xs4all.nl)
Avatar billede winpower Nybegynder
29. december 2003 - 15:17 #11
Det hjalp sku at sove :P

Det der hjalp var simpelthen at fjerne dem:
Linien ser nu sådan ud:

$mainpage_title = "We've just installed the Define Mainpage module!";
$mainpage_info = "Define Mainpage module v1.3 by Matthijs (mattice@xs4all.nl)

tusind tak :D
Avatar billede elskermad.dk Nybegynder
29. december 2003 - 16:05 #12
jep og hvis du vil ha nogle " rundt om Define Mainpage kan du skrive \"Define Mainpage\" så laver den ikke fejl :)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester