Jump to content

whatabrother

Members
  • Posts

    17
  • Joined

  • Last visited

whatabrother's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. whatabrother

    Help me!

    If you want to completely replace the image with another image the this code should work: <?php$oldfile = "";$newfile = "";if (file_exists($oldfile)) { unlink($oldfile); }$url = parse_url($oldfile);rename($newfile,$url[path]);?> Otherwise, I'm not sure I understand what you want.
  2. I got it now. <script /> should actually be <script></script>
  3. I thought this was an HTML problem, but when I took out the <script> tag the page loaded fine. So unless my mistake is in the script tag then the mistake must be in my javascript. Here is the javascript code:function change_theme() { if (document.pic.src == "http://xxxxxxxxxx/toast/logo.jpg") { var b = "1"; } if (document.pic.src == "http://xxxxxxxxx/toast/1logo.jpg") { var b = "2"; } if (document.pic.src == "http://xxxxxxxx/toast/2logo.jpg") { var b = "3"; } if (document.pic.src == "http://xxxxxxx/toast/3logo.jpg") { var b = "4"; } if (document.pic.src == "http://xxxxxx/toast/logo.jpg") { var b = "1"; } if (document.pic.src == "http://xxxxxx/toast/1logo.jpg") { var b = "2"; } if (document.pic.src == "http://xxxxx/toast/2logo.jpg") { var b = "3"; } if (document.pic.src == "http://xxxxx/toast/3logo.jpg") { var b = "4"; } if (b == "1") { document.pic.src = "http://xxxxxx/toast/1logo.jpg"; document.pic2.src = "http://vigilsreign.org/toast/1logo.jpg"; } if (b == "2") { document.pic.src = "http://xxxxx/toast/2logo.jpg"; document.pic2.src = "http://vigilsreign.org/toast/2logo.jpg"; } if (b == "4") { document.pic.src = "http://xxxxx/toast/logo.jpg"; document.pic2.src = "http://vigilsreign.org/toast/logo.jpg"; } if (b == "3") { document.pic.src = "http://xxxxx/toast/3logo.jpg"; document.pic2.src = "http://vigilsreign.org/toast/3logo.jpg"; } } The "X"s are where my domain name used to be.
  4. I created this page, and it is pretty basic, but i'm trying to get these images to work. In Firefox, everything is perfect. IE however just shows my black background and nothing else. All that is really supposed to show is two images. They both show in firefox, and neither of them show in IE.HTML File <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> site name </title> <link rel="stylesheet" type="text/css" href="firefox.css" /> <script src="firefox.jss" type="text/javascript" /> </head> <body> <img name="pic" alt="image" class="logo" src="logo.jpg" onclick="change_theme()" /> <img alt="image" name="pic2" class="foot" src="logo.jpg" /> </body></html> Stylesheet body { background-color:black; color:white; }img.logo { position:absolute; width:100%; top:0; left:0; }img.foot { position:absolute; top:80%; left:0; width:100%; } I don't see any problems in my code. If it is just an IE compatibility problem, I wouldn't know what that could be. It seems like an Image tag would be pretty simple. I really can't figure it out.
  5. Those are programmed in Java. One thing that people often get mixed up is Java and Javascript, when they are entirely different. If all you need is an upload form, php is probably the easiest way to go.
  6. There is no better PHP source than the manual at http://php.net.
  7. I bought some hosting a while back that didn't allow about 50% of the filesystem functions. I just assumed that this was the case. Still, I think the universal solution to his problem is to use a database.
  8. It is probably because your host doesn't support it, possibly for security reasons (I really don't know why for sure). Usually you would just use the ftp functions, but I think, for you, it would just be easier to use a database. It is really simple, and sooner or later you are going to need it anyways. W3schools has a good tutorial for it here. Also, it may be a good idea for you to learn something about content filtering (assuming that you havn't already), as you will probably want to do this. preg_replace() is a good function to filter with, and the PHP manual explains it pretty well here. To use that you will also probably need to a little bit about regular expressions. If that isn't helpful to you, than hopefully it can be for somebody else.
  9. Well I guess you learn something new everyday. Thanks for that.
  10. Yeah, that should work. About databases, that would be another way to do it, and i've done it that way before, but I don't know of a way to store more than 255 characters in a database, so for me it isn't the best way.
  11. All the information that you need is here at w3schools. The approach that I have taken to this in the past has been to use the require() function to call all the information out of a file in to the location that you want it in the text. Then to post the information in to that file, you will need to use some filesystem functions. A page that posts the text could look something like this:<?php if (!isset($_GET )) { if (file_exists("maintext.txt")) { $content = file_get_contents("maintext.txt"); } echo 'Please Insert text:<br><form action="thispage.php?page=yes" method="post"><textarea height="400" width="400" name="text">' . $content . '</textarea><br /><input type="submit" value="submit your text" /></form>'; } if (isset($_GET )) { if (!isset($_POST[text])) { echo "You must insert some text "; exit; } file_put_contents("maintext.txt",$_POST[text]); }?> Then to display the text: <html><body>This is the text that was posted:<br> <?php require "maintext.txt"; ?></body></html>
  12. Thanks a ton! The HTML DOM tutorial is what I needed> I am still having a little trouble though. What would be the best way to keep links visible as long as the mouse is over either the original link, or the dynamic links?
  13. I read the JavaScript tutorial here at w3schools.com, but it wasn't as detailed on this as I would have hoped. I want to create an animated menu where the menu categorizes links, and when you mouse over the category, it shows all the specific links. The tutorial gave an example using an image, and I believe what happened was that it changed the html link with document.b1.src = b_pink.gif. What it didn't do is tell why "b1" was used. It would be nice to know what other things can be changed other than the source. A little fooling around revealed that you can use other things than .src, like .width, and many other attributes. Also, is there a way to eliminate the tag completely upon MouseOut? I was thinking that maybe the best way of going about the menu I want, would be something like this: <a href='xxxx.xxx' onmouseover='mouseover()' OnMouseOut='mouseout()'> where mouseover() would return additional links with some css to place them right next to the original, and mouseout() would remove the links. Is this the wrong way of going about things? I really need some direction on the proper method of doing this. Thank you for any help that you can provide.
×
×
  • Create New...