Note that there are some explanatory texts on larger screens.

plurals
  1. POa syntax error shows on hosting and the same code works just fine on the local
    primarykey
    data
    text
    <p>I am using <a href="http://www.000webhost.com/" rel="nofollow">http://www.000webhost.com/</a> as a web server. My code works perfectly on the localhost but online I am getting this error</p> <p>Parse error: syntax error, unexpected T_STRING in /home/a1582910/public_html/setcore/create.php on line 1</p> <p>and I cannot fix it because I do not understand the problem because as you know the code is in one line all of it is in line one :D so </p> <p>after searching i found that the names of the variables is case sensitive so i made it all in small letters and i still having the same error. </p> <p>Can any one help?</p> <p>I am using WAMPSERVER (32 BITS &amp; PHP 5.4) create.php contains the following</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;?php class invoice { function addninvoice ($i) { require_once 'PHPExcel_1.7.9_doc/Classes/PHPExcel.php'; /** PHPExcel */require_once 'PHPExcel_1.7.9_doc/Classes/PHPExcel/IOFactory.php'; $excel2 = PHPExcel_IOFactory::createReader('Excel2007'); $excel2 = $excel2-&gt;load('try.xlsx'); $excel2-&gt;setActiveSheetIndex(0); echo"".$excel2-&gt;getActiveSheet()-&gt;getHighestRow().""; $psheet = $excel2-&gt;getActiveSheet(); $excel22 = PHPExcel_IOFactory::createReader('Excel2007'); $excel22 = $excel22-&gt;load('try.xlsx'); $psheet-&gt;setTitle($i); $psheet-&gt;setCellValue('G7', $i); $excel22-&gt;addSheet($psheet); $obr = PHPExcel_IOFactory::createWriter($excel22, 'Excel2007'); $obr-&gt;save('try1.xlsx'); $excel222 = PHPExcel_IOFactory::createReader('Excel2007'); $excel222 = $excel222-&gt;load('try1.xlsx'); $o = PHPExcel_IOFactory::createWriter($excel222, 'Excel2007'); $o-&gt;save('try.xlsx'); } } $p=new invoice; $in = $_GET['in']; require_once 'PHPExcel_1.7.9_doc/Classes/PHPExcel/IOFactory.php'; $excel2 = PHPExcel_IOFactory::createReader('Excel2007'); $sna = $excel2-&gt;listWorksheetNames("try.xlsx"); $df=0; foreach($sna as $id =&gt; $name ){ if($name==$in){ $df++; } } if($df != 0){ echo"this invoice already exist you can not create two invoices with the same name if you want to edit it just click on it from the left menu in the home page" ; }else{ $p-&gt;addninvoice($in); ?&gt;&lt;meta http-equiv="Refresh" content="0; url=fa.php"&gt;&lt;?php } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>fa.php</p> <pre><code> &lt;html&gt; &lt;head&gt; &lt;script&gt; function validateForm() { var x=document.forms["numrownamche"]["in"].value; if (x==null || x=="") { alert("Invoice Name Must Be Filled Out"); return false; } } &lt;/script&gt; &lt;/head&gt; &lt;body bgcolor="silver"&gt; &lt;img src="image/Logo.gif" alt="Setcore" width="199"&gt; &lt;b&gt;create new invoice&lt;/b&gt; &lt;form name="numrownamche" action="create.php" onsubmit="return validateForm()" method="get"&gt; &lt;br/&gt;&lt;small&gt;invoice number:&lt;/small&gt; &lt;input type="text" name="in"&gt; &lt;input type="submit" value="Create"&gt; &lt;/form&gt; &lt;?php require_once 'PHPExcel_1.7.9_doc/Classes/PHPExcel/IOFactory.php'; $excel2 = PHPExcel_IOFactory::createReader('Excel2007'); $sna = $excel2-&gt;listWorksheetNames("try.xlsx"); foreach($sna as $id =&gt; $name ){ ?&gt; &lt;a href="fb.php?shtid=&lt;?php echo $id; ?&gt;" target="fb"&gt;&lt;?php echo "".$name."&lt;br/&gt;";?&gt; &lt;/a&gt; &lt;?php } ?&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload