Single Menu Page with Bv and PHP

Collapse
This topic is closed.
X
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • barbroberts
    replied
    Re: Single Menu Page with Bv and PHP

    I'll give up on this if it can't be resolved soon. I simply cannot believe my php file for the image in the header won't work especially since the menu and footer both work. And it does bring up the image. so what is causing the verbiage behind it? What does the message mean? Where is this line 72 ?


    <b>Fatal error</b>: Call to undefined function sidemenu() in <b>/home/pfvgmdxy/public_html/EBP_new_template.php</b> on line <b>72</b><br />

    I have worked on this for hours again today, tweeking everything I know to tweek. I even deleted the new_template and sidemenu.php files and started over. same result.

    I have other sites to build much more complex than this little one. If I can't get this fixed, I won't be very optimistic about all the rest I need to learn.

    Leave a comment:


  • navaldesign
    replied
    Re: Single Menu Page with Bv and PHP

    What you are doing here is define functions and then call them in your page. It is obvious that a function can only be defined once. Redefining the same function will cause a conflict.

    Leave a comment:


  • whshyan
    replied
    Re: Single Menu Page with Bv and PHP

    hi, i'm back :)

    i realise something about this kind of codes,

    <?php
    include ("sidemenu.php");

    sidemenu();
    ?>

    for my website, i use it for my leftside menu, rightside menu and my footer.

    for my leftside menu, i use

    <?php
    include ("leftsidemenu.php"); <---any name
    menu();

    ?>

    for my rightside menu, i use

    <?php
    include ("rightsidemenu.php");
    rightsidemenu();

    ?>


    i found out that leftsidemenu.php can also be any name but menu(); cannot be change. eg, if i change to leftsidemenu(); there is error and it need to be menu(); and other menu

    Leave a comment:


  • navaldesign
    replied
    Re: Single Menu Page with Bv and PHP

    The code that you have added in your "sidemenu" page should be:
    <? function sidemenu() { ?>

    If you have named it anything else, the function "sidemenu" is not defined, so the script gives you that error.

    Leave a comment:


  • barbroberts
    replied
    php image in header

    Naval, I had chosen another name to save and upload the file not realizing it had to be sidemenu. After your last post, I deleted the old file, changed the name to "sidemenu.php" and published. It worked! but I still have some verbiage behind the image. It says:

    "Fatal error: Called to undefined function sidemenu() in home/pfvgmdxy/public_html/EBP_new_template.php on line 72"

    The verbiage is behind the image but shows to the right. I can quickly read what is under the image by clicking on refresh.


    I tried moving the image location in the template and publishing again to see exactly where the verbiage was coming from and it stayed behind the image. Any idea as to what is causing this?

    Leave a comment:


  • navaldesign
    replied
    Re: Single Menu Page with Bv and PHP

    It seems that no "sidemenu.php" file exists on the server as i get a 404 error.

    Make sure that ou have published the page as "sidemenu" with it's properties set to be php

    Leave a comment:


  • barbroberts
    replied
    Naval,
    I am still having a problem getting this to work in the header of my template. I am using BV. I have created the menu and footer in php in a new template. They both work fine. I have done the same thing for the image in the header and this is the result:

    I am going to assume that this code means something to you. I simply don't understand it.

    There is a gray rectangle in the header. This is a background shape
    (serving as a border) that sits just under the image that is supposed to be there! I tried removing the rectangle to see if that was the problem but it was not, so I put it back.

    I went to my FTP manager and deleted all previous attempts at creating this element. I can send screen prints of the codes and where I placed them if that would help. I have gone over and over this but cannot find the problem. Sorry to be such a pest.

    Leave a comment:


  • navaldesign
    replied
    Re: Single Menu Page with Bv and PHP

    Please understand that these are two different things that you need to do.

    1. Create the element that will be included. This may be a menu, a footer, a side menu, a Logo, anything.
    This page MUST start with

    <?
    function sidemenu() {
    ?>

    The second part is the actual code that creates the visual effect. In your case :

    <img src="http://www.elizabethbaileyportraits.com/bv01037.gif">




    in the case of a side menu (the name you asign to the function is NOT important, you could have evan called it "myheader" or "logo" or "mybanner" or whatever.

    As you see, you have missed the last part,

    <?
    }
    ?>

    So the complete code would be:

    <?
    function sidemenu() {
    ?>
    <img src="http://www.elizabethbaileyportraits.com/bv01037.gif">
    <?
    }
    ?>




    2. Then, in your template page, you need to have simply

    <?php
    include ("sidemenu.php");
    sidemenu();
    ?>

    in the html box.

    However, if you building the pages in BV you do NOT need to worry about correct coding. If you actually use BV, there are only two things to do:

    1. Create in BV a page with the element you want. In this case, the page must only have the image. The rest of the code you is automatically generated by BV. Place in the start of page

    <? function sidemenu() { ?>

    and, in the End of page:

    <?
    }
    ?>

    The second part, that described in step 2., is the same as described.

    Leave a comment:


  • barbroberts
    replied
    Re: Single Menu Page with Bv and PHP

    CORRECTION: This is what I put on my template in an html box where I want the image to be:
    <?php
    include ("sidemenu.php");
    sidemenu();
    ?>

    I saved the new template as a php and published. The php file (which I created in the upper left corner like the menu and footer) contains this code:

    <?php
    include ("sidemenu.php");
    sidemenu();
    ?><img src="http://www.elizabethbaileyportraits.com/bv01037.gif">

    I saved the header image file as "image.php and published and got nothing! Where is the error of my ways?
    http://www.elizabethbaileyportraits....w_template.php

    I'm going to get away from this for a while. It exhausts me.

    Leave a comment:


  • barbroberts
    replied
    Re: Single Menu Page with Bv and PHP

    html? I got it to work saving as php instead of html. It's working so I don't want to touch it. But I am trying to do the same with the image in the header. I would like to occasionally be able to change this image.
    This is what I have now:

    I have used this code in my feeble attempt to create a php file that would enable me to change the image.
    <? function sidemenu() { ?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>head_image</title>
    <meta name="GENERATOR" content="Created by BlueVoda">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <div id="bv_" style="position:absolute;left:0px;top:0px;width:23 3px;height:125px;z-index:0" align="left">
    <img src="http://www.elizabethbaileyportraits.com/bv01037.gif"></div>
    </body>
    </html>
    I don't know how the other stuff got in there. All I put in was <img src="....">

    Is it possible to change this image through a php file? and if so, what is the code? thank you in advance.

    Leave a comment:


  • navaldesign
    replied
    Re: Single Menu Page with Bv and PHP

    Here is a simplified version:

    This is the code for the footer: save it as html and upload it in your site:

    <center><font face="verdana" color="666666" size="1">Elizabeth Bailey Portraits<br>
    Represented by Garden Party Teas, Ltd. Co.<br>
    Bardstown, KY 40004<br>
    502-541-1844<BR>
    <BR>
    <h3>Convenient to the Washington DC area 20194</h3></center>
    <br>
    <center>The original oil paintings on this website were all created and copyrighted by<br>
    Elizabeth R. Bailey.<br>
    Other than the owners of the portraits presented here,<br>
    use of these images or their reproduction by any other <br>
    individual or organization is strictly prohibited.<br>


    In your page, where you want the footer to appear, place instead this code:



    <?php
    include ("footer.html");
    ?>

    This is usually done placing a html box in your page (if you use BV) and placing it in the position you want the footer to appear.

    Leave a comment:


  • barbroberts
    replied
    Re: Single Menu Page with Bv and PHP

    It's working now, I don't know why, but it is! I didn't think I had made any changes to what i'd done but it is working!

    Leave a comment:


  • barbroberts
    replied
    Problems creating a footer using PHP

    I am having trouble getting a php footer to work on my web site. The site is published but I am redoing the template (and then all the pages). On the current publication, I was able to understand and put to use the info provided here to establish a php menu.


    I even printed the instructions given here, highlighted, and studied them to no avail. I need the code (apparently spelled out in plain English) that is required to do a footer. This is a link to my "problem".



    This is the HTML I generated in order to achieve this mess:

    <? function footer() { ?>
    <center><font face="verdana" color="666666" size="1">Elizabeth Bailey Portraits<br>
    Represented by Garden Party Teas, Ltd. Co.<br>
    Bardstown, KY 40004<br>
    502-541-1844<BR><BR>
    <h3>Convenient to the Washington DC area 20194</h3></center><br>
    <center>The original oil paintings on this website were all created and copyrighted by<br> Elizabeth R. Bailey.<br>Other than the owners of the portraits presented here,<br>use of these images or their reproduction by any other <br>individual or organization is strictly prohibited.<br><p>
    <font size="2" face="Verdana"> <b><?php
    include ("footer.php");
    footer();
    ?>
    Any ideas as to what I have done wrong?

    Leave a comment:


  • Bethers
    replied
    Re: Single Menu Page with Bv and PHP

    You were working while we were all sleeping- and answering your own questions :) I think, from what you told me last night, that you're switching to Soho, tho - good luck - where ever/however you build!

    Leave a comment:


  • bornathletic
    replied
    Re: Single Menu Page with Bv and PHP

    I think I figured it out. This is pretty cool!

    Leave a comment:

Working...
X