Jump to content

SamohtVII

Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by SamohtVII

  1. So I have been looking into making my website responsive and just have a few questions. 1) How many media queries will I need to write? I just want to cover phones and tablets and I don't want to get into too much detail besides that. Surely I can have a media query from the smallest device up until the largest phone and that will be it for phones. Same with iPads. Am I missing something here? 2) Can I put a media query anywhere? I want to changes some font size when it gets too small but the media query would be random like from 490px -550px. Is this ok to do? How do other people do it? Does anyone have some set widths they use or rules they follow? Thanks
  2. We have a winner! Thanks heaps everyone. Works perfect.
  3. The problem with that is some of the nodes have multiple words and some have just one word so I was hoping for something that can vertical and horizontal align so it's consistantly spaced.
  4. Thanks. That's very close but the text goes over 2 lines so now it is very spaced out. Any ideas?
  5. Here's a tricky one. I have a div (80x80) and inside the div is an anchor tag. I want the clickable area for the anchor tag to be the entire width and height of the parent div. Along with that I would like the text center aligned and center justified. The closest I have is display:block that aligns the text top and then I can get the text centered vertically but not horizontally. Can anyone help. I can't do any workarounds this must be done in CSS. Thanks <div class="subBubble"> <a class='node' href='node/89'>Imaging</a> </div> Thanks
  6. Hi all, I have a form that works fine inn all browsers except IE. The form needs to submit on enter and use ajax to handle the fom data, Here is the relevant code. Is there anything here I can do do make it work as is with IE. What makes IE not submit with Enter and how do I get around it. Thanks <div class="element"> <b>Address</b>: <form id="addressPForm"> <input type="text" id="addressForm" value="<?php echo $address; ?>"/> <input type="text" class="uidAddress" value="<?php echo $uid; ?>" style="display:none"/> <input type="submit" id="buttonXaddress"/> </form></div> $(function() { $("#buttonXaddress").click(function(e) { e.preventDefault(); var newName = $('input#addressForm').val(); var type = "address"; if(newName != '') { var id = $('input.uidAddress').val(); $.ajax({ type: "POST", url: "changeName.php", data: {newName: newName, id: id, type: type}, success: function(result){ document.getElementById("addressP").innerHTML = result; document.getElementById("addressP").style.display="inline"; document.getElementById("addressPForm").style.display="none"; } }); } });});
  7. I have developed a website and now we want to put that site behind the login of another website. So basically this second website has a login system and when logged in will redirect to mine. How can I hide my site from being found so you can't get to it without logging in through this other site. I am speaking with the developers of the other site to achieve this fyi. Thanks
  8. Man if that works -.- brb RE: Nah doesn't work. I don't know why. Any reason why it wouldn't :S
  9. Ok so basically I have a table with a form in it and regardless of how much people may hate tables and how porrly coded this may be I need to format the submit button inside the table but nothing seems to work. I have tried the usual like #confirmation #confirm {} table th #confirmation #confirm {} and every combination between that. Can anyone shed some like on how to style the submit button. Thanks <th><form id="confirmation" name="myFormAll" method="post" action="confirm.php"> <input type="number" id="amount" name="amount" style="width:100px;" required min="0" /></th><th> <input type="submit" value="Confirm" id="confirm" /></form></th>
  10. Hi, I have been asked to build a share management website and am now looking at web hosting and was wondering what the best option would be. I was looking at unlimited as this would be a sure thing in terms of avoiding and data problems, but I am completely ignorant in terms of how much space a database would use. The website itself is about 20 htm/php pages and nothing extreme by any means. Just a regular web page really. But the problem is there will be a lot of rows i the database. It keeps a history of everything and would eventually be quite big I imagine. Is 50GB a lot or should I just go for unlimited? Maybe that was all jiberish, sorry a bit noob with server renting and the like. Thanks
  11. So I have a script src to "http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js". Is there any difference between sourcing the url or saving it to my web space and accessing it from there? What is recommended? Thanks.
  12. So I just converted my mysql to mysqli and I noticed when I do something like this: $sql = $mysqli->query("SELECT * FROM `history` WHERE user = '$user'"); while($row = $sql->fetch_assoc()) { //DO SOMETHING } ?> If the query finds nothing it gets an error so now I am prefixing all my while statements with if($sql). If mysqli is so much better why does this error happen and is there a better way for me to avoid adding that extra if everytime. Thanks
  13. Can you elaborate or link me to some more information about sanitizing output to avoid SQL Injection. Sorry not too experienced here. Thanks
  14. Can someone tell me the best practice to use multiple sql statements. Right now I have a few statements I need run and it goes something like this: $sql = "UPDATE `details` SET balance=balance+$amount WHERE username = '$user'"; //Run sql statement $sql = "UPDATE `details` SET balanceAva=balance WHERE username = '$user'"; //Run sql statement etc. I have a feeling, and correct me if i'm wrong, but I can do this: $sql = "UPDATE `details` SET balance=balance+$amount WHERE username = '$user';UPDATE `details` SET balanceAva=balance WHERE username = '$user';"; And then run all that at once right? Thanks
  15. Is there a way I can set-up the site and then in the body 'include' a file called content.html and then set that up so the user can edit that one.
  16. Basically I am making a site for someone and they want to control the content that will go into the middle content area of each link, so when a user clicks 'home' the content that the other admin specifies will be included in the content. images, text and links mainly.
  17. So I have built a frame of a site which is pretty much the navigation, header and an empty body. The idea is that the body should be entirely editable by another person who doesn't know HTML too well. So I have made a site and I want to hand it over to someone else to fill and edit and do what they want. Is the best way to do this Joomla or another CMS? I have looked into it but I want to use the site I have already created I don't want to make the site in the CMS or do I have no choice? It's my first look into CMS's and to my understanding you build the site in Joomla and edit it in there as well. But I already have a site built I just want the user to be able to edit the body of it all easily. I hope that all made sense. Thanks
  18. Thanks heaps mate. Got firebug and immediately found the problem. ty
  19. Sorry, ummThe success function goes of and prints changes saved but nothing in my BD table changes. I don't know about the console log, I got the from a tutorial so where does that get saved? :S It seems like it all runs fine except does nothing with editOptions.php.
  20. Ok I have seen a lot about submitting a form without refresh and I feel there are a couple of ways to do this with submit or just using a button (Difference/best?) and I am just still running into pproblems despite searching through countless posts. So: <script type="text/javascript"> $(function() { $('.adminButton').click(function(e) { e.preventDefault(); var privacy = $('input:radio[name=privacy]:checked').val(); var invites = $('input:radio[name=invites]:checked').val(); var posts = $('input:radio[name=posts]:checked').val(); console.log(privacy, invites, posts); //return; //alert(posts); $.ajax({ type: "POST", url: "editOptions.php", data: {privacy: privacy, invites: invites, posts: posts}, success: function(result) { $('#admin2').append("<div id='message'>Changes Saved</div>"); console.log(result); console.log("success"); } }); }); }); </script> and: <div id="admin2"> </div> <form action="" method="post" name="editOptions"> Privacy<br /> <input type="radio" name="privacy" id="privacy" value="public" > Public <br /> <input type="radio" name="privacy" id="privacy" value="private" > Private <br /><br /> Invites<br /> <input type="radio" name="invites" id="invites" value="adminonly" > Admin Only <br /> <input type="radio" name="invites" id="invites" value="everyone" > Everyone <br /><br /> Posts<br /> <input type="radio" name="posts" id="posts" value="adminonly" > Admin Only <br /> <input type="radio" name="posts" id="posts" value="everyone" > Everyone <br /> <textarea style="display:none;" name="groupName"><?php echo $groupAd; ?></textarea> <button class="adminButton">Save Changes</button> </form> So just a form with 3 sets of 2 radio buttons. So I think the problem is going through many tutorials and posts I have a combination of what to do when you either 'submit' or when you click a 'button' but maybe others can see something easy I missed. ty EDIT editOptions just in case <?php include 'config.php';$privacyX = $_POST['privacy'];$invitesX = $_POST['invites'];$postsX = $_POST['posts'];$groupAd = $_POST['groupName'];$sql = "UPDATE `options` SET privacy='$privacyX', invite='$invitesX', post='$postsX' WHERE adminGroup = '$groupAd'";if(!mysql_query($sql, $link)){ die('Error: ' . mysql_error()); }mysql_close($link);?>
  21. Yeah i got php set up and everything just would like something to search for like a keyword or something to help. I'm pretty new to all this is all :S ty
  22. So how would I go about this. I have used htaccess and pw but I don't want it to protect the whole website just certain pages that I choose. Is this still possible to do that with ht?ty
  23. So i can remember ages and ages ago I had a page that could have a form and on submit the form would send an email to myself with the details. Now when I try to recreate this all it does is open the users default mail program. Am i mistaken or can you get it to send an email immediately from the website without using php etc. ty
  24. Just wondering if this is secure or not to leave on a web page. Not really sure how security and things like passwords on sites work/are protected so any info would be great thanks... <script type="text/javascript">var password;var pass1 = "password"; // place password herepassword=prompt("Please enter your password:","");if (password==pass1) {window.location= "correct.html"; // file to open if password is correct} else {window.location= "wrong.html"; // file to load if password is incorrect}</script> ty
×
×
  • Create New...