Jump to content

JustGotAQuestion

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

JustGotAQuestion's Achievements

Member

Member (2/5)

0

Reputation

  1. What is the best way to round the corners of a div (or whatever i guess) that will work in all browsers? I don't want to have to use images.
  2. Ok, so i should hold off in slashing and unslashing the id's. Got it. And now that i think about it, the id adds itself, so i couldn't slash it even if i wanted too. No point in unslashing it. By the way, i got everything working with the slashes now. Thanks.
  3. Oh, cool. So stripslashes from the output, not the query. Now, why didn't you stripslashes from the id as well? (was there a reason or was that just "because"?)
  4. Heres a bit of a more specific question. Why doesn't this work? $sql_recentnews = stripslashes(mysql_query("SELECT * FROM news ORDER BY timestamp DESC LIMIT 0 , " . $rpp)); while($topic=mysql_fetch_array($sql_recentnews)){ echo "<li class='recent_news_li'><span class='recent_news_topic'><a href='news.php?page=viewtopic&id=" . $topic['id'] . "'>" . $topic['title'] . "</a></span>"; } I get this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/asdfdsa/public_html/testing123/index.php on line 69
  5. Ah, now I get what it does, thanks. And so i need to use mysql_real_escape_string instead of addslashes(); and stripslashes(); to get it back. Thanks again.
  6. Ok, so to be clear, the following is how i should do things from now on: $what_will_be_inserted = addslashes($_POST['asdf']); Then i can insert. And then to get it out again: $query = mysql(whatever); $what_will_be_gotten = mysql_real_escape_string($query); And this makes things safer?
  7. Why and when would I want to use addslashes()?
  8. Oh, wops. I was too quick to shrug off that one image idea...i didn't even think of the benefit. Thats much cleaner!
  9. Nice! So I'll play around with that for a while. Sounds like thats all I need to get started. Thanks.
  10. I want to make a page that calls 10 results from a database, one after another. I want page numbers at the bottom (if there are more than 10 results) so that clicking page [2] will give you the next 10 results. I know this has got to be a very common thing to do, so if you don't feel like explaining, can you link me to a good tutorial? Thanks
  11. Awesome, i didn't even think to use css... Here is what i've found: Pros: Eliminates clutter. Using an external stylesheet, i don't need to confuse myself by looking through lines of rollover code on my main page. Cons: Images take a second to load. Is there a way to preload the images AND use the css method?
  12. So heres what i have, basically (not exactly, but don't worry about that): <div style="float:left; height:25px;"> <p>Words</p> </div><img src="img.gif" border="0" height="25" /> <div> <p>Words</p> </div> In addition to this, there are some classes that tell things to snug up (margins:0 and padding:0 mostly). Now, in Mozilla, it does exactly what i want. The bottom of the first div+image is flush with the top of the second div. But, in IE, there is a gap. If i remove the image, it is flush in both. So this makes me think that explorer has a default something or other for images that creates this space. I tried setting the image's margin and padding to zero, but no luck. I did manage to fix it, but it broke something i need somewhere else, so i need another solution. Just FYI, the fix was floating the image right. Is there anything anyone can think of?
  13. Actually, floating it did the job exactly. And by the way, i was using just the div to keep things simple. In reality, the text is within a <p> and the div surrounds everything. Anyways, its working perfectly, so thanks.
  14. Awesome, this was the type of fix i was looking for. One thing though: i have noticed that floating works differently in IE and Firefox. I am not sure if it will in this case or not, but is there another solution that doesn't involve floating? If not, no worries. This works fine, thanks.
  15. I need to repeat an image on the x axis behind some text so that no matter how long the text is, the background with be exactly as long. The text will be called in by a database, so it is variable in length. But, i can't have the image run off past the text (my current problem). Here is that i have (doesn't work, runs off too far to the right). <div style="background-image:url(images/repeat.png); background-repeat:repeat-x;">Some text of variable length.</div> How can i limit the repeat to just where the text is? I can't just use width:whatever; because the text is variable in length.
×
×
  • 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.