Jump to content

Niixie

Members
  • Posts

    108
  • Joined

  • Last visited

    Never

About Niixie

  • Birthday 03/17/1995

Profile Information

  • Gender
    Male
  • Location
    Denmark

Niixie's Achievements

Member

Member (2/5)

0

Reputation

  1. Try the following: <html> <head> <title>corners in running</title> </head> <body> <form method="post" action="<?php echo $PHP_SELF."?post";?>"> Corners:<br /> 10:<input type="radio" value="10" name="wholecorners"> 11:<input type="radio" value="11" name="wholecorners"><br /> <input type="submit" value="submit" name="submit"> </form> <?php if($_POST['submit'] && isset($_GET['post'])) { $corners = $_POST["wholecorners"]; if($corners>=10 && $corners<=10.99) {header('Location: http://maidenerleghweather.com/corners1.php?var1=' . $corners. '&var2='.$time ); } if($corners>=11 && $corners<=11.99) {header('Location: http://maidenerleghweather.com/corners2.php?var1=' . $corners. '&var2='.$time ); } } ?> Code is not tested! It should, if i remember right, only redirect you if the submit button has been activated, and extra secure by setting a ?post in the URL.
  2. Can a missing doctype really change the look in only two browsers?
  3. Hey PHPFreaks. I know that theres some special rules needed to make IE output look 100% as expected, mine doesn't. I have a little problem. Easiest way, www.ksites.sonderhede.dk . When opened in IE or Opera, it looks all wrong? - Thanks in advance.
  4. In the function prologin() you use the login function to validate if the user exists (fine). In the login() function you do not return any value thats useable for the prologin() function. Try returning 0 or 1 in the login() function, if the user exists or not.
  5. Can you send your full code with database connection and query, it'll be easier to picture what happens then.
  6. The system should return the value thats equal to the value from the database?
  7. This is my function as it is now, when i changed it for about 15 minutes ago. public function system($select) { Connection::Open(); $q = "select $select from system"; $result = mysql_query($q) or die(mysql_error()); if(!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $q; die($message); } while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo $row[$select]; } Connection::Close(); } Still problematic.
  8. If you look at picture proof 1 in the very first post, then you can see that the numbers returns first 2 then 1. And the last problem i wrote, about nothing returning, is because of the function system that does not return anything, or it doesn't return the correct thing.
  9. I am in no doubt that your code may be faster, or better than mine but it does not really help when i have absolutely no idea of whats going on in the code?
  10. I found out that the returning number "1" is caused by the function mysql::system that i made; Old code ... Its the "return 1;" part, i need to replace the "mysql_fetch_row" with something else, what could handle it? EDIT: My fault, the function did not cause the number "1". For some reason it does not return anything when i changed the system function code? New code: Connection::Open(); $q = "select $select from system"; $result = mysql_query($q) or die(mysql_error()); if(!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $q; die($message); } while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo $row[$select]; } Connection::Close();
  11. The hole code of my function is this: public function load_trades($sort) { Connection::Open(); if($sort == "*") { $q = "select * from itrades where active=1"; $result = mysql_query($q) or die(mysql_error()); if(!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $q; die($message); } echo '<table class="area" border="0"> <thead> <tr> <th>Annonce</th> <th>Dato</th> <th colspan="2">Opretter</th> <th>Læst</th> <th>Besvaret</th> </tr> </thead> <tbody>'; while($array = mysql_fetch_assoc($result)) { echo ' <tr> <td class="headline"><a href=trade.php?show='.$array['tradeid'].'>'.$array['headline'].'</a></td> <td class="date">'.$array['date'].'</td> <td class="picture"><a href="profile.php?show='.$array['itraderid'].'"><img src="images/profile/'.user::get_picture(user::get_email($array['itraderid'])).'" width="33" height="32"/></a></td> <td class="name"><a href="profile.php?show='.$array['itraderid'].'">'.user::get_name(user::get_email($array['itraderid'])).'</a></td> <td class="read">'.$array['read'].'</td> <td class="counter">'.itrade::count_messages($array['tradeid']).'</td> </tr> '; } echo '</tbody> </table>'; } else if($sort !== "*" && is_numeric($sort)) { $q = "SELECT * FROM itrades WHERE active = 1 ORDER BY RAND() LIMIT $sort"; $result = mysql_query($q) or die(mysql_error()); if(!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $q; die($message); } echo '<h3>Kørende I-Trades</h3> <dl class="list1">'; while($array = mysql_fetch_assoc($result)) { echo ' <dt>'.user::get_name(user::get_email($array['itraderid'])).'</dt> <dd> <p><i>'.$array['date'].'</i><br /><strong>'.$array['headline'].'</strong><br />'.$array['shortdis'].'</p> <a href="trade.php?show='.$array['tradeid'].'" class="link1">Se Trade</a> </dd>'; } echo '</dl>'; } mysql_free_result($result); return 1; Connection::Close(); } But it only counts from the else if part.
  12. Hello PHP people. I have a problem with my php function, which i hope is a small problem. When i get the result of my function, the numbers "1" and "2" appear, the number "2" above the area, and the number "1" under the area. Picture proof. What i don't get, is where the numbers are coming from, because when i check the database, there is only one row with the numbers "1" and "2", but the numbers appear no matter which row i return. Heres a piece of my code, I hope that you can see the problem somewhere? $q = "SELECT * FROM itrades WHERE active = 1 ORDER BY RAND() LIMIT $sort"; $result = mysql_query($q) or die(mysql_error()); if(!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $q; die($message); } echo '<h3>Kørende I-Trades</h3> <dl class="list1">'; while($array = mysql_fetch_assoc($result)) { echo ' <dt>'.user::get_name(user::get_email($array['itraderid'])).'</dt> <dd> <p><i>'.$array['date'].'</i><br /><strong>'.$array['headline'].'</strong><br />'.$array['shortdis'].'</p> <a href="#" class="link1">Se Trade</a> </dd>'; } echo '</dl>'; And, if you're wondering, then the numbers appear before and after the function result. Picture proof. Thanks in advance! Niixie
  13. i ran this code UPDATE `itrades` SET `shortdis`="æøå" WHERE `tradeid` = 2; but still the same errors?
  14. I set all tables in the database to utf8_danish_ci, manually, still nothing. I have this in all the pages that has the <head> tags; <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> Nothings wrong there, as i can see?
  15. I tried them both now, none of them fixes the problem? :s
×
×
  • 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.