Jump to content

aebstract

Members
  • Posts

    1,105
  • Joined

  • Last visited

Posts posted by aebstract

  1. To obsidian, the reason why I am wanting to fix this up a little bit (and maybe just redirect them to the home page versus a warning page) is because it is possible that someone just types in to the url. That would force the error and look bad. I'll try out what rajiv said.

  2. Warning: Failed opening 'order.php' for inclusion (include_path='.:/php/includes:/usr/share/php') in /home/virtual/site130/fst/var/www/html/2/index.php on line 15

     

     

    This is what gets displayed at the top of the page whenever the page doesn't exist (meaning it cannot include the file). How can I have a default page that displays simply saying "Page does not exist" if this comes up?

  3. wow... so you just have no clue or simply don't wanna try to help? The author's notes say "The notes within the code should guide you through fine". That is all. Every note he gives is within the script. It is acting up, doing two different things on ie and firefox. I waited a full day and got no response, guess that is why these are php forums, eh?

  4. You mean so you know who he refers? You would still use the $_GET? If you want to know how match it up to which user that id is set as, you would have to check your database for a user with that id.

  5. www.url.com/index.php?refid=x

     

    then use something like

     

    echo "$_GET['refid']";
    

     

    That will echo "x", I don't really know what you want to do with the refid but that's how you get it so that you can use it.

  6. Now I have:

     

    Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site130/fst/var/www/html/2/index.php:30) in /home/virtual/site130/fst/var/www/html/2/login.php on line 3

     

    Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site130/fst/var/www/html/2/index.php:30) in /home/virtual/site130/fst/var/www/html/2/login.php on line 8

     

    Here is my index.php up to 30

     

    <?php
    session_start();
    header("Cache-control: private");
    
    if (isset($_GET['page'])) {
    $page = ($_GET['page']);
    } else {
    $page = "home";
    }
    ?>
    <!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>Berry Plumbing & Equipment</title>
    
    <link href="stylesheet.css" rel="stylesheet" type="text/css" title="default" />
    </head>
    <body>
    
    
    
    <div id="container">
    
    
    <div id="center">
    	<div id="header"></div>
    	<div id="topright"></div>
    	<div id="user"></div>
    

  7. Now I am getting:

     

    Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site130/fst/var/www/html/2/index.php:32) in /home/virtual/site130/fst/var/www/html/2/login.php on line 6

     

    Line 6 being the header () line in the code.

    It also kills the rest of my page after that error instead of displaying it. (cause of the exit)

  8. put the header cache-control at the top of index page and removed from login, and now get this error when I submit my login script:

     

    Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site130/fst/var/www/html/2/index.php:30) in /home/virtual/site130/fst/var/www/html/2/login.php on line 41

  9. Yes, I know about the topic at the top for headers. I also know how to use headers, though I have tried about everything I can think of and still can't get this to work.

     

    I've jumped back and forth between "cannot add header information" and "header information already sent". These scripts are working without that being a problem before I was actually including the files.

     

     

    login.php:

    <?php
    session_start();
    header("Cache-control: private");
    
    if(isset($_SESSION["id"]))
    {
    header("Location: index.php?menu=acchome");
    }
    
    
    if(!isset($_SESSION["id"]))
    {
    
    if (isset ($_POST['submit']))
    {
    
    $problem = FALSE;
    
    
          if (empty ($_POST['password'])) {
    $problem = TRUE;
    $error .= 'You must fill in a password <br />';
          }
    
    
    
    
    if (!$problem) {
    
    mysql_connect("localhost","berryequipment","gU8Kso8Y") or die(mysql_error());
    mysql_select_db("berryequipment_net");
    
    $result = mysql_query("SELECT id, plantloc, password, city, state, zip, street FROM plants WHERE id=('$_POST[dropdown]') AND password=('".md5($_POST['password'])."')") or die ("error");
                if (mysql_num_rows($result) == 0)
                  {
    echo 'The pasword you entered did not match the plant location you chose.';
    } else {
    
                          $worked = mysql_fetch_array($result);
        			    $_SESSION["id"] = $worked[id];
    
                          header("Location: index.php?page=acchome");
    }
    
    
    
    
    }
    
    }
    
    }
    
    
    
    
    
    echo "$error";
    
    
    $content .= '
    
    <form action="index.php?page=login" method="post">
       plant loc<br />
    
    <select name="dropdown">';
    
    mysql_connect("localhost","berryequipment","gU8Kso8Y") or die(mysql_error());
    mysql_select_db("berryequipment_net");
    
    $result = mysql_query("SELECT * FROM plants ORDER BY plantloc ASC") or DIE(mysql_error());
    while ($r=mysql_fetch_array($result)) {
    
    $id=$r["id"];
    $plantloc=$r["plantloc"];
    
    $content .= "<option value=\"$id\">$plantloc</option>\n";
    
    }
    
    
    $content .= '</select>
    
    
                 <br /><br />
       password <br />
       <input type="password" maxlength="6" class="textfield" name="password" value="' . $_POST[password] . '" size="6" /><br /><br />
       <input type="submit" name="submit" class="textfield" value="login" />
    
    
    </form>';
    
    
    echo "$content";
    ?>
    

     

    This page is simply being included in to the body of the index file. The only php on that page is:

    <?php
    
    if (isset($_GET['page'])) {
    $page = ($_GET['page']);
    } else {
    $page = "home";
    }
    
    include "$page.php";
    ?>
    

     

    I've tried the header cache control thing at the top of my index.php page but that didn't work, still did the header sent already error.

    I'm sure it's real simple and real stupid, please help if you see what is going on. Thanks

  10. Hi,

    Got a script from dynamic drive which is suppose to scroll images horizontally, if you mouseover it stops and then continues when you take your mouse back off. All of that works, the only problem I am having is: I have the width set to 804px which is the width of my div that this script is located inside. My images are only scrolling about half of the width of this area. Also, the only other problem is it seems the images scroll out the left side fine, meaning it actually looks like they slide "out" and under the left side, but when they come in on the right side, they just appear completely and then start sliding. Any help on this would be much appreciated (or if someone knows where a better script is)

     

    <script type="text/javascript">
    
    
    
    
    //Specify the slider's width (in pixels)
    var sliderwidth="804px"
    //Specify the slider's height
    var sliderheight="175px"
    //Specify the slider's slide speed (larger is faster 1-10)
    var slidespeed=1
    //configure background color:
    slidebgcolor="#EAEAEA"
    
    //Specify the slider's images
    var leftrightslide=new Array()
    var finalslide=''
    leftrightslide[0]='<a href="http://"><img src="images/ph.jpg" border="0"></a>'
    leftrightslide[1]='<a href="http://"><img src="images/dpump.jpg" border="0"></a>'
    
    
    //Specify gap between each image (use HTML):
    var imagegap=" "
    
    //Specify pixels gap between each slideshow rotation (use integer):
    var slideshowgap=0
    
    
    ////NO NEED TO EDIT BELOW THIS LINE////////////
    
    var copyspeed=slidespeed
    leftrightslide='<nobr>'+leftrightslide.join(imagegap)+'</nobr>'
    var iedom=document.all||document.getElementById
    if (iedom)
    document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+leftrightslide+'</span>')
    var actualwidth=''
    var cross_slide, ns_slide
    
    function fillup(){
    if (iedom){
    cross_slide=document.getElementById? document.getElementById("test2") : document.all.test2
    cross_slide2=document.getElementById? document.getElementById("test3") : document.all.test3
    cross_slide.innerHTML=cross_slide2.innerHTML=leftrightslide
    actualwidth=document.all? cross_slide.offsetWidth : document.getElementById("temp").offsetWidth
    cross_slide2.style.left=actualwidth+slideshowgap+"px"
    }
    else if (document.layers){
    ns_slide=document.ns_slidemenu.document.ns_slidemenu2
    ns_slide2=document.ns_slidemenu.document.ns_slidemenu3
    ns_slide.document.write(leftrightslide)
    ns_slide.document.close()
    actualwidth=ns_slide.document.width
    ns_slide2.left=actualwidth+slideshowgap
    ns_slide2.document.write(leftrightslide)
    ns_slide2.document.close()
    }
    lefttime=setInterval("slideleft()",30)
    }
    window.onload=fillup
    
    function slideleft(){
    if (iedom){
    if (parseInt(cross_slide.style.left)>(actualwidth*(-1)+)
    cross_slide.style.left=parseInt(cross_slide.style.left)-copyspeed+"px"
    else
    cross_slide.style.left=parseInt(cross_slide2.style.left)+actualwidth+slideshowgap+"px"
    
    if (parseInt(cross_slide2.style.left)>(actualwidth*(-1)+)
    cross_slide2.style.left=parseInt(cross_slide2.style.left)-copyspeed+"px"
    else
    cross_slide2.style.left=parseInt(cross_slide.style.left)+actualwidth+slideshowgap+"px"
    
    }
    else if (document.layers){
    if (ns_slide.left>(actualwidth*(-1)+)
    ns_slide.left-=copyspeed
    else
    ns_slide.left=ns_slide2.left+actualwidth+slideshowgap
    
    if (ns_slide2.left>(actualwidth*(-1)+)
    ns_slide2.left-=copyspeed
    else
    ns_slide2.left=ns_slide.left+actualwidth+slideshowgap
    }
    }
    
    
    if (iedom||document.layers){
    with (document){
    document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
    if (iedom){
    write('<div style="position:relative;width:'+sliderwidth+';height:'+sliderheight+';overflow:hidden">')
    write('<div style="position:absolute;width:'+sliderwidth+';height:'+sliderheight+';" onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed">')
    write('<div id="test2" style="position:absolute;left:0px;top:0px"></div>')
    write('<div id="test3" style="position:absolute;left:-1000px;top:0px"></div>')
    write('</div></div>')
    }
    else if (document.layers){
    write('<ilayer width='+sliderwidth+' height='+sliderheight+' name="ns_slidemenu">')
    write('<layer name="ns_slidemenu2" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
    write('<layer name="ns_slidemenu3" left=0 top=0 onMouseover="copyspeed=0" onMouseout="copyspeed=slidespeed"></layer>')
    write('</ilayer>')
    }
    document.write('</td></table>')
    }
    }
    </script>
    

  11. body {
    margin: 0px;
    padding: 0px;
    text-align:center;
    background-image: url (http://berryequipment.net/2/bg.jpg);
            font-size: 10px;
    font-family: Arial, Helvetica, sans-serif;
    }
    

     

    I should be able to put bg.jpg and it work, I've tryed that, /bg.jpg and now the full link.. Nothing is displaying the background. Any ideas?

  12. Looks like this to me:

     

    $cartplog_product_infos = $db->query_read("SELECT productid, catid, thumb, title, price
    	FROM " . TABLE_PREFIX . "cartplog_products
    	WHERE sales = " . intval($cartplog_max_salescnt) . "
    ");
    

     

    Located just before the code you posted in the first post.

  13. Duclet, in response to your code:

    Parse error: parse error, unexpected '{' in /home/virtual/site130/fst/var/www/html/Rate.php5 on line 48

     

    Also, I had mentioned before that it was the fedex rate script to get a price on shipping for items that we are selling. This is why I'm stuck as well, I'm not too good with arrays and it's hard to go through this code.

     

     

    *edit* Just talked to my host and I have php 4.2 enabled. Is there a way around the file being php5? Can I remove the 5 from the extension? Am I going to HAVE to find a way to get an upgrade for this to work?

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