Jump to content

htmlstig

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by htmlstig

  1. never mind iv added $title=""; before the while loop so that it resetes the variable to NULL. Many Thanks
  2. cheers joel that kind of works but......... is there a way of stopping adding to the variable as if i have 2 events on one day and 1 on the next day the second day is showing all 3 events as its still adding to the variable
  3. sorry if i have posted this in the wrong place, wasnt sure wether to post here or mysql. I have made a php calendar, and i am now wanting it to show if there is an event on that day and if so show it in a tool tip. the tool tip is populated by what is in the title="" of the link so i need my events to be shown in there. I have figured out how to show the event but now i am stuck on how to show all events if there is more than one one that day, how i have set it seems to only the second event, probably as the second variable overwrote the first variable. this is the code i have at the minute .............. $result = mysql_query("SELECT * FROM events WHERE day='$day_num' AND month='$fullmonth' AND year='$year'") or die(mysql_error()); $rows= mysql_num_rows($result); if ($rows !="false"){ while($rowout = mysql_fetch_array($result)) { $todayis = $rowout['day'] ."-". $rowout['month'] ."-". $rowout['year'] ."<br>"; $title= $rowout['event'] ."<br><br>";} $firstl = "<a href='' title='". $todayis . $title ."'>"; $lastl = "</a>";} else {$firstl = ""; $lastl = "";} then to display the day and links ................. <td><? echo $firstl; ?><? print $day_num; ?><? echo $lastl; ?></td> could some one be so kind and help me write it so that it displays all events? here is a link to the calendar, incase its needed. http://www.scripttesting.htmlstig.com/calendar/index.php Many thanks Carl
  4. not to worry iv figured it out i changed it to <form action="<?php echo $PHP_SELF; ?>" method="post"> <input name="sub" type="text">.htmlstig.com<br> <input name="" type="submit"> </form> <? $hostname = "".$_POST['sub'].".htmlstig.com"; $hosts = gethostbynamel($hostname); if (is_array($hosts)) { if (count($hosts) == 1){ echo "Sub Domain Taken"; } elseif (count($hosts) > 1){ echo "Sub Domain Available"; } } ?> thanks anyway
  5. hi all i found this script on the net that will check if a domain name exists or not by checking the domains IP <? $hostname = "htmlstig.com"; $hosts = gethostbynamel($hostname); if (is_array($hosts)) { echo "Host ".$hostname." resolves to:<br><br>"; foreach ($hosts as $ip) { echo "IP: ".$ip."<br>"; } } else { echo "Host ".$hostname." is not tied to any IP."; } ?> but i want to check subdomains of htmlstig.com instead so i modified it to <form action="<?php echo $PHP_SELF; ?>" method="post"> <input name="sub" type="text">.htmlstig.com<br> <input name="" type="submit"> </form> <? $hostname = "".$_POST['sub'].".htmlstig.com"; $hosts = gethostbynamel($hostname); if (is_array($hosts)) { echo "Host ".$hostname." resolves to:<br><br>"; foreach ($hosts as $ip) { echo "IP: ".$ip."<br>"; } } elseif ($hostname == ".htmlstig.com"){ echo "Enter Sub-Domain To Check"; } else { echo "Host ".$hostname." is not tied to any IP."; } ?> but i found that if the subdomain doesnt exist instead of returning a blank ip it returns 2 ips and if it does exist it returns 1 ip. now i have figured that out i want to modify it so that if it returns 2 ips it displays a messige and if it returns 1 ip it returns a different message. I presume i would use count() but dont know how to implement it. the script so far can be seen at http://htmlstig.com/availability.php hope someone can help. Cheers **EDIT** sorry i forgot to mention that for testing purposes support.htmlstig.com is a valid subdomain
  6. sorted cheers when the link wasnt first or last it worked so i will have to make sure it adds a space at the begining and end of the message before it sends to the database
  7. i havnt done it both at same time they are both ways i have tried it I would disagree, either way the processing is there. But storing it in it's raw form allows for any type of manipulation. That is just my 2cents though. Do it when it is coming out of the DB. Not going in. @OP, why it does not work I do not know, could be that you were double using it/using it wrong. It could also be that you put the link at the end IE: "This text link will not be processed http://www.link.com" because there is no ending space, as the regex uses the space to determine the end of a link. How to avoid this, I am not sure. You can always just append a space to the comment variable and that would solve that issue. Same if the link is at the beginning of the string. Like I said, not perfect yeah the links i tried were first and last ill try it again so that the links arnt first or last
  8. for some reason it didnt work i tried it before it sends to database and when getting it from database ... this is how i had it before sending to database //get details from submitted form $name=$_POST['name']; $email=$_POST['email']; $website=$_POST['website']; $comment=$_POST['comment']; //remove any html,php,javascript e.t.c from comment $comment = trim($comment); $comment = strip_tags($comment); //convert urls to links $replace = array('~\shttp://(.+?)\s~', '~\swww\.(.+?)\s~'); $replaceWith = array(' <a href="http://$1">http://$1</a> ', ' <a href="http://www.$1">www.$1</a> '); $comment = preg_replace($replace, $replaceWith, $comment); getting from database <?php $comment = $row['comment']; $replace = array('~\shttp://(.+?)\s~', '~\swww\.(.+?)\s~'); $replaceWith = array(' <a href="http://$1">$1</a> ', ' <a href="http://$1">$1</a> '); $comment = preg_replace($replace, $replaceWith, $comment); ?> then where i wanted the comment i put <? echo $comment; ?>
  9. its because you have an else followed by an else .... if you find else { ?> <a href="signmeup.php>"><img src="../images/signmeup.gif" border="0"></a> Sign up or Register to be able to contact us.<br><br> and change else to elseif ($_SESSION['Name'] ="")
  10. you need to add <? before $sqlcomments = "SELECT * from buyercomments where Status=1 and BuyerID=".$_REQUEST['BuyerID']. " order by AddedDate desc"; $resultcomments= mysql_query($sqlcomments); if (@mysql_num_rows($resultcomments)!=0){
  11. hi i have made a simple guestbook and before it sends the message to the database i have used trim($comment) and strip_tags($comment) so that it removes all php,html etc coding as the spammers were all using html for their links instead of just starting http:// the downside to that is that people can no longer post links so i was wondering is it possible to use php so where ever someone starts with http:// or www it converts that url to a link? if so how? cheers
  12. hi all sorry if this is in wrong place. i am making a simple knowledge base script and i have basicly got it working how i want it im just trying to make it "look" better now. on the main kb page i have a list of all categories with a little sub title underneath them, i have them going down in a list. does anyone know how i could get it to show in 2 collums? this is the code im using at the moment <?php include "admin/config.php"; $result = mysql_query("SELECT * FROM faqcategories ORDER BY category") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { print "<tr> <td width=\"30\" valign=\"middle\"><img src=\"images/notepad.png\" width=\"23\" height=\"18\" /></td> <td valign=\"bottom\"><li class=\"category\"><strong><a href=\"sub.php?category_id=$row[id]&cat_name=$row[category]\">$row[category]</a></strong><br><span class=\"sub\">$row[sub]</span></li></td> </tr>"; } mysql_close($link); ?> the admin/config.php has the connections to mysql so they arnt needed in the code. cheers
  13. have you gave the div that the image is in an auto height? that will make the div stretch to whatever is in it.
  14. change the % to something smaller or larger then depending where you want it or you could change the % to a px
  15. you need to seporate the classes with a comma not a space. If you seporate it with a space its telling it to style a class within a class. so for what you want you could put .name1, .name2, .name3 { css: code here; } Or why not make it even simpler like Mchl said and give them all the same class
  16. are you talking about the sand images? if so and you would just like something similar down one side you can just set your image as a background and set it to repeat verticaly. body { background: url(link to image.gif) repeat-y; } or if you dont want the background to scroll put body { background: url(link to image.gif) repeat-y fixed; }
  17. if you are putting position: absolute; on a div you have to put position:relative; on the containing div otherwise the absolute doesnt work. I dont know why you have to do this, all i know is that i had this problem when i was learning css and that was the solution i found.
  18. he said he doesnt want to repeat the image he wants it full size
  19. without using layers for each table you could use a css3 code background-size: 100%; but not all browsers are css3 compatible yet
  20. if you have acess to a .htaccess file you could add AddType audio/x-mp3 mp3 to it not sure if it would force a window for the embeded mp3s or not
  21. in your css for the footer you need to put position: relative; that should hopefuly do it
  22. i know if you dont supply something in css its supposed to be used as zero, but i have found that if i dont put padding:0; when i want it to be 0 different browsers have different paddings, what browsers have you tried to view it in? also have you tried putting padding:0;?
  23. whats your css for <ul id="nav"> ?
  24. whats the css for .post? do you have any margins set for it?
×
×
  • 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.