Jump to content

kristofferlc

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by kristofferlc

  1. You sure it has to be `pd_size` = '$size' and not `pd_size` < '$size' or something?
  2. You forgot a " in one part off your code... ...//My Class if ($response=="Success") { $query = ("INSERT INTO *table*......."); } Anyway i dont ee what the problem should be... :-\
  3. I'm currently on a laptop, and have no problem with the chinese flag, i get the page in chinese when i click it. (Not that i understand chinese ) Your sure the labtops supports chinese right? I cant realy help that much when i cent see the problem, sorry. :S
  4. i'm not a master with the .htaccess files coding, but i belive if you add "deny from all" to your .htaccess file, and then make a php page for the 405 error code, also defined by the htaccess file, you can then redirect in the 405 file... So, add this to your htaccess deny from all ErrorDocument 405 http://domain.com/my405.php Then ake the 405 php file redirect...
  5. I'm very sorry, but i've got to go now. If you have made a connection and all that, this code should work: <style type="text/css"> <!-- .style9 {font-size: 46px} --> </style> <?php $query = mysql_query("SELECT deathreason FROM users WHERE username=$username"); $rows = mysql_fetch_assoc($query); ?> <div align="center"><b><br><br><br><br><br><br><br><br><br> <span class="style9">You have been killed!</span></b></div> <div align="center"><b><br><br><br> <span class="style9">Reason:</span></b></div> <div align="center"><b><br><br><br> <span class="style9"><?php echo $rows['reason'];?></span></b></div> If you haven't made connection, try it. And if it still fails for you, try replacing mysql_fwtch_assoc($query) with mysql_fetch_row($query), and echo $rows[0]; instead. If this still doesn't help, i'll be back in like 9 hours, and will try helping you there. (Unless someone else helped you. ) Good luck, and sorry i had to go. :-/ (Maybe even try echo mysql_result($query);
  6. allso, you might want to put some single quotes around your $username array in your query, just for stability with a space or something.
  7. Sorry for slow response. Okay, are you sure you've been making a connection to the database before your query? And selected database? Like: $connection = mysql_pconnect($hostname, $username, $password); mysql_select_db($database, $connection); $query = mysql_query("SELECT deathreason FROM users WHERE username=$username", $connection); $rows = mysql_fetch_assoc($query); And make sure to remember the " ; " after each code line, i see i forgot it in my first post at the $rows var.
  8. <style type="text/css"> <!-- .style9 {font-size: 46px} --> </style> <?php $query = mysql_query("SELECT deathreason FROM users WHERE username=$username"); $rows = mysql_fetch_assoc($query) ?> <div align="center"><b><br><br><br><br><br><br><br><br><br> <span class="style9">You have been killed!</span></b></div> <div align="center"><b><br><br><br> <span class="style9">Reason:</span></b></div> <div align="center"><b><br><br><br> <span class="style9"><?php echo $rows['reason'];?></span></b></div> That should work, you need to make the rows array.
  9. Yes! Made it work! Thanks allot. Final query looks like this: SELECT * , IF( ean1 = '9123864558', eanP1, IF( ean2 = '9123864558', eanP2 ,null) ) AS sortcolumn FROM vare_a WHERE (`ean1` = 9123864558 OR `ean2` = 9123864558) ORDER BY sortcolumn Thanks Mchl.
  10. Okay, it looks like something i could use, but i tried using it in my test table like this: SELECT * , IF( ean1 = '9123864558', ean1P, IF( ean2 = '9123864558', ean2P ) ) AS sortcolumn FROM TABLE ORDER BY sortcolumn but got an error back looking like this: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')) AS sortcolumn FROM table ORDER BY sortcolumn' at line 3 It looks like the solution i'd want, but cant say for sure before i've seen it work. :-/ And thanks for helping by the way.
  11. In the example data i made in my first post i would like it to sort after col1A in the first and third row, since col1 = good_val, and in row 2 i'd like it to sort after col2A since the col2 = good_val... I was thinking maybe i should join the cols in some way? i just don't know how... :S Hope you can follow me, if not i'l try explaining in an other way...
  12. I have a little problem with making the table i'm working with work as indented. I have 15 colons split like this col1, col1A, col1B, col2, col2A, col2B, and so on, till col5B. Now, if i have three rows looking like this: row one: col1 = good_val, col1A = xx, col2 = bad_val, col2A = xx... row two: col1 = bad_val, col1A = xx, col2 = good_val, col2A = xx... row one: col1 = good_val, col1A = xx, col2 = bad_val, col2A = xx ... Now i need the output of my query to do something like [ORDER BY `col1A` IF `col1` = "good_val" OR `col2A` IF `col2` = "good_val"] basically i need the query to order by different colons if some other colons have the right value... That's where i get stuck, i don't really know how to do this the smartest way. Anyone have any good suggestions on how to do it properly? Any help or suggestions would be great, thanks.
  13. If you still want to "hide" your files that you dont want people to see, make your 404 document redirect to a 404 file, like your .htaccess file directs to 404.php wich redirects to 404.html... Then on the password protected pages, redirect to the 404.html file as well? (or 404.php, if you have any intrest of that.)
  14. FINALY!! I made it work. In my query i was using a session identify what ID's to get, and i had not included the session_start() function. :S Sorry for making this stupid error, and thanks alot for all the help i got from you KingPhilip.
  15. I know i made that error, ID is the right one to use, but i still get nothing while trying to make the loop... The code you just gave didnt return anything... But i think i'm calling the query in a wrong way, i cant make it repeat the ID value... Hold on please. A litle more testing, i think i'm on a clue now... And again thanks for giving your self time to help me with this.
  16. Okay, getting something now, but still not a solution. Now i call the loop like this: do { $tmp = $row_butikker['ID']; if(isset($_POST[$tmp])) { echo $_POST[$tmp].'<br>'; } else { echo 'Failed on: '.$tmp.'<br>'; } echo $row_butikker['ID'].'<br><br>'; } while ($row_butikker = mysql_fetch_assoc($butikker)); echo '<pre>'; print_r($_POST); echo '</pre>'; And gets this in return: So i'm guessing something's wrong with my call of the loop, since it fails to show the $tmp value anyhow... I call the database the same way in the form script and the loop script... (And database data is static as it is now, i'm only running in test stages.)
  17. Okay, i've got something now... I tried with the simple loop, and ran your code trough it: if($_POST) { $i=1; while($i<=5) { if(isset($_POST[$i])) { echo $_POST[$i]; } else { echo "Failed on $i<br />"; } $i++; } echo '<pre>'; print_r($_POST); echo '</pre>'; } And i got this out of it (marking box 2 and 3): Failed on 1 2 3 Failed on 4 Failed on 5 Array ( [2] => 2 [3] => 3 [button] => Submit ) I'll work a bit on the database called array, hang on. (And thanks so far)
  18. Yes, the database values are the same as called, and while i tried echoing them with your script it didnt reyurn anything... It doesnt even return anything with this more simple loop: (Checkbox's with the name 1,2,3,4 and 5 are being used to check this, same value as name, if that matters....) $i = 0; while($i<=5) { $i++; if(isset($_POST[$i])) { echo $i; } } I get NOTHING in return from any of them... :S
  19. Browsers do have default 404 messages... Andi have an idea, if the password isnt set, redirect to a non-exsisting page, like this. header("Location: this/file/doesnt/exsist.php"); Or do you require the URL to stay the same?..
  20. Hi everyone, i've been working on a script where i have to call some defreind $_POST variables, names after ID´s in a database, verry much like in this topic: http://www.phpfreaks.com/forums/index.php/topic,261404.0.html I belive i'm calling the functions properly, and i know my query works, so i dont realy know why my server cant call the $_POST variables... My code looks somewhat like this: while ($row_categories = mysql_fetch_assoc($categories)) { $tmp = $row_categories['id']; if(isset($_POST["$tmp"])) { echo $_POST["$tmp"]; } } This isnt the only thing that wont work, i've tried with a normal while loop where i use $i = 0; and $i++;... So, my big problem is that the server returns "false" on the isset($_POST["$tmp"]); function... Does anyone have an idea why?...
  21. If you actually made your code work: <?php echo $a; ?> It's the very first time i've seen php being able to use a normal variable to answer to a GET value... But i would follow redarrow's surgetstion and use his code instead: <?php echo $_GET['a']; ?>
  22. Sorry, but that's when i'm awake, i live in europe, so...
  23. I'm verry sorry, but i have to leave for today, but i still hope to get some help. I'll be back tomorrow.
  24. The only error i've got so far is a 500 http error in the browser, witch only tells me that there sould be a programing error or that the page is under an update... I dont know if there's some other error i can make it show with a "get_error()" function or something like that, i'm not a super php programer... :-\
×
×
  • 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.