Jump to content

scottybwoy

Members
  • Posts

    532
  • Joined

  • Last visited

    Never

Posts posted by scottybwoy

  1. Thanks joanna,

     

    That did tidy it up some, however, the reason I was using float is because what I am trying to achieve is a hidden :hover area on the element that I want to be in front of my heading.  So when a user hovers over this space the colour of the text changes to make it more visible.

     

    Please follow this link to see how this works.

     

    As it is you have to point the mouse quite close to the element for it to change.  With normal vertical order you do not have so much control over the shape of the element.  Is there a way around this?

  2. lol, constructive answers please, it was just for the visual aesthetics.  Had you have taken the time to look at my site and problem you would have noticed that its not the case in my parsing.

     

    Wouldn't my script just die and fall over if I done it the way you thought?

  3. Hi Peeps,

     

    I have a p element that sits relative in the top left hand corner within my main content.  The problem is that it is usually followed by a h1 header that sits in normal flow.  The h1 element has text-align centre assigned to it, that appears to be skewed by the presence of the relative p element.

     

    This occurs in both ff & ie so is probably down to something I have not learned yet and would like some help/advice thanks.

     

    [link=http://www.mri.co.uk/support/downloads.php]Here's the link[/link]

     

    Here's the css:

    <?php
    
    #content {
    margin: 0px 0px 0px 180px;
    padding: 15px 210px 10px 30px;
    background: #fff;
    text-align: justify;
    }
    
    #content p {
    margin: 0px 0px 0px 0px;
    padding: 20px 10px 10px 10px;
    }
    
    #content h1 {
    margin: 20px 0px;
    padding: 10px;
    border-top: solid 2px #000080;
    border-bottom: solid 2px #000080;
    color: #000080;
    font-size: 1.4em;
    text-align: center;
    }
    
    p.path {
    position: relative;
    float: left;
    top: -30px;
    left: -35px;
    padding: 0px 15px 0px 5px;
    font-size: 0.8em;
    color: #adadad;
    z-index: 40;
    }
    ?>
    

     

    Thanks in advance

  4. By the way the line

    if ($value != "") {
    //Should be...
    if ($value !== "") {
    

     

    Otherwise that statement will always be true, even if there is an empty value, so as it is an comparison it should have two == signs.  If you wanted $value to never equal an empty string you would use the first one, which is an assignment operator.

  5. All the above snippet does is get all the events, then for each event gets ur ids, and the other fields u want to pass.  You really just need one form.

     

    What I would suggest is to use a radio button to select which event to edit.

     

    Try this

    <table align="left" cellpadding="5" cellspacing="5">
    <form action="<? echo $PHP_SELF; ?>" method="post">
    <?php
    
    // form not yet submitted
    // display initial form
    if (!isset($_POST['action']))
    {
    require_once('../Connections/site.php'); 
    mysql_select_db($site, $site);
    $qry = mysql_query("SELECT * FROM events") or trigger_error("SQL", E_USER_WARNING);
    while($row == mysql_fetch_assoc($qry)) {
    	$id = $row["eventID"];
        $eventTitle = $row["eventTitle"];
        $eventInfo = $row["eventInfo"];
        $eventImage = $row["eventImage"];
    
    ?>
    
        <label for="eventID">Edit ?</label><input type="radio" name="eventID" id="eventID" value="<? echo $id; ?>" />
        <tr>
          <td valign="top" align="left"><b>Title</b></td>
          <td><input size="50" maxlength="250" type="text" name="eventTitle" value="<? echo $eventTitle; ?>" />
          </td>
        </tr>
        <tr>
          <td valign="top" align="left"><b>Info</b></td>
          <td><textarea name="eventInfo" cols="40" rows="10"><? echo $eventInfo; ?></textarea>
          </td>
        </tr>
        <tr>
          <td valign="top" align="left"><strong>Image</strong></td>
          <td><?php
    $directory = "images/";
    $handler = opendir($directory);
    
    print "<select name='eventImage'>";
    while ($eventImage = readdir($handler)) {
    
    // if $file isn't this directory or its parent,
    // display in the select menu
    if ($eventImage != '.' && $eventImage != '..') {
       if($eventImage == $eventImage){
       print "<option value='$eventImage' selected>$eventImage</option>";
       $current_image = "<img src=\"$directory.$eventImage\">";
       } else {
       print "<option value='$eventImage'>$eventImage</option>";
       $current_image = "No Image selected";
       }
    }
    } ?>
            </select>
    <?php } ?>
            <p align="center">
              <input type="submit" value="Submit" name="action" />
            </p></td>
        </tr>
      </form>
    </table>
    <?php
    }
    else
    {
    $imagename = $_POST['imagename'];
    $query = "UPDATE events SET eventTitle = '$eventTitle', eventInfo = '$eventInfo', eventImage = '$eventImage' WHERE id = '$id'";
    $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
    // set up error list array
    $errorList = array();
    $count = 0;
    // validate text input fields
    if (!$eventTitle) { $errorList[] = "Invalid entry: Title"; $count++; }
    if (!$eventInfo) { $errorList[] = "Invalid entry: Info"; $count++; }
    // check for errors
    // if none found...
    if (sizeof($errorList) == 0)
    {
    // print result
    	echo "Update successful! <a href=intro.php>Go back to the Welcome page.</a>.";
    // close database connection
    	mysql_close($connection);
    }
    else
    {
    // errors found
    // print as list
    	echo "The following errors were encountered: <br>";
    	echo "<ul>";
    	for ($x=0; $x<sizeof($errorList); $x++)
    	{
    		echo "<li>$errorList[$x]";
    	}
    	echo "</ul>";
    }
    }
    ?>
    

     

    Ive just copied and pasted about and added a few things in there so it may mess up your tables etc.

     

    What I suggest is to go through some of the quick tutorials here -> www.w3schools.com just to get clearer understanding of how some of the html elements work and things like post.  Also the php manual tells you how the functions used work www.php.net.  Good Luck

  6. The fields on the edit page will not populate as you have taken out the for loop, I think this is the one at the top, correct?

     

    Personally I would write it like :

    mysql_select_db($site, $site);
    $qry = mysql_query("SELECT * FROM events") or trigger_error("SQL", E_USER_WARNING);
    while($row == mysql_fetch_assoc($qry)) {
                 $id = $row["eventID"];
                 $eventTitle = $row["eventTitle"];
                 $eventInfo = $row["eventInfo"];
                 $eventImage = $row["eventImage"];
    //Other code goes in here...
            }
    

     

    Now do you mean to have as many forms as there are events, as that can get messy indeed and is not recommended way about it, or do you want to have a SELECT menu, where you can choose an event to be edited (best option)?

  7. OK I worked it out, for some reason php4 does not like underscores in objects passed between files.

     

    When I changed $sub_cat to $subcat it worked fine!!

     

    Man what a headache, I don't know where to put that in the php man, so if anyone can point me in the right direction or post it there themselves would be appreciated.

  8. Thanks Thorpe for your reply, but I had already tried that and that's the way it is done in the script that works.

     

    It is really unusual behaviour as it is available in the included header file, but when that is finished parsing the rest of the script doesn't have it available.  Whereas it does in the first file?

  9. there is little wrong with your define statement.  Usually it is best practive to use uppercase for your constants, but that is neither here nor there.

     

    Try turning on errors in your php.ini file or use ini_set() <- look in the manual.  And see where the error may lie.

     

    It is probably down to spelling or you directory path.

     

    Are you meant to use "specsname" instead of "space.conf" it seems there is no need to use that constant!

     

    as themistral says, it is unclear what u are asking and i know it can be frustrating, but many people will ignore your pleas if you don't ask nicely.

     

    good luck

  10. I have two files, that are practically the same, except one version has objects available in the content but the other doesn't!

     

    Both scripts are being run from the same directory and use the same includes.  Please can someone compare the two to help me find the mistake is.

     

    Working index.php

    <?php
    
    require_once($_SERVER["DOCUMENT_ROOT"] . "/php/data_obj.php");
    
    $prodFocus = array(	'id'		=> 'MRI-10/100/24/RSR',
    									'link'	=> 'http://www.mri.co.uk/products/Networking/10_100_24_RSR.php',
    									'img'		=> 'http://www.mri.co.uk/images/MRI-10-100-24RSR.jpg',
    									'pitch'	=> 'The MRI-10/100/24/RSR Ethernet Switch, is a standalone, fixed configuration, managed 10/100 switch providing workgroup connectivity for small to mid sized networks.',
    									'f1'		=> '19” Standard Rack Mount Size',
    									'f2'		=> 'Auto-detect Full/half duplex transfer mode on all ports',
    									'f3'		=> 'Supports STP/RSTP');
    
    $cat = $objs->products->category3;
    
    $title = $cat->name . ' Datasheets';
    $modified = '29th Jan 2008';
    
    include($_SERVER['DOCUMENT_ROOT'] . '/head.htm');
    
    ?>
    
    <p class='path'><a href='http://www.mri.co.uk/'>Home</a>>
    <a href='http://www.mri.co.uk/support/index.php'>Technical Support</a>>
    <a href='http://www.mri.co.uk/support/documentation.php'>Documentation</a>>
    <a href='http://www.mri.co.uk/support/datasheets.php'>Datasheets</a>>
    <span style='padding-left:5px;'><?=$cat->name?></span></p>
    ...
    ...
    

     

    Not Working

    <?php
    
    require_once($_SERVER["DOCUMENT_ROOT"] . "/php/data_obj.php");
    
    $prodFocus = array(	'id'		=> 'MRI-10/100/24/RSR',
    									'link'	=> 'http://www.mri.co.uk/products/Networking/10_100_24_RSR.php',
    									'img'		=> 'http://www.mri.co.uk/images/MRI-10-100-24RSR.jpg',
    									'pitch'	=> 'The MRI-10/100/24/RSR Ethernet Switch, is a standalone, fixed configuration, managed 10/100 switch providing workgroup connectivity for small to mid sized networks.',
    									'f1'		=> '19” Standard Rack Mount Size',
    									'f2'		=> 'Auto-detect Full/half duplex transfer mode on all ports',
    									'f3'		=> 'Supports STP/RSTP');
    
    $cat = $objs->products->category3;
    $sub_cat = $cat->sub_cats->sub_cat30;
    
    $title = $sub_cat->name . ' Datasheets';
    $modified = '29th Jan 2008';
    
    include($_SERVER['DOCUMENT_ROOT'] . '/head.htm');
    
    ?>
    
    <p class='path'><a href='http://www.mri.co.uk/'>Home</a>>
    <a href='http://www.mri.co.uk/support/index.php'>Technical Support</a>>
    <a href='http://www.mri.co.uk/support/documentation.php'>Documentation</a>>
    <a href='http://www.mri.co.uk/controllers/datasheets/index.php'>Datasheets</a>>
    <span style='padding-left:5px;'><?=$sub_cat->name?> Datasheets</span></p>
    ...
    ...
    

     

    Now the object is available before the ?> in the non working file as it can be seen in the $title var used in the head template, however where the object is in use in the final line of the code posted it is unavailable, whereas it is in the first block of code.

     

    I've tried setting the object as global but it doesn't change anything.  Thanks for your time.

  11. Erm, thanks for all your info.  Yeah I know java is seperate from JS I'm just lazy.

     

    My Select menu is like this :

    <form action="$url/php/select_url.php" method="post">
    <select id='menu' onchange='submit()' name='menu'>
    	<option>Jump to Product</option>
    </select>
    </form>
    

     

    And papface's code works nicely.  I use a seperate php method to populate the select menu.  So as this one uses the onchange submit() <- I take it that is a javascript function and would not work, however if I use a noscript and include a submit button it will just have a button for the people not enabling JS correct?

     

    If so we have a fully functional Submit menu without using any javascript, it IS possible!

  12. Can this be done without javascript, as I already have it working with javascript, but want to replace it with pure php 4 so that users without java can use the function.  I'm using a select menu to jump to another page, by the way.

  13. Hmm, I sorted most of these out, the errors are just small ones, and taking these out does effect the structure.  I even did take these out to see if it worked without these errors but no joy, so I put them back in.

     

    The error that I am seeing, is not a black square 75x75, but is blocks of blankness, and this seems different for different users. i.e on mine Win2000 SP4 IE6.0.28xxx

     

    On loading the second paragraph on the first block of text, only half is showing, when I scroll down it re-appears as if like an etch-o-sketch bar.  But when I hover over a link, like say the nav bar at the top, it starts taking chunks out again.

     

    A similar thing happens when I hover over the bottom buttons, where grey spills over the content div.

     

    I don't have any idea as to why this behaviour is happening.  Any more ideas?

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