Jump to content

xtopolis

Members
  • Posts

    1,422
  • Joined

Everything posted by xtopolis

  1. https is enforced by the server, not the webpage. This would be an apache or iis thing.
  2. If space isn't an issue, add another column? a column called deleted. Then in your query, select whatever WHERE DELETED='No'. The the 'deleted' ones, change it to yes? Or does that not satisfy what you're trying to do? We need more information in order to tell you what the best choice would be...
  3. Also, you need to set a floor for your article count. Obviously there won't be a 0 article, but you don't want a link that shows "Article 0" because of the counter. You can either set it to look to the max count of articles (which would be 50<->0<->1) or just say : if($a)== 0; display a greyed out link that isn't clickable, or nothing at all.
  4. Assign that file content to a variable, then set the div.innerHTML = that variable
  5. @corbin: I'm not the OP. I was offering basics for the OP.
  6. --edit-- nevermind, I didn't read "pagination"
  7. I did. Basic example, no database touching. Type whatever you want, it only echos. SimpleLogin zip: simplelogin.zip
  8. It depends how you store each version {english, spanish} of the content of the site. If the content is stored in a database with 2 columns, one for eng, one for span, then you may want to follow suite with the links. It really depends how your site is deployed, and what needs to be translated. Some people simply copy the site once complete and add it to a directory off the main site and translate it. ie: yoursite.com yoursite.com/es <-- contains main site, but then everything is translated. Depends mainly on how often your content is updated!
  9. Hi, Is there an easy way to populate php arrays with values like A-Z, or 0-9 without typing: <?php $alphabet = array('A','B','C','D'.....); ?> I thought I might have seen an example in someones' sig on here once , but I don't recall their UN. Thanks
  10. I don't know exactly what's wrong, but your verification method is not secure, nor a best practice. A guess would be that multiple rows are being returned and not in the order that would give you the right result. Suggestions: #1 !! - Do not store password values in the database. Store them as hashes (MD5, SHA, WHIRLPOOL), w/e. Check that the hash of the password you send matches one for a hash pw stored in the database. The username is ok to be sent as is though. #2 $sql = "SELECT COUNT(*) as numrows WHERE username='$user' AND password='$pass'"; $result = mysql_query($sql); $row=mysql_fetch_array($result); if($row['numrows'] != 1) { 0 or more than 1 match, DO NOT LOGIN }else{ 1 valid match! //ok to login } #3 Use POST instead of GET, escape the values for php (mysql_escape_real_string)[or possibly mysql_real_escape_string; I always get the words mixed up] if(isset($_POST['user']) && isset($_POST['pass'])){ $user = mysql_real_escape_string($_POST['user']); $pass = md5($_POST['pass']);
  11. They are using CSS and the pseudo class ":hover". You can look at their code to find an example......... simple you add css to elements, giving them pseudo classes. td { background-color: red; } td:hover { background-color: blue; } <td>Background color changes on mouseover.</td> Note, this example above probably won't work in IE. IE needs <a> tags in order to support the pseudo :hover I believe.
  12. The reason this happens is because it changes size by 1px when it applies the border. A quick fix is to set a height for input and input:hover. input { height: 18px; } input { height: 18px; border: 1px solid black; } You should note that the width is affected the same way. Also, I tried this in FF3 - IE tab, and the hover effect was not supported... fyi.
  13. Yes, I am *.66, which shows me just below User 6, making me assume I'm User 7 to others on the list. I think I misread rather, I read "sec", rather than "kb per sec". My mistake.
  14. It is easier to implement change. It also can present a more clear and organized way of thinking/programming from what I've seen (and done,limited). The question for 'us' that do not yet fully grasp it is, where can we learn and switch over from procedural to OOP. "Read this book" isn't always useful unfortunately.
  15. My result showed new host was faster than old host, but it was incorrect. I loaded the images faster from the old host by 1/4 | 1/3 less total time. If this is a trend, perhaps your made a labeling mistake? Otherwise, it's possible that one host caps their uploads, or it's due to congestion, or a number of other things.
  16. Set a javascript timer to update the <p> or w/e with the testimonial from an array of testimonials. Lookup: SetTimeout() function (or SetInterval()), and also, use the .innerHTML attribute. (document.getElementById("yourParagraph").innerHTML = "New testimonial"; SetTimeout("thisSameFunction()",10000); you have to work out how it selects which testimonial etc to show, and where they are pulled from.
  17. Perhaps he meant retrieving the X/Y coords of the image when clicked: Set the image as part of a form. <form action='' method=post> <input type="image" src="image.jpg" name="myImage" /> </form> On submit, your values you look for are: <?php $x = $_POST['myImage_x']; $y = $_POST['myImage_y']; ?> With that data, you could check the appropriate mysql column(s). Hope that helps.
  18. Hmm, sounds like a good idea actually thanks. I'm not used to abusing session vars Nice one, thanks.
  19. Hi, In order to keep a form from being resubmitted by pressing refresh, I tend to post the form, extract/manipulate the post vars, and then use a header redirect back to the same page in order to clear the post stuff and basically start with a 'fresh' version of the form. My question is: I would like to use this method, but also find a way to return an error/success message. This is possible using $_GET and attaching things to the url, but IMO that is rather messy, and I would like to avoid it. Are there alternatives to this to accomplish what I want? Sample code of what I currently do: <?php if(isset($_POST['name'])) { //do something with the form vals Header('Location: ' . $_SERVER['PHP_SELF']); } ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="text" name="name" /><input type="submit" value="Process" /> </form> Basically if I was inserting into a database, I would like it to have a message saying if it succeeded or failed, while still having the form not being able to just be resubmitted. (Even if I don't allow it to go through[dupes], I still want it to be handled this way).
  20. If <center>$g[2]</center> is your text that is displayed... that it seems to be a CSS problem... You're using an <ol> tag to contain the info, and then centering it. You should just use a <p> tag instead of the OL, and also apply the center to the p tag, not the actual text $g[2]. Otherwise, fix the margin & padding on your <ol> tag and that would probably fix it. Start with margin: 0; padding: 0;. Hope that helps.
  21. Or simply set one of them to checked to begin with. <input type="radio" name="num" value="1" checked="yes" />
  22. Just filter out the keywords, ie: "javascript:" "<script", AND replace the "<" ">" tags with their special equivs < >. Afaik you should be safe if you replace their <, > tags with the </> and display it. The best bet is to use the BBC method. Change all < and > tags to something, ie: [ and ]. Then do a replace for ALLOWED html, like the example below. Or just use </> <?php $_POST['text'] = "<b>Hi</b><script type='text/javascrip'>alert('haxor')</script>"; $_POST['text'] = str_replace(">","]",str_replace("<","[",$_POST['text'])); $_POST['text'] = str_replace("[b]","<b>",$_POST['text']); $_POST['text'] = str_replace("[/b]","</b>",$_POST['text']); echo $_POST['text']; ?> // Outputs Hi[script type=text/javascrip]alert('haxor')[/script] You also need to accomodate the inline javascript stuff. <a href="javascript:alert()">Link</a>, just a heads up.
  23. xtopolis

    the £ sign

    Try replacing the £ symbols with their ?unicode? equivalents: &#0163; Read THIS Or possibly change the page encoding(on some editors you can do this under Save As, others you have to find... but the encoding types are UTF-8,ANSI,Unicode..etc. Using UTF-8, I see an A with an ^ on it before the £. You could try saving it as ANSI. I'm not sure the best type of encoding, but I seem to use ANSI without trouble/complaint.
  24. This may be incomplete, but contains functions to get you started/ <script type="text/javascript"> function swapImage(arg) { var x = document.getElementById(arg); var y = x.options[x.selectedIndex].value); var z = document.getElementById("swapper"); z.src = y; } </script> <select name="list1" onchange=swapImage('list1')> <option value=image1.jpg>Picture 1</option> <option value=image2.jpg>Picture 2</option> </select> <img src="image3.jpg" id="swapper" />
×
×
  • 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.