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.

scaz182

Privileged
  • Joined

  • Last visited

Everything posted by scaz182

  1. Ok cool I'll look into that thanks!
  2. Hi people, I was just interested how people structured their website folders? I usually have the following folders /CSS (containing style sheets) /Images (containing Images) /Includes (containing the header and footer which is usually linked to using SSI or PHP). I than have all the pages in the _root. I always figured their must be a better way of setting this out (having all the pages in the same folder can get messy as it grows) I have tried other ways such as splitting up the pages into other folders/categories but I found it to be a pain having to change the links to images, css, includes etc. on different located pages. Does anyone have a method they would like to share?
  3. scaz182 replied to Cabbage's topic in Frontend
    I seem to remember having to use a negative z-index on absolutely positioned divs for it to take affect. (although I may be wrong)
  4. Hi, I am looking for a simple javascript validation script that will work on both IE and Firefox. All I really need to do is check if certain fields are empty (I'm not to fussed about correct email etc.) And I guess use an alertbox to inform the user My form looks like this: <form action="contact.php" method="post"> <p><label>*Name:</label> <input type="text" name="name" size="20" maxlength="40" /></p> <p><label>*Email:</label> <input type="text" name="email" size="20" maxlength="40" /></p> <p><label>Subject:</label> <input type="text" name="sub" size="20" maxlength="40" /></p> <p><label>*Message:</label><br/> <textarea cols="25" rows="10" name="body"></textarea></p> <p class="submit"> <input type="submit" name="submit" value="Send"/></p> <p><input type="hidden" name="submitted" value="TRUE"/></p> </form> It's ultimately only the name, email and message boxes that need to be validated. Any help would be much appreciated!
  5. Ahh great, thanks for the quick fix bluedreamer!
  6. Hi people, I have a simple contact form & I want the first three input boxes on the left side and then the main message box and the submit button on the right. I've managed to do this using div tags and floats around the first three boxes and then again around the message box and submit button (although the submit button doesn't move with the message box for some reason) Anyway the problem that occurs form using this method is it stops users from accessing the input boxes on the left. Here's a link to show you what I mean. Does anybody know of a way to achieve this form layout correctly? p.s I'm using a strict doctype. Cheers Rich.
  7. You just need to create a div 'container' which contains all other code and apply the following: div#container { position:relative; margin-left:auto; margin-right:auto; width:(your width); } to centre a site and then put a banner/logo/navigation in a div, call it 'header' and add the following to that: div#banner { height:(your height); width:(your width); position:fixed; } my site uses this - link
  8. OK I've sorted it! All I did was change the require_once() function's argument to a relative URL instead of an absolute (pretty strange that it matters but I don't care it's done Thanks for all your help people!
  9. mmm that is so strange! Thanks very much for testing it AJReading. I am definitely using the ip address as the host and it works fine if I include a simple query within the start.php as you did AJ. I have also double checked my INSERT query works and it does as I've tested it putting it in the connection file as above. This now has me believe there is an issue with the use of the require_once function? Any thoughts? It's driving me crazy!
  10. Ok, Streamline have said that they are unaware of any problems with the server! they gave me a test script which works, so I guess there right! this is streamlines test script: <?php $dblink = mysql_connect("serverURL", "USERNAME", "PASSWORD") or die("Could not connect to MySQL server"); $db = mysql_select_db("DATABASENAME") or die("Could not connect to Database"); $res = mysql_query("SHOW TABLES ") or die("Could not run query"); $row = mysql_fetch_array($res); if($row == "") { echo "No tables found, connection works.";} else { echo "Tables found and connections work.<br />Tables found:<br />"; foreach($row as $key => $value){ if(is_numeric($key)){ echo $value."<br />"; } } }?><br />Script created at: 01/05/2008 02:11:32<br />Current time/date: <? echo date("d\/m\/Y h:i:s"); ?> You can see it working here test script This tells me it is actually something in my code! Can anybody spot what is wrong? It's driving me crazy! I'll give you my code again as it's now more complete: <html> <head> <title>Add Book</title> </head> <body> <?php if (isset($_POST['submit'])) { $errors = array(); // validate isbn if (empty($_POST['isbn'])) { $errors[] = 'You did not enter the books ISBN.'; } else { $isbn = trim($_POST['isbn']); } // validate name if (empty($_POST['bname'])) { $errors[] = 'you did not enter the books name.'; } else { $bn = trim($_POST['bname']); } // validate Author if (empty($_POST['author'])) { $errors[] = 'You did not enter the author of the book.'; } else { $a = trim($_POST['author']); } // validate publisher if (empty($_POST['pub'])) { $errors[] = 'You did not enter the books publisher.'; } else { $p = trim($_POST['pub']); } // create short hand for in stock $is = $_POST['stock']; //check errors if (empty($errors)) { require_once ('http://www.richardscarrott.co.uk/PRIVATE/start.php'); $query = "INSERT INTO books (ISBN, Name, Author, Publisher, Stock) VALUES ('$isbn', '$bn', '$a', '$p', '$is')"; $result = @mysql_query ($query); if($result) { echo "<h2>$bn has been added to the database</h2>"; exit(); } else { echo "<h2>You have a system error my friend</h2>"; echo '<p>' . mysql_error() . '<br/><br/>Query: ' . $query . '</p>'; exit(); } } else { echo '<h2>An error has occured with your input</h2> <p>The following errors occurred:<br/>'; foreach ($errors as $msg) { echo " - $msg<br/>\n"; } } } else { ?> <h2>Insert Book into database</h2> <form action="addbook.php" method="post"> <p>ISNB: <input type="text" name="isbn" size="20" maxlength="20" value="<?php if (isset($_POST['isbn'])) echo $_POST['isbn'];?>" /></p> <p>Book Name: <input type="text" name="bname" size="20" maxlength="20" value="<?php if (isset($_POST['bname'])) echo $_POST['bname'];?>" /></p> <p>Author: <input type="text" name="author" size="20" maxlength="20" value="<?php if (isset($_POST['author'])) echo $_POST['author'];?>" /></p> <p>Publisher: <input type="text" name="pub" size="20" maxlength="20" value="<?php if (isset($_POST['pub'])) echo $_POST['pub'];?>" /></p> <p>In Stock: <input type="checkbox" name="stock" value="TRUE" <?php if (($_POST['stock']) == 'TRUE') echo 'checked="checked"';?> /></p> <p> <input type="submit" name="submit" value="Enter" /></p> <!--<input type="hidden" name="submitted" value="TRUE" />--> </form> <?php } ?> </body> </html> and again here is my connection data (which I still believe to be working!): <?php //database access information // define constants DEFINE ('DB_USER', 'username'); DEFINE ('DB_PASSWORD', 'password'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'databasename'); //make connection $dbc = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) OR die('Could not connect to database: ' . mysql_error()); mysql_select_db(DB_NAME) OR die('could not select database: ' .mysql_error()); ?> just in case you haven't read the first post the error message I get is: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) Again, any help would be so appreciated! Rich.
  11. I'm hosted by streamline.net, I've opened a support ticket with them but as anybody who has used streamline before will know it's rather doubtful that I will get anything useful from them. It would be pretty helpful if you could test to see if you can connect AJReading, just so I don't waste any more time trying to sort out something that isn't my code! I'll PM you the details. I am not connecting through localhost but an ip address streamline has provided for the database server (i don't know if this makes any difference). What is this script you speak of Jem? how would it enter a new record without using mySQL? Cheers.
  12. Hi, I am trying to create a program that will insert a new record with the values taken form a form. I think everythin is going fine untill I enter the values and get the error message: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) here is my code: <html> <head> <title>Add Book</title> </head> <body> <?php $errors = array(); // validate isbn if (empty($_POST['isbn'])) { $errors[] = 'You did not enter the books ISBN.'; } else { $isbn = trim($_POST['isbn']); } // validate name if (empty($_POST['bname'])) { $errors[] = 'you did not enter the books name.'; } else { $bn = trim($_POST['bname']); } // validate Author if (empty($_POST['author'])) { $errors[] = 'You did not enter the author of the book.'; } else { $a = trim($_POST['author']); } // validate publisher if (empty($_POST['pub'])) { $errors[] = 'You did not enter the books publisher.'; } else { $p = trim($_POST['pub']); } // create short hand for in stock $is = $_POST['stock']; //check errors if (empty($errors)) { require_once ('http://www.richardscarrott.co.uk/PRIVATE/start.php'); $query = "INSERT INTO books (ISBN, Name, Author, Publisher, Stock) VALUES ('$isbn', '$bn', '$a', '$p', '$is')"; $result = @mysql_query ($query); if($result) { echo "<h2>$bn has been added to the database</h2>"; exit(); } else { echo "<h2>You have a system error my friend</h2>"; echo '<p>' . mysql_error() . '<br/><br/>Query: ' . $query . '</p>'; exit(); } } else { echo '<h2>An error has occured with your input</h2> <p>The following errors occurred:<br/>'; foreach ($errors as $msg) { echo " - $msg<br/>\n"; } } ?> <h2>Insert Book into database</h2> <form action="addbook.php" method="post"> <p>ISNB: <input type="text" name="isbn" size="20" maxlength="20" value="<?php if (isset($_POST['isbn'])) echo $_POST['isbn'];?>" /></p> <p>Book Name: <input type="text" name="bname" size="20" maxlength="20" value="<?php if (isset($_POST['bname'])) echo $_POST['bname'];?>" /></p> <p>Author: <input type="text" name="author" size="20" maxlength="20" value="<?php if (isset($_POST['author'])) echo $_POST['author'];?>" /></p> <p>Publisher: <input type="text" name="pub" size="20" maxlength="20" value="<?php if (isset($_POST['pub'])) echo $_POST['pub'];?>" /></p> <p>Staff Member: <input type="checkbox" name="stock" value="TRUE" <?php if (($_POST['stock']) == 'TRUE') echo 'checked="checked"';?> /></p> <p> <input type="submit" name="submit" value="Enter" /></p> <input type="hidden" name="submitted" value="TRUE" /> </form> </body> </html> I'm pretty certain the start.php file is connecting to the database when run on it's own as it does what the book says and dispays a blank screen. but here it is just in case it helps? <?php //database access infomation // define constants DEFINE ('DB_USER', 'username'); DEFINE ('DB_PASSWORD', 'password'); DEFINE ('DB_HOST', 'localhost'); DEFINE ('DB_NAME', 'databasename'); //make connection $dbc = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) OR die('Could not connect to database: ' . mysql_error()); mysql_select_db(DB_NAME) OR die('could not select database: ' .mysql_error()); ?> Obviously the aove constants values are the real password / username etc. Has anyone got any ideas? (I'm using a hosting company so have little control over what I do with the MySQL installation) Any help would be much appreciated Cheers!
  13. Ok cool, thanks for your help.
  14. Hi people, just interested as to whether Flash functions differently in different browsers. I.e does flash cause similar problems that HMTL can such as firefox displaying a site differently to Opera or IE? Basically are all Flash plug-ins the same on different browsers and OS's? Cheers Rich
  15. Is this confusion not all dreamweavers fault, because it strangely calls divs 'layers' and allows you to draw them onto the canvas much like photoshop. It also lets you choose when to show and hide the divs on click with some script. I would recommend leaving dreamweaver well alone when first starting out!
  16. Just had a go, it works although it's almost certainly a gimmick. It works in a very similar way to the 'Eye-toy' on the Playstation. & all I know is my arms are now aching, whilst it is very clever I don't think this its quite a replacement for the mouse!
  17. scaz182 replied to scaz182's topic in Server Side
    Awesome thanks Thomas I have read about implode and explode before but never really 'got' what they were used for! Cheers.
  18. scaz182 replied to scaz182's topic in Server Side
    Thanks but I know how to send that. What I need to do is send an ARRAY variable in an email. I need to print each array element in the email. Just as the foreach loop does in the webpage. I assume this would be done by putting the array in the $body but I do not know how to do this. OR If someone knows how to put the values of an array into a single variable (as a string) that would do the job because this single variable could then go into $body of the mail() function
  19. scaz182 posted a topic in Server Side
    Hi people, I have a PHP form which collates a bunch of infomation form the user and then stores it in an array. I now need to send the array in an email. I know how to print the array using foreach ($package as $selection) { echo " - $selection<br/>\n"; } But I cannot work out how I can put that into $body so it can be emailed? Does anybody have any idea? Cheers Rich
  20. What kip said ^, I can't remember who's blog it was off.
  21. ah that makes sense, well spotted. Cheers
  22. This site uses valid strict XHTML and doesn't use fieldset!
  23. Ahh that worked, thanks! I never knew <fieldset> was a required element of a form? I'm almost certain I have other forms validating on other websites without it?
  24. I saw this site previously, Its proper class, I wish my design skills were on par with yours!
  25. scaz182 replied to scaz182's topic in Frontend
    thanks for your help people, I've given up using the radio buttons and gone for annoyingly un-customisable select menus instead. here

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.