Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

stjohn

Members
  • Joined

  • Last visited

Reputation Activity

  1. Like
    stjohn reacted to nfc212 in a contact form question so basic, im embarrassed.   
    In line 16 the variable for the Full Name field is set to $name
    $name = $_POST['fullname']; // required In line 29 you validate $name
    if(!preg_match($string_exp,$name)) { However in line 47 you use $fullname
    $email_message .= "Name: ".clean_string($fullname)."\n"; Try using
    $email_message .= "Name: ".clean_string($name)."\n"; as line 47
  2. Like
    stjohn reacted to Blofeld in doing the same thing twice.   
    You seemed to miss of your if else brackets to and also didn't have the ID field in uppercase where it should have been.
     
    You code can be shortened a lot like this:
     

    Index.php <body> <?php // ************* You should put this in a separate file and either require() or include() it e.g. "connectDB.php" $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } // ***************** End **************************** //and possibly this line as well if you only use one db mysql_select_db("gwines_test") or die(mysql_error()); //****** Run this once.... $result = mysql_query("SELECT ID,Name FROM products") or die('Blah ' . mysql_error()); $product_id=0; while($row = mysql_fetch_array($result)) { $product_id=$row['ID']; $navList .= "<li><a href=\"product.php?id=" . $product_id . "\">". $row['Name'] ."</a></li>"; } //*** this next part seems to be unused and can be deleted: $i=0; $num=mysql_num_rows($result); ////// Finding all the information in the table and counting the rows mysql_data_seek($result, 0); //***end of uselessness ***** ?> <div id="wrapper"> <div id="content"> <div id="header"> <div id="menu"> <ul> <li><a href="#">Home</a></li> <li><a href="#">Products</a> <ul> <?php echo $navList; ?> </ul> </li> </div> </div> <div id="main"> <h1>"Wine is a pleasure that transports us from the present to the past" </h1> <ul> <?php //I added the ul tags too!! echo $navList; ?> </ul> </div>
     
     

    Product.php <body> <?php // get database connect info require("connectDB.php"); if(is_numeric($_GET['id'])) { //since you are calling from the url directly to the sql query, use mysql_real_escape_string() for some security $product_id= mysql_real_escape_string($_GET['id']); } else{ $product_id = -1; } // I also notice in your index page your 'id' field in the DB is uppercase so change it to that. $result = mysql_query("SELECT ID, name, producttype, description, winery, imgloc, thumbloc FROM products WHERE id='" . $product_id . "'") or die('Blah ' . mysql_error()); $product_id=0; while($row = mysql_fetch_array($result)) { $product_id=$row['ID']; $navList .= "<li><a href=\"product.php?id=" . $product_id . "\">". $row['Name'] ."</a></li>"; } ?> <div id="wrapper"> <div id="menu"> <li><a href="#">Products</a> <ul> <?php echo $navList; ?> </ul> </li> </div> <div id="main"> <?php echo "<h4>" . $row['name'] . "</h4><br/>"; ?> <img src="images/line.png" width="613" height="2" /> <?php echo '<img src="' . $row['imgloc'] . '" id="prod_img" /><br/>'; echo "<h5>" . $row['name'] . "</h5>"; echo "<p>Description: " . $row['description'] . "<br/>"; echo "Winery: " . $row['winery'] . "<br/>"; echo "<a href=\"index.php\">[Go Back]</a></p>"; ?> </div>
  3. Like
    stjohn reacted to Anth Winter in Wine site, new look!   
    I checked out your background, I stretched my IE8 browser across two 17" screens and it kept in proportion and still looked fine blending wise think you may have that one sorted.
  4. Like
    stjohn reacted to mteam in problems with CSS rollover   
    Change

    #navigation ul { color:#FFFFFF; height:58px; left:0; list-style:none outside none; margin:0 0 0 190px; padding:0; position:relative; text-align:center; top:0; width:834px;
     
    Change the hover positions these might not be correct
     

    #navigation li.home a:hover { background:url("images/menu_roll.jpg") no-repeat scroll -190px -58px transparent; } #navigation li.bio a:hover { background:url("images/menu_roll.jpg") no-repeat scroll -326px -58px transparent; } #navigation li.news a:hover { background:url("images/menu_roll.jpg") no-repeat scroll -462px -58px transparent; } #navigation li.concerts a:hover { background:url("images/menu_roll.jpg") no-repeat scroll -598px -58px transparent; } #navigation li.works a:hover { background:url("images/menu_roll.jpg") no-repeat scroll -734px -58px transparent; } #navigation li.contact a:hover { background:url("images/menu_roll.jpg") no-repeat scroll -869px -58px transparent; }

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.