Small PHP Problem (.htm to .php)
08-31-2009, 11:23 AM
|
Small PHP Problem (.htm to .php)
|
Posts: 4
Name: Ganimete Jashanica
|
Hello All,
As you can see this is my first post at this great forum, but I have been visiting the forum everyday, now I have decided to be part of this community.
Ok, Now I have an small problem regarding an template file which is .html format
Template File:
PHP Code:
<?if(isset($data['ScriptLoaded'])){?><center><form method=post name=data><input type=hidden name=step value="<?=$post['step']?>"><?if($post['step']==1){?><table class=frame width=100% border=0 cellspacing=1 cellpadding=2><tr><td class=capl colspan=6>PRODUCTS</td></tr><tr><td class=capc>NAME</td><td class=capc>PRICE</td><td class=capc>TAX</td><td class=capc>SHIPPING</td><td class=capc>SOLD</td><td class=capc width=1%>ACTION</td></tr><?$idx=0;foreach($data['Products'] as $value){$bgcolor=$idx%2?'#EEEEEE':'#E7E7E7'?> <tr bgcolor="<?=$bgcolor?>" onmouseover="setPointer(this, <?=$idx?>, 'over', '<?=$bgcolor?>', '#CCFFCC', '#FFCC99')" onmouseout="setPointer(this, <?=$idx?>, 'out', '<?=$bgcolor?>', '#CCFFCC', '#FFCC99')" onmousedown="setPointer(this, <?=$idx?>, 'click', '<?=$bgcolor?>', '#CCFFCC', '#FFCC99')"?> onmouseover="setPointer(this, <?=$idx?>, 'over', '<?=$bgcolor?>', '#CCFFCC', '#FFCC99')" onmouseout="setPointer(this, <?=$idx?>, 'out', '<?=$bgcolor?>', '#CCFFCC', '#FFCC99')" onmousedown="setPointer(this, <?=$idx?>, 'click', '<?=$bgcolor?>', '#CCFFCC', '#FFCC99')"><td><?=prntext($value['name'])?></td><td align=right><?=prntext($data['Currency'])?><?=prnsumm($value['price'])?></td><td align=center nowrap><?=prntext($data['Currency'])?><?=prnsumm($value['tax'])?></td><td align=center nowrap><?=prntext($data['Currency'])?><?=prnsumm($value['shipping'])?></td><td align=center nowrap><?=($value['sold']?$value['sold']:'0')?> Times<br><font class=remark>(<?=prntext($data['Currency'])?><?=prnsumm($value['price']*$value['sold'])?>)</font></td><td align=center nowrap><a href="products.htm?id=<?=$value['id']?>&action=update">EDIT</a>|<a href="products.htm?id=<?=$value['id']?>&action=delete" onclick="return cfmform()">DELETE</a><br><a href="generate.htm?id=<?=$value['id']?>&action=products">GENERATE CODE</a><br><a href="generate.htm?id=<?=$value['id']?>&action=products&status=crypt">ENCRYPT CODE</a></td></tr><?$idx++;}?><tr><td class=capc colspan=6><input class=submit type=submit name=send value="ADD NEW PRODUCT NOW!"></td></tr></table><?}elseif($post['step']==2){?><?if($post['gid']){?><input type=hidden name=gid value="<?=$post['gid']?>"><?}?><table class=frame width=100% border=0 cellspacing=1 cellpadding=4><tr><td class=capl colspan=2>INFORMATION OF PRODUCT</td></tr><?if($data['Error']){?><tr><td colspan=2 class=error><?=prntext($data['Error'])?></td></tr><?}?><tr><td class=field nowrap>Product/Service Name (*):</td><td class=input width=1%><input type=text name=name size=41 maxlength=64 value="<?=prntext($post['name'])?>"></td></tr><tr><td class=field nowrap>Description:<br><small>(Optional)</small></td><td class=input><textarea name=comments cols=40 rows=10><?=prntext($post['comments'])?></textarea></td></tr><tr><td class=field nowrap>Price/Amount, <?=prntext($data['Currency'])?> (*):</td><td class=input><input type=text name=price size=10 maxlength=10 value="<?=prnsumm($post['price'])?>"><br><font class=remark>Do not put any $ Dollar Signs, enter only a number like 5.00.</font></td></tr><tr><td class=field nowrap>Tax, <?=prntext($data['Currency'])?>:</td><td class=input><input type=text name=tax size=10 maxlength=10 value="<?=prnsumm($post['tax'])?>"><br><font class=remark>Do not put any $ Dollar Signs, enter only a number like 5.00.</font></td></tr><tr><td class=field nowrap>Shipping, <?=prntext($data['Currency'])?>:</td><td class=input><input type=text name=shipping size=10 maxlength=10 value="<?=prnsumm($post['shipping'])?>"><br><font class=remark>Do not put any $ Dollar Signs, enter only a number like 5.00.</font></td></tr><tr><td class=field nowrap>Return URL (*):</td><td class=input><input type=text name=ureturn size=41 value="<?=$post['ureturn']?>"></td></tr><tr><td class=field nowrap>Notify URL (*):</td><td class=input><input type=text name=unotify size=41 value="<?=$post['unotify']?>"></td></tr><tr><td class=field nowrap>Cancel URL:</td><td class=input><input type=text name=ucancel size=41 value="<?=$post['ucancel']?>"></td></tr><tr><td class=field nowrap>Please select a button:</td><td class=input><?$idx=1;foreach($post['Buttons'] as $key=>$value){$bgcolor=$idx%2?'#EEEEEE':'#E7E7E7'?><label for="button_<?=$idx?>" style="cursor:hand"?> style="cursor:hand"><input class=checkbox type=radio id="button_<?=$idx?>" name="button" value="<?=$value?>" <?if($post['button']="=$value){"?> name=button value="<?=$value?>"<?if($post['button']==$value){?> checked<?}?>> <img src="<?=$data['SinBtns']?>/<?=$value?>" align=absmiddle onclick="javascript:document.all['button_<?=$idx?>'].checked=true"></label><br><br><?$idx++;}?></td></tr><tr><td class=capc colspan=2><input class=submit type=submit name=cancel value="BACK"> <input type=submit class=submit name=send value="CONTINUE"></td></tr></table><?}?></form></center><?}else{?>SECURITY ALERT: Access Denied<?}?>
Now my problem is that all URL-s in the above code which are in .htm I want to change to .php, but when I do that, than I receive an error when uploading online.
PHP Code:
Example Change: <a href="products.htm?id=<?=$value['id']?>& to products.php
I don't have any idea how to resolve this problem, and hope that you guys can help me.
Thank you very much,
Genius!
|
|
|
|
08-31-2009, 11:44 AM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 15
Name: Bert Van Leemput
|
What's the error?
__________________
There Are Only 10 Types of People in the World: Those Who Understand Binary, and Those Who Don't.
|
|
|
|
08-31-2009, 12:39 PM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 4
Name: Ganimete Jashanica
|
Hello,
When I change the url in file from products.htm to products.php and upload the file I get this error when accessing xx/products.php
Parse error: syntax error, unexpected ';' in xxx/template.products.htm on line 2
Hope this will help!
Thanks,
Genius!
|
|
|
|
08-31-2009, 01:47 PM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 15
Name: Bert Van Leemput
|
Try to change the name template.products.htm to template.products.php
__________________
There Are Only 10 Types of People in the World: Those Who Understand Binary, and Those Who Don't.
|
|
|
|
08-31-2009, 01:51 PM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 4
Name: Ganimete Jashanica
|
Quote:
Originally Posted by Bertjeuh
Try to change the name template.products.htm to template.products.php
|
And than?
Leave template as .php file ?
Ok I will try buy I am not sure if that will work.
|
|
|
|
08-31-2009, 08:23 PM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 2,552
Name: Keith Marshall
Location: West Hartford, CT
|
That error means there is a php syntax error on the requested page itself, not the requesting link.
__________________
<mgraphic /> - I don't have a solution but I admire the problem.
|
|
|
|
09-01-2009, 04:09 AM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 15
Name: Bert Van Leemput
|
Sorry, I thought his filename was template.products.htm but its products.php. I've been searching for the syntax error but your code is totally not ordered. So it's difficult to find the error.
Anyone? can you do <?= phpcode ?> instead of <?php phpcode ?>
__________________
There Are Only 10 Types of People in the World: Those Who Understand Binary, and Those Who Don't.
|
|
|
|
09-01-2009, 06:59 AM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 64
Name: Ed Barnett
|
Any chance of seeing the code in a more readable format?
Ps. Yes, that's a syntax error i.e. there is an unexpected ; on line 2 of your page. It's likely that you've written something incorrectly on the line before and PHP has only noticed the error once it has reached the end of line 2.
|
|
|
|
09-01-2009, 01:53 PM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 330
Name: Mattias Nordahl
Location: Sweden
|
Quote:
Originally Posted by Bertjeuh
Anyone? can you do <?= phpcode ?> instead of <?php phpcode ?>
|
Yes. <?=$var?> is the same thing as <?php echo $var; ?>. However, I have never liked or used it myself and I'm not sure weather or not it's an "old" way of writing that perhaps will not be available in future versions of php.
Quote:
Originally Posted by EdB
Any chance of seeing the code in a more readable format?
Ps. Yes, that's a syntax error i.e. there is an unexpected ; on line 2 of your page. It's likely that you've written something incorrectly on the line before and PHP has only noticed the error once it has reached the end of line 2.
|
Indeed, there's some error on line two. But since line two in incredibly long and in a very uneasy to read format, it is hard to find the error. It would help to see the code in a more structured form.
__________________
596f75206d65616e20796f752063616e2061637475616c6c79 207265616420746869733f
|
|
|
|
09-01-2009, 02:09 PM
|
Re: Small PHP Problem (.htm to .php)
|
Posts: 1,068
Name: Matt
Location: Irvine, CA
|
Quote:
Originally Posted by lizciz
Yes. <?=$var?> is the same thing as <?php echo $var; ?>. However, I have never liked or used it myself and I'm not sure weather or not it's an "old" way of writing that perhaps will not be available in future versions of php.
|
<?= and <? are collectively called short tags. They will not be available in PHP6 and even in PHP4/5 you shouldn't get in the habit of using them. The reason being, some people don't have them enabled. In other words, using short tags is the easiest way to make sure your code won't be portable. Even if you don't intend for your code to be distributed, it is not something you want to be in the habit of doing.
|
|
|
|
|
« Reply to Small PHP Problem (.htm to .php)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|