Jump to content

Hellusius

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Everything posted by Hellusius

  1. I made a CSS class [CODE].backgroundlayer  {                   height: 100%;                   width: 800;                   background-color: #EFDFC9;                   margin: 0px 0px 0px 0px;                   padding: 0px 0px 0px 0px;                   text-align: center;                   text-vertical-align: top;                   }[/CODE] And all other site content is within this table class, but the align doesn't seem to work. Am I doign something wrong?
  2. didn't think of that one, thanks for the header, and [code]function hello ($amount=20) {   for ($i = 0; $i <= $amount; $i++)   echo $i . "<br />\n"; } ?> <?php hello(); ?> [/code] is shorter ^_^
  3. well, I just wanted to echo the number 0 to 20 since the function has to play itself from 0 to 20 right, so I thought, if'd take varb "i" I would be safe
  4. I know this has no real relevance, but I would like to ask why this does not work. I wanted to echo each number from 0 to 20 [code]<?php function hello ($amount=25) {   for ($i = 0; $i < $amount; $i++)   return $i; } ?> <?php echo (hello($i)); ?>[/code]
  5. think I got it, you wrote "of" instead of "or" Edit: got some result :D [code]Rows  1 Row length ø 20 Row size  ø 2,068 Bytes Next Autoindex 2 Creation Sep 02, 2006 at 12:49 AM Last update Sep 02, 2006 at 10:00 PM Last check Sep 02, 2006 at 06:49 PM[/code]
  6. now I get an error on the line [code]mysql_select_db($db_name) or die(" Error selecting database: ". mysql_error()); // any problems?[/code] which is [code]Parse error: syntax error, unexpected T_STRING in /home/www/warnicro.awardspace.com/postit.html on line 16[/code]
  7. bumped into a new problem now [code]<?php if (isset($_POST['submit'])) {   // collect data sent from form but ONLY if it was submitted   $name = $_POST['name'];   $age = $_POST['age'];   $sex = $_POST['sex'];   // connection variables   $host = "******"; // almost inavariably   $db_name = "details";   $db_user = "******";   $db_pass = "******";   $db_table = "details";   // connect to host and select db   mysql_connect($host, $db_user, $db_pass);   mysql_select_db($db_name);   // create and execute the query to insert data   $query = "INSERT INTO $db_table (id, name, age, sex) VALUES ('', '$name' , '$age' , '$sex')";   $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); // in case it bombs ?> <center> <table width="500" bgcolor="000000" cellspacing="0" cellpadding="0" align="center">   <tr>     <td> <font color="1055AA" size="3">Infromation has been added, <a href="/index.php">click here</a> to return to the homepage</font>     </td>   </tr> </table> </center> <?php } else { ?> <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method = "post"> Enter your name: <br /> <input type = "text" size = "40" name = "name" /><br /> Enter your age: <br /> <input type = "text" size = "3" name = "age" /><br /> Enter your sex: <br /> <input type = "text" size = "1" name = "sex" /><br /><br /> <input type = "submit" name = "submit" value = "Add Data" /> </form> <?php } ?>[/code] it gave me this error [quote]Error: No database selected with query INSERT INTO details (id, name, age, sex) VALUES ('', 'test' , '00' , 'v')[/quote] I know its something with that line, but I can't see what, any help is very much appreciated
  8. You can't really code html, since you cannot store them into what you can call a "variable" in CSS you can via classes, which you can use over and over again =)
  9. ok that made sense, starting to understand. anyway, I get a blanco page, but how can I see if anything is added to the database?
  10. Oops  :-[, sorry I did that, thank you for editing it, going to try the code now. P.S, hope you don't mind me asking, but what is the thing <?php } ?> on the bottom for?
  11. I made a database with a few things, just to take a peak at how things work, but I already stranded, I made a database, which I connected to and I made a few forms so you can insert a row into the database, this is the coding [code]<form action = "/postit.html" method = "post"> Enter your name: <br /> <input type = "text" size = "40" name = "name" /><br /> Enter your age: <br /> <input type = "text" size = "3" name = "age" /><br /> Enter your sex: <br /> <input type = "text" size = "1" name = "sex" /><br /><br /> <input type = "submit" value = "Add Data" /> </form> <?php // collect data sent from form $name = $_POST['name']; $age = $_POST['age']; $sex = $_POST['sex']; // connection variables $host = "*****"; // almost inavariably $db_name = "*****"; $db_user = "*****"; $db_pass = "*****"; $db_table = "details"; // connect to host and select db mysql_connect($host, $db_user, $db_pass); mysql_select_db($db_name); // create and execute the query to insert data $query = "INSERT INTO $db_table (id, name, age, sex) VALUES ('', '$name' , '$age' , '$sex')"; $result = mysql_query($query); ?>[/code] Did I forget something, cause nothing is being added to the database in my oppinion
  12. That works, Thank you very very much :)
  13. thank you. with that solved I bumped into another problem which is I want them to sum up but instead the are placed behind one another so the answer is 15315 while it should be 168
  14. I am trying to sum two variables, but it gives me the following error [code]Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/www/warnicro.awardspace.com/stats.php on line 3[/code] The php code is [code]<? echo "<font color=\"#EFDFA0\">Statistics<br />; $count = file_get_contents("count.txt"); $count2 = file_get_contents("count2.txt"); echo "<font color=\"#EFDFA0\">Homepage views: ".trim($count); echo "<font color=\"#EFDFA0\">Total page view: ".trim($count) + ($count2); ?>  [/code] Anyone see what I am doing wrong?
  15. Hellusius

    How to...

    I want to start learning how to use databases on sites, cause I can make them via "myphpadmin" page but I really have no clue how to use it really, like for instance how to make a register page to my site so people can register and etc. Now my question is, what is the best place to start reading about it, I know HTML properly, CSS more than enough, Javascript till certain extent, and very limited php.
  16. I still have not figured it out, I asked a few other people I whom know a bit of PhP as well, but they didn't have a clue either, anymore suggestions are welcome =).
  17. Doesn't change a thing, sadly :(
  18. well I don't have an email on my server and I don't get the second things, which line do I exactly need to change?
  19. I looked up some code for a mailing page, so people can instant mail to the contact mail of the website, but it does not really work. so far I got [code]<? if ($_POST["email"]<>'') { $ToEmail = 'harold_break@hotmail.com'; $EmailSubject = 'Contact us'; $mailheader = "From: ".$_POST["email"]."\r\n"; $mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; $mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; $MESSAGE_BODY = "Name: ".$_POST["name"]."<br>"; $MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>"; $MESSAGE_BODY .= "Comment: ".nl2br($_POST["comment"])."<br>"; mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); ?> Your message was sent <? } else { ?> <form action="contactus.php" method="post"> <table width="400" border="0" cellspacing="2" cellpadding="0"> <tr> <td width="29%" class="bodytext">Your name:</td> <td width="71%"><input name="name" type="text" id="name" size="32"></td> </tr> <tr> <td class="bodytext">Email address:</td> <td><input name="email" type="text" id="email" size="32"></td> </tr> <tr> <td class="bodytext">Comment:</td> <td><textarea name="comment" cols="45" rows="6" id="comment" class="bodytext"></textarea></td> </tr> <tr> <td class="bodytext">&nbsp;</td> <td align="left" valign="top"><input type="submit" name="Submit" value="Send"></td> </tr> </table> </form> <? }; ?>[/code] I can send the mails, but they do not arrive into the mail, is there something I am doing wrong? thanks for your time
  20. That worked btw, thank you :)
  21. I made this little script in the head [code]< script language="JavaScript"> <!-- Page counter var Count=20; Function increaser( ) { onload="Count= Count + 1"; } page counter --> < /script>[/code] and this little document.write in the body part [code]< script language="JavaScript"> document.write("Total page views: " + Count + "<br />"); < /script>[/code] but nothing is being displayed, when I only do the text, it does but whenever I add the variable it doesn't anymore
  22. I can't post my problem on here, everytime it gives me an error
  23. It worked so far, but now I am thinking of making a thing that if next is pressed at the last picture it will continu on the first picture again. any idea's on this?
  24. going to check that tommorow, thanks for the suggestions already =)
  25. I am making a slideshow Script: (in head of file) [code]<script language=javascript> <!-- Slideshow script var slide = new Array("TR(trailer)0.jpg","TR(trailer)1.jpg","TR(trailer)2.jpg","TR(trailer)3.jpg","TR(trailer)4.jpg") var presentSlide=0 function previous( ) {    if (document.images && presentSlide > 0) {        presentSlide = presentSlide -1        document.slideshow.src=slide[presentSlide]       }      }  function next( ) {    if (document.images && presentSlide < 4) {        presentSlide = presentSlide +1        document.slideshow.src=slide[presentSlide]       }      }    // End Slideshow script --> </script>[/code] and html: [code]<table width="1000" align="center">   <tr>     <td> <font color="#BF5500" size="4">The Return's Slideshow</font> <img src="tropic.jpg" name="slideshow"><p> <size="4"> <a href =  javascript:previous( ) > Previous</A>  <a href =  javascript:next( ) > Next</A>     </td>   </tr> </table>[/code] Does for some apperent reason not work, the screenshots are not even displayed even though they are uploaded on the ftp. suggestions on this issue would be muxh appreciated, thanks in advance =)
×
×
  • 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.