Jump to content

gnawz

Members
  • Posts

    237
  • Joined

  • Last visited

Posts posted by gnawz

  1. Dear guys,

     

    I have a code that I always use on hosts and it works but is not working now

     

    The code is:

     

    The file is functions.php

     

     

    // setting up the web root and server root for
    // this application
    $thisFile = str_replace('\\', '/', __FILE__);
    $docRoot = $_SERVER['DOCUMENT_ROOT'];
    
    $webRoot  = str_replace(array($docRoot, 'functions.php'), '', $thisFile);
    $srvRoot  = str_replace('functions.php', '', $thisFile); 
    
    define('WEB_ROOT', $webRoot);
    define('SRV_ROOT', $srvRoot);
    

     

    All the web files are in the root folder lifeforea

     

    and the admin files are in the lifeforea folder ir lifeforeastafrica/admin

     

    However, when I try to access www.lifeforeastafrica/admin to login into the admoin area, I get the folloeing error:

     

    Not Found

     

    The requested URL /mnt/local/admin/login.php was not found on this server.

     

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

     

    Someone help on how I should set my doc and server roots please.....

     

     

  2. Hi.

    I recently desined my joomla template and installed it. I need help on afew things.       

     

    1. How do I put a second component module on my site and have it display different content from the first one depending on what is entered in the back end? Once I do this, how do I make each display different content?

             

    2. I need to add a latest projects/news area on the right or left side of the website where I enter a short phrase on a topic with a read more button.

    How can this be achieved?

     

    3. How do I make my own menus be recognised in joomla? I have my menus with dropdown capability designe using css and I need to be able to assign different templates to different pages,yet clearly,I haven't used joomla menus.

  3. Hi guys? I need help and guidance on how to deal with CMS and templates: Joomla in particular

    Either to

    Use any template in joomla,that is not necessarily a joomla-based template.

     

    Or

     

    Come up with my own engine that I can use on any template.

     

    I believe  the above 2 are more or less the same.

     

    Any guidance, tools or sources?

  4. Im using mysql_fetch_array() and my query is;

     

    $sql = "SELECT SUM(Quantity *Value) FROM stocktable AS TOTAL";

    $result = dbQuery($sql);

     

    while($row = mysql_fetch_array($result))

    {

    $totalvalue = $row["SUM(Quantity*Value)"];

    }

     

    Also,I have noticed one may omit the phrase "as total" from the sql.

     

    Besides that,what could be the issue?

  5. Hi guys.

     

    I need to achieve a certain result through PHP and MySQL maths functions.

     

    I have a tableasfollows

     

    ItemID, ProductName, Quantity, Value

     

    I can get the total quantity.

     

    I need to get the total value. This requires me to get the total sum of the product of quantity and Value

     

    something like SUM(Quantity*Value)

     

    if I have 3 records as follows:

     

    ItemID ProductName Quantity Value

    1                Fruits        3        100

    2                Books        5        200

    3                Machines    2        500

     

    The total value of fruits is 300, books 1000 and machines 1000. Total value of all is 2300.

     

    How do I achieve this (2300) in SQL and PHP?

     

    ie 3 * 100

      5 * 200

      2 * 500

     

     

    I hope I'm clear

     

  6. I have a feedback form code which does email but does not display the correct content.

     

    In place of the email address, it displays "+1"

     

    And the body message is "1"

     

    It works well when I test it on localhost.

     

    As in

     

    FROM: +1

     

    MESSAGE:+1

     

    What is missing in my code, some body help

     

    My code

     

    <?php
    require_once 'functions.php';
    require_once'template.php';
    
    Head('Make an Order/enquiry');
    ?>
    
    <div id="pgcontent">
    <h3><em>Place your Order/Enquiry</em></h3>
    <?php
    
    // Change to your own email address
    
    $your_email = "sunny@lavis-casual.com";
    
    // This is what is displayed in the email subject line
    
    $subject = "LAVIS-CASUAL email order/enquiry";
    
    // This is displayed if all the fields are not filled in
    
    $empty_fields_message = "<p>Please go back and complete all the fields in the form.</p>";
    
    // This is displayed when the email has been sent
    $thankyou_message = "<p>Thankyou. Your message has been sent. We will be contacting you shortly.</p>";
    
    $name = "";
    
    $email = "";
    
    $message = "";
    
    //Email variables
    $name = stripslashes(isset($_POST['txtName']));
    
    $email = stripslashes(isset($_POST['txtEmail']));
    
    $message = stripslashes(isset($_POST['txtMessage']));
    
    
    if (!isset($_POST['txtName'])) {
    ?>
    <form name="frmOrder" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
        <p>
          <label>Full Name:</label>
          <br>
        <input type="text" title="Enter your name" name="txtName" size="50"></p>
        <p>
          <label>Email address:</label>
          <br>
          <input name="txtEmail" type="text" title="Enter your email address" value="" size="50">
        </p>
        <p><label>Your message:</label><br>
        <textarea name="txtMessage" cols="50" rows="5" title="Enter your message"></textarea>
        </p>
        <p><label title="Send your message">
        <input type="submit" value="Send" onClick="return checkOrder();"></label>
        <input name="Reset" type="reset" value="Clear form">
        </p>
    </form>
    
    <?php
    
    }
    
    else {
    
        // Stop the form being used from an external URL
    
        // Get the referring URL
    
        $referer = $_SERVER['HTTP_REFERER'];
    
        // Get the URL of this page
    
        $this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
    
        // If the referring URL and the URL of this page don't match then
    
        // display a message and don't send the email.
    
        if ($referer != $this_url) {
    
            echo "You do not have permission to access this form from another URL.";
    
            exit;
    
        }
    
        // The URLs matched so send the email
    
        mail($your_email, $subject, $message, "From: $name <$email>");
    
        // Display the thankyou message
    
        echo $thankyou_message;
    
    }
    ?>
    <script>
    function checkOrder()
    {
    with (window.document.frmOrder) 
    {
    	if (txtName.value.length < 3)
    		{
    		alert('Enter Your full name!');
    		txtName.focus();
    		return false;
    		} 
    
    	else if (txtEmail.value.length < 1 || txtEmail.value.indexOf("@", 0) == -1)
    	{	        
    	alert ("Please enter a valid email address!");
    	txtEmail.focus();
    	return false; 
    	}   
    
    	else if (txtMessage.value == "") 
    	{
    		alert('Enter your order/enquiry details!');
    		txtMessage.focus();
    		return false;
    	} 
    
    	else 
    	{
    		return true;
    	}
    }
    }
    </script>
    </div>
    
    <?php
    Footer();
    ?>
    
    

     

  7. Hi guys?

     

    Help me on how I can change the format of my date displayed form a MySQL database

    If for instance I have a variable for my date like

    echo $dateregistered;

     

    ie

     

    Default is:

     

    YY-MM-DD eg 2009-05-23

     

    How do I make it display like this DD-MM-YY or DD-MM.YYY

     

    eg 23-05-2009

     

    0r

     

    23-05-09

     

    Kindly help

  8. Hi.

     

    I have used the following CSS code to remove the horizontal scroll but it does not work in IE

     

    body {

    background: #580000 url(images/header_bg.jpg) repeat-x;

    font: 14px, Geneva, Arial, Helvetica, sans-serif;

    overflow-x: hidden;

    }

     

    The horizontal scroll is still there!

    Anyone knows another way to deal with it?

  9. try putting variables lie you did on the select

     

    $loginres = mysql_query($query);
    $numrows = mysql_num_rows($loginres);
    

     

    else, tell us what error(s) you get.

    If it is a blank page,

     

    check if your form(s) and code have the same variables, ie $_GET or $_POST and/or your database table names

×
×
  • 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.