Jump to content

Help! totally lost....


newb2php

Recommended Posts

Hello all

I am really new at all of this and really need some help. I have two php files that I need to merge. I've used winmerge to compare files, but i am seriously lost. There are a couple of snippets of code that I am really unsure of. Would I be able to post the files here? Would anyone be able to help me or steer me in the right direction? :shrug:

 

many thanks

Link to comment
Share on other sites

What kind of files? php,txt?? And how do you want them merged?

if they are two text files and you want one tagged onto the other then use file_put_contents with the APPEND flag.

file_put_contents($file1, $file_2_add_on, FILE_APPEND | LOCK_EX);

 

 

HTH

Teamatomic

Link to comment
Share on other sites

Scripting languages are often apt. to easily integrate into eachother, if they are indeed just PHP code then try to copy->paste and see if it runs. You can go ahead from there and rename variables if needed etc.

 

Remember, you can also include the file; such as

include('filename.php');

and it will 'inherit' all its content.

Link to comment
Share on other sites

wow - thank you all so much for your replies; so - I've included the snippets of code from my 'winmerge' program  (snippet from orig file followed by corresponding snippet from new file in the following cases), and would be grateful if you could please point me in the right direction as to merging? (I so apologize in advance - I know that this is very basic - but I'm willing to learn)

1.

<<div class="text_v_c"><?php echo TEXT_VISITORS_CART; ?></div>

<div class="forward"><?php echo TEXT_VISITORS_CART; ?></div>

2.

        <th scope="col" id="scRemoveHeading"><?php echo TABLE_HEADING_REMOVE; ?></th>

        <th scope="col" id="scRemoveHeading"> </th>  

3.

<div class="buttonRow">  

       </td>
       <td class="cartQuantityUpdate">    

4.

?></div>  

  if ($product['checkBoxDelete'] ) {
    echo zen_draw_checkbox_field('cart_delete[]', $product['id']);
  }
?>  

5.

<div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <strong><?php echo $cartShowTotal; ?></strong></div>

<div id="cartSubTotal"><?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $cartShowTotal; ?></div>

 

 

Many thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.