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.

warren

Members
  • Joined

  • Last visited

Everything posted by warren

  1. Hi Adi Are you on shared hosting? Also, the edit feature is there for a reason
  2. #subnavlist li.active a { color: #ff9900; text-decoration: none; } ? Or am I totally missing what you're saying
  3. I took this from your a:hover css #navcontainer ul li a.current { color: #003277; background-color: #ffffff; padding: 0.3em 0.8em; margin: 0; } This, in my Firefox, gives your home link a 'selected' style the same as your hover style If you were also need to know about how to make each one appear as current when browsing just reply
  4. warren replied to TypucT's topic in Frontend
    You can use $_COOKIE . If you set the cookie name like $name = 'myCookie'; $myCookieValue = $_POST['inputnamewithvalueIwant']; setcookie($myCookie", $myCookieValue, time()+3600); Then to access the cookie you'd use echo $_COOKIE[$name']; eg <input name="name" type="text" value="<?=$_COOKIE[$name];?>" /> I do not recommend using any of this example in an actual live site. Lol.
  5. Having the "Welcome username" with styles/whatever you call it prob isn't a good idea. Nice design so far tho
  6. Thanks RobH. I'll certainly give this idea a go. The way my current projects go, all my classes are included via the config file / looping file. It's just accessing classes in other classes that's a pain. So would function __autoload be a method of the current class I'm work in? Or just an alone function in a config file somewhere? This idea looks promising, cheers.
  7. CMSMadeSimple is decent for just that. Being a simple, template based, content manager. Used it a few times in the past, clients generally pleased. It's not bloated like alot of CMS's out there which is good. One thing to look at when choosing a CMS is the community surrounding it. Why? This is a good way of judging further development, bug fixes, community modules etc etc.
  8. Oh mate, Cheers for that. Life saver! thank you!
  9. HELLLOOOO This is driving me nuts I'm trying to global an object instance dynamically to then call methods etc. So, we know how to call variables dynamically $testvar = 'My calling'; $varstring = 'testvar'; echo $varstring; //Would just echo a string, 'testvar' echo ${$varstring}; // This would actually call the variable $testvar and echo 'My calling' We also know how to global variables/instances //Outside scope $success = new Success; //In a function/method global $success; $success->add('OMG THE INTERNET WORKS'); We can dynamically global variables //Somewhere outside the scope $string = 'This is my string'; //Somewhere inside scope $var = 'string'; global ${$var}; echo ${$var}; // would echo 'This is my string' But I can't do it with instances //Somewhere outside scope $success = new Success; //In side the function/method $instance = 'success'; //This could actually be anything, like info, error, alert, etc etc global ${$instance}; //This actually appears to global the correct instance ${$instance}->add('errorzor'); // Something goes wrong here or above I can't get it to call $success's add method. Any ideas appreciated.
  10. Blog doesn't load EDIT: work internet sucks
  11. It's actually pretty easy. My advice isn't to have 2 separate html pages but instead use some php to decide the output. Using a page with your current template, you could write something like this: ( This isn't an exact example, and I haven't tested it ) This code goes at the very top of the page ------------------------------------------------ <?php $showForm = 1; if($_POST['contactForm']) { $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) { $error = "<h4>Invalid email address</h4>"; $error .= "<a href='java script:history.back(1);'>Back</a>"; } elseif ($subject == "") { $error = "<h4>No subject</h4>"; $error .= "<a href='java script:history.back(1);'>Back</a>"; } else { $my_email = 'info@webexpress-uk.com'; $message = ' Message from: '.$name."\n\n".' Address: '.$email."\n\n". $name .' wrote: '."\n\n".$message; if (mail($my_email,$subject,$message)) { $showForm = 0; $success .= "<h4>Thank you for contacting us</h4>"; } else { $error = "<h4>An error has occured. Please click back and try again or send an email to info@webexpress-uk.com</h4>"; } } } ?> ------------------------------------------------ //All your html, head, body etc etc This goes in the area your form is ment to display ------------------------------------------------ <?php //Code here determines if we display the form or not echo $success if($showForm == 1) { echo $error; ?> <form id="contact" action="contact.php" method="post" onsubmit="return configForm(this);" style="position: relative; z-index: 1;"> <p> <input type="text" name="name" value="Name" class="width75" onfocus="clearValue(this, 'Name');" onblur="fillValue(this, 'Name');"/> </p> <p> <input type="text" name="email" value="E-mail" class="width75" onfocus="clearValue(this, 'E-mail');" onblur="fillValue(this, 'E-mail');"/> </p> <p> <input type="text" name="subject" value="Subject" class="width75" onfocus="clearValue(this, 'Subject');" onblur="fillValue(this, 'Subject');"/> </p> <p> <textarea name="message" rows="5" cols="80" onfocus="clearValue(this, 'Message');" onblur="fillValue(this, 'Message');">Message</textarea> </p> <p> <input type="submit" name="contactForm" value="SEND" class="button" /> <input type="reset" value="RESET" class="button" /> </p> </form> <?php } ?> //Rest of your template html ------------------------------------------------ Since you're using PHP and HTML is the same page, you'll need to rename it to something.php, then the form's action="" will need to match the filename. See how it goes Also your error messages might need to be updated, as you wont need to "go back" anymore, seeing as you'll still be on the same page.
  12. Try this.. <?php $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) { echo "<h4>Invalid email address</h4>"; echo "<a href='java script:history.back(1);'>Back</a>"; } elseif ($subject == "") { echo "<h4>No subject</h4>"; echo "<a href='java script:history.back(1);'>Back</a>"; } else { $my_email = 'info@webexpress-uk.com'; $message = ' Message from: '.$name."\n\n".' Address: '.$email."\n\n". $name .' wrote: '."\n\n".$message; if (mail($my_email,$subject,$message)) { echo "<h4>Thank you for contacting us</h4>"; } else { echo "<h4>An error has occured. Please click back and try again or send an email to info@webexpress-uk.com</h4>"; } } ?>
  13. Actually I have a friend who is in need of a voice over artist. When the website is up please let me know
  14. 1: Open dream weaver and use find and replace on a directory. If you don't have dream weaver, warez it. 2. Download winscp (my recommendation, there are plenty out there). You should have an ftp client if you're making websites. The majority of ftp apps allow for chmod changes. CHMOD: File Permissions (777,666 stuff) Basically CHMOD is the linux file permission system, unlike windows, lunix allows you to set specific permissions for files. This is what these numbers represent: Each number is the permission for a specific group Owner: R(4) W(2) X(1) Group: R(4) W(2) X(1) Others: R(4) W(2) X(1) The settings are Read, Write, and Execute. Any combination of these settings is allowed, and thus the sometimes random makeup of numbers. To allow reading is 4, 2 is writing and execution is 1. For example: 664, The first 6, means reading and writing for owner ( 4 + 2), same for group, but others only get reading (4) Hope this has helped, allot can be found if u Google CHMOD. 3: Copyright, no idea sorry.
  15. .. elseif (mail($name,$email,$subject,$message)) { .. The mail function is a bit wrong, http://nz2.php.net/manual/en/function.mail.php The mail function requires 3 parameters to function. To: This is the address the email is going TO, from FROM, the current $email variable in your script is the FROM address Subject: This is the subject of the email, how you've got it right now is correct Message: Again the message body, using the right method so far. So to rewrite your mail function $my_email = 'my_personal_address@mysite.com'; mail($my_email,$subject,$message); You will need to build up the message, containing their name, email, and message. For example $message = $name . $email . $message; This is the simplest idea, some formatting could be added. For example $message= ' Message from: '.$name."\n\n".' Address: '.$email."\n\n". $name .' wrote: '."\n\n".$message; This would give the equivalent formatting, Message from Warren Address: warrensemail@email.com Warren wrote: Hello Aled I like your hair cut. Have a nice day There can be more advancement but if we get this going we can see about them later EDIT: also change $HTTP_POST_VARS to $_POST $name = $_POST['name']; also, I like your website's design
  16. Links to IETab
  17. FireBug. Literally couldn't live without. Once you figure out all its perks it's great. Html Validator (HTML Tidy)
  18. Heya Welcome
  19. warren replied to bennyboy7's topic in Server Side
    The main problem here ( I think ) is that changes to the date fields ( via the calender or manual ) are not being reflected in the hidden field. Change the hidden field to text and you will see what I mean. So the values aren't going back to the old values.. the values are never being changed in the first place. Ok after some playing round I realised what was going on. The script inserts the elements into the form, doh!@ Here is the ACTUAL ouputed code, after the javascript has ran <body> <script> </script> <form action="" method="post" name="myform"> <input id="orderdate" type="text" name="orderdate" value="10-MAR-2008"/> <table cellspacing="2" cellpadding="0"> <tbody> <tr> <td valign="middle"> <select id="orderdate_Month_ID" class="calendarDateInput" onchange="orderdate_Object.changeMonth(this)"> </select> </td> <td valign="middle"> <select id="orderdate_Day_ID" class="calendarDateInput" onchange="orderdate_Object.changeDay(this)"> </select> </td> <td valign="middle"> <input id="orderdate_Year_ID" class="calendarDateInput" type="text" onblur="orderdate_Object.fixYear(this)" onkeyup="orderdate_Object.checkYear(this)" onkeypress="return YearDigitsOnly(window.event)" value="2008" title="Year" maxlength="4" size="4"/> </td> <td valign="middle"> <a id="orderdate_ID_Link" onmouseout="return orderdate_Object.iconHover(false)" onmouseover="return orderdate_Object.iconHover(true)" href="java script:orderdate_Object.show()"> </a> <span id="orderdate_ID" onmouseout="orderdate_Object.handleTimer(false)" onmouseover="orderdate_Object.handleTimer(true)" style="border: 1px solid dimgray; position: absolute; visibility: hidden; width: 126px; background-color: white;"> </span> </td> </tr> </tbody> </table> <input id="orderdate" type="button" value="submit" onclick="mydatefunction(this.form.orderdate****)"/> </form> </body> I've highlighted what I believe is the problem. Your script creates a bunch of new elements, mainly those for modifying the date. But it also creates a hidden input to store the changes in. Ironically this hidden input gets called orderdate ( as per your script function call ) and all the other elements get named orderdate_somethinghere eg orderdate_day So when you change the date to 18th of the month the hidden input then changes to 18-MAR-08 etc. The nice thing about this script I noticed is that it appears to destroy the JavaScript elements on submit, meaning you only get your date posted. So basically you have 2 inputs, one created via the JavaScript and your submit button both id'd as 'orderdate' When your JavaScript decides to update the hidden input, it basically says "Oh ****, which one?" Rename your submit to something like id="orderdate_Submit" and you should be all swell. EDIT: Also, remove the JavaScript function ( and call ) that I wrote in my example. It will over write any date changes when you click submit. Good luck
  20. warren replied to bazzie's topic in Frontend
    Hi Bazz Can you please post output code. Thanks
  21. warren replied to bennyboy7's topic in Server Side
    Whoa hold your horses guys... Js is client side.. so ONCLICK should run before the submit event occurs ( eg the form vars are collected and posted back to the server - PHP ). What you're trying to do should work but you may need to use javascript onclick to A: kill the submit event B: make you form modifications C: recreate the submit event - data gets sent to server Even getting into ajax is a little over the top for this EDIT: Made this, not 100% sure if it's what you were meaning but I hope it is <?php if($_POST) { echo '<div style="border: 1px solid #ccc; margin: 10px 0;">'; echo '<p>Your form was submited, here are the results</p>'; echo '<pre>'; print_r($_POST); echo '</pre>'; echo '</div>'; } ?> <script> function mydatefunction(inf) { //this function will SET my special date or whatever to the input value inf.value = 'my special date'; } </script> <form name="myform" method="POST" action="" > <input id="orderdate" type="text" name="orderdate" /> <input id="test" type="button" onClick="mydatefunction(this.form.orderdate)" value="Test with a button" /> <input id="test2" type="submit" onClick="mydatefunction(this.form.orderdate)" value="Test with a submit" /> </form>
  22. @bobbymooreok My recommendation is to use the phpmailer class. It enables you to set the smtp address ( among other things ) on the fly. Other than that could try something with a .htaccess file as this acts similar to your php.ini config except it works at directory level.
  23. @bobbymooreok By the looks of it you're using a windows server? In any case you shouldn't need to create a php.ini there should already be one. I also recommend using phpmailer, it handles this type of problem
  24. warren replied to Xander's topic in Server Side
    Hello Sorry, this isn't really related, but why do you write includes like this: include "".$_GET['c'].".php"; 1. The double double quote at the start? 2. Double quotes around the .php? Double quotes on any strings for that matter? 3. No brackets? I'm not attacking, just curious why? I usually write them like: include($_GET['c'].'.php'); Also I agree with php_penguin, never trust user data. You're just asking for it otherwise
  25. @Aled Mann It feels like you're looking for a quick and easy way to send an email from a form. Something like sendMyEmailNOW(); Sorry to say there's no such thing. While sending an email is a pretty straight forward idea it encompasses many aspects of server side languages that aren't so simple - functions variables etc. Either you could use some sort of pre made script / online service to create your form or you could take the long road. Start learning a scripting language such as php for example. I'm sure the 2nd option would benefit you in the future as knowledge is power moreover it wouldn't take long to begin making your mighty email script. I'm not trying to be negative or say you can't do it. There's just no simple answer. In terms of shedding light, processing forms follow these steps ( or similar ) -> Submit form -- This sends the form data back to the server -- In php we have a global var called $_POST that contains all your post data in an array. Can be accessed via $_POST['username'] for example -> Validation -- Check posted data is safe, not empty, and correct format -> Send the email -- Php has a built it mail function, but there are many methods to go about it. -- Personally I use phpmailer, it's a php class that sends emails nice and easy ( from a dev pov ) Apart from that there isn't much more I could say without actually teaching you PHP. Enjoy the rant

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.