12 Replies - 1658 Views - Last Post: 26 December 2010 - 08:20 AM Rate Topic: -----

#1 calm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-December 10

Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 03:42 AM

here is the original PHP code below, much appreciated in advance

How may I insert html into $lang = array_merge (PHP)



<?php
$lang_ext = array(
'onlinepay' => 'Online payment',
'oid' => 'Order Number:',
'pname' => Name:',
'onums' => 'Number:',
'oprices' => 'price:',
'mons' => 'money:',
'rcode' => 'Verification Code:',
'payit' => 'Pay Now',
'npayfor' => 'Price to be paid',
'paym' => 'Do you confirm payment now? ',
'payerror' => 'Please transfer money to your account first, thank you. ',
'fcharge' => 'Please deposit money here ',
);
$lang = array_merge($lang, $lang_ext);
?>


How may I insert HTML codes below into the PHP codes above? Thanks a lot

<form method="post" action="www.123648.com/apple" >
<input type="hidden" name="ap_productid" value="mango=="/>
<input type="hidden" name="ap_quantity" value="1"/>
<input type="image" name="ap_image" src="https://www.123648.com/B26C4898CBBE2DD8b0en.gif"/>
</form>

<a href='https://123648.com/applet?CTd5422ZwM='>Mango</a>

This post has been edited by Dormilich: 26 December 2010 - 05:11 AM
Reason for edit:: please use [code] [/code] tags when posting source code


Is This A Good Question/Topic? 0
  • +

Replies To: Merry X mas, How may I insert html into $lang = array_merge (PHP)

#2 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3402
  • View blog
  • Posts: 9,619
  • Joined: 08-June 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 05:12 AM

could you elaborate what you mean by inserting HTML into array_merge()?
Was This Post Helpful? 0
  • +
  • -

#3 Guest_calm*


Reputation:

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 05:24 AM

I need to insert HTML codes below into the PHP codes above Thanks a lot

<form method="post" action="www.123648.com/apple" >
<input type="hidden" name="ap_productid" value="mango=="/>
<input type="hidden" name="ap_quantity" value="1"/>
<input type="image" name="ap_image" src="https://www.123648.com/B26C4898CBBE2DD8b0en.gif"/>
</form>

<a href='https://123648.com/applet?CTd5422ZwM='>Mango</a>

Was This Post Helpful? 0

#4 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3402
  • View blog
  • Posts: 9,619
  • Joined: 08-June 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 05:41 AM

View Postcalm, on 26 December 2010 - 12:24 PM, said:

I need to insert HTML codes below into the PHP codes above

I see no necessity to do so. the one is pure PHP code without any output and the other is the complete opposite.
Was This Post Helpful? 0
  • +
  • -

#5 calm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-December 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 05:49 AM

View PostDormilich, on 26 December 2010 - 04:41 AM, said:

View Postcalm, on 26 December 2010 - 12:24 PM, said:

I need to insert HTML codes below into the PHP codes above

I see no necessity to do so. the one is pure PHP code without any output and the other is the complete opposite.

due to some reasons, i have to do that
I added echo in front of html codes but it showed error below,

Parse error: syntax error, unexpected T_ECHO, expecting ')' on line 13
Was This Post Helpful? 0
  • +
  • -

#6 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3402
  • View blog
  • Posts: 9,619
  • Joined: 08-June 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 06:07 AM

what is the code that showed this error? (I can pretty much guess, though )
Was This Post Helpful? 0
  • +
  • -

#7 calm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-December 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 06:17 AM

View PostDormilich, on 26 December 2010 - 05:07 AM, said:

what is the code that showed this error? (I can pretty much guess, though )


i use this online tool below to convert html into php

http://www.quasarcr.com/html2php/

thank you in advance, the first row of echo code below showed error


echo "<form method='post' action='www.123648.com/apple' >";
echo "<input type='hidden' name='ap_productid' value='mango=='/>";
echo "<input type='hidden' name='ap_quantity' value='1'/>";
echo "<input type='image' name='ap_image' src='https://www.123648.com/B26C4898CBBE2DD8b0en.gif'/>";
echo "</form>";
echo "<a href='https://123648.com/applet?CTd5422ZwM='>Mango</a>";
Was This Post Helpful? 0
  • +
  • -

#8 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3402
  • View blog
  • Posts: 9,619
  • Joined: 08-June 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 06:34 AM

there doesn't seem to be anything wrong. what are the previous 5 lines to that like?
Was This Post Helpful? 0
  • +
  • -

#9 calm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-December 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 06:41 AM

View PostDormilich, on 26 December 2010 - 05:34 AM, said:

there doesn't seem to be anything wrong. what are the previous 5 lines to that like?

<?php
$lang_ext = array(
'onlinepay' => 'Online payment',
'oid' => 'Order Number:',
'pname' => Name:',
'onums' => 'Number:',
'oprices' => 'price:',
'mons' => 'money:',
'rcode' => 'Verification Code:',
'payit' => 'Pay Now',
'npayfor' => 'Price to be paid',
'paym' => 'Do you confirm payment now? ',
'payerror' => 'Please transfer money to your account first, thank you. ',
'fcharge' => 'Please deposit money here ',
);
$lang = array_merge($lang, $lang_ext);
?>

This post has been edited by Dormilich: 26 December 2010 - 07:19 AM
Reason for edit:: please use [code] [/code] tags when posting source code

Was This Post Helpful? 0
  • +
  • -

#10 calm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-December 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 06:51 AM

View Postcalm, on 26 December 2010 - 05:41 AM, said:

View PostDormilich, on 26 December 2010 - 05:34 AM, said:

there doesn't seem to be anything wrong. what are the previous 5 lines to that like?

<?php
$lang_ext = array(
'onlinepay' => 'Online payment',
'oid' => 'Order Number:',
'pname' => Name:',
'onums' => 'Number:',
'oprices' => 'price:',
'mons' => 'money:',
'rcode' => 'Verification Code:',
'payit' => 'Pay Now',
'npayfor' => 'Price to be paid',
'paym' => 'Do you confirm payment now? ',
'payerror' => 'Please transfer money to your account first, thank you. ',
'fcharge' => 'Please deposit money here ',
);
$lang = array_merge($lang, $lang_ext);
?>


in my website, these codes above will become a form with a pic attached

This post has been edited by Dormilich: 26 December 2010 - 07:21 AM

Was This Post Helpful? 0
  • +
  • -

#11 calm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-December 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 07:03 AM

if i do it this way below, it will show similar error in the first row html code

<?php
// some php code
?>html goes here <?php
// more php code
?>
Was This Post Helpful? 0
  • +
  • -

#12 Dormilich  Icon User is online

  • 痛覚残留
  • member icon

Reputation: 3402
  • View blog
  • Posts: 9,619
  • Joined: 08-June 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 07:20 AM

see post #10, line #14, there is a comma after the last array element. this causes the error.
Was This Post Helpful? 1
  • +
  • -

#13 calm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 7
  • Joined: 26-December 10

Re: Merry X mas, How may I insert html into $lang = array_merge (PHP)

Posted 26 December 2010 - 08:20 AM

View PostDormilich, on 26 December 2010 - 04:12 AM, said:

could you elaborate what you mean by inserting HTML into array_merge()?

Thank you very much for your effort & patience, your suggestion is very useful.

unluckily, it still does not work, there may be a problem caused by other Payment-related files since the codes above are related to the payment process of my web site & there are about 6-8 Payment-related files in my server. Thanks a lot!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1