Jump to content

JustGotAQuestion

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by JustGotAQuestion

  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.
  16. So i was wondering what method, of the two i am about to describe, is the best for making rollovers, and why. 1. This is the way i do it <img src="img.gif" onmouseover="src='img_over.gif'" onmouseout="src='img.gif'" /> 2. This is more complicated, but i'm wondering if its better I can't actually do it, but its the javascript method that dreamweaver does for you. I think it preloads the images and then "swaps" them or something. Please make sure to include why one is better. I like my way because its simple, but is it worse in any way?
  17. Breakthrough: I finally got it. I wish i had known this years ago... All i had to do was <img src="/images/img.gif" />. Thats it...now it works from anywhere. This is amazing, thanks quiettech!
  18. I'm going to kill myself, this is ridiculous. Ok...let me explain exactly what i'm doing. here are the files: www.site.com/index.php (include 'template/header.php') www.site.com/test/test.php (include '../template/header.php') www.site.com/tempate/header.php (<img src="./images/img.gif" />) www.site.com/images/img.gif Ok, so i explained, very simply, what is going on in each file. Why doesn't the image show up in both files (index.php and test.php) where header.php is being included? I think its because the directory is wrong. Did i use the ./ wrong in the img src? I am using this example to demonstrate how the files will be all over calling the same header file which needs to be able to link to the image.
  19. Haha, alright well i still don't fully understand, but i'm going to "just do it" and see what happens.
  20. Ok, but if i were to use that method, then i couldn't have the ../../ or ./ paths in a header or footer file which is called from other files. The reason being that the "other files" will be in different places. Right? I can only use ../../ or ./ if i know exactly where the image is because then i can count back directories and add the right amount of ../'s. If i don't know where the file is (like if its everywhere since i am including the header and footer everywhere) then i can't use that way. These are my thoughts, i'm no expert. What am i missing?
  21. As a side note, how does phpnuke or phpbb do this? They have images everywhere and files grabbing images from every place imaginable. They dont go through and change every link so that it has the right amount of ././ in it, do they?
  22. Oh wow. I was thinking too complicated. So if i just add the whole url (http://www.etc.com/images/img.gif) it will link correctly from anywhere. Thanks for helping me figure this out.
  23. But isnt there something i can do like $_SERVER or something to find the root of the site, and then do /images/img.gif? So like: $root = $_SERVER_ROOT (or whatever the command is) <img src="$root/images/img.gif" /> So no matter where this image is being called from, it will find the root, find the images folder, find the image. Would this work? Is there a command for something like this? Is there a better way to do it?
  24. So say i have some template images in site_root/images. I have a template header page and a template footer page which basically grab images and make them form the template. Whenever i want to make a new page, i write the content, include the template header up top, and include the footer down below. But, this page i just made could be anywhere. So, i want the template header/footer's images to be linked so that no matter where the page is created, it will find the site_root/images folder to grab the images. Kind of confusing. First, am i being clear enough? Second, can anyone help?
  25. Perfect. I knew basically what needed to happen, but i didn't know the syntax. Thanks.
×
×
  • 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.