Jump to content

elis

Members
  • Posts

    149
  • Joined

  • Last visited

    Never

Everything posted by elis

  1. Here's a snippet of my coding: [code] $position= $_POST['position']; $appc="SELECT * FROM tssettings"; $query=mysql_query($appc); $res=mysql_fetch_array($query); <select name=\"position\"><OPTION SELECTED name=\"position\" VALUE=\"Positions Available\">Positions Available</option>"; if(!$res[position_1_t]=="") {$command.="<option name=\"position\" value=\"$res[position_2_t]\">$res[position_1_t]</option>"; }else{$command.="";} if(!$res[position_2_t]=="") {$command.="<option name=\"position\" value=\"$res[position_2_t]\">$res[position_2_t]</option>"; }else{$command.="";} if(!$res[position_3_t]=="") {$command.="<option name=\"position\" value=\"$res[position_3_t]\">$res[position_3_t]</option>"; }else{command.="";} if(!$res[position_4_t]=="") {$command.="<option name=\"position\" value=\"$res[position_4_t]\">$res[position_4_t]</option>"; }else{$command.="";} if(!$res[position_5_t]=="") {$command.="<option name=\"position\" value=\"$res[position_5_t]\">$res[position_5_t]</option>"; }else{$command.="";} $output.="</select>";[/code] The problem is on submit, the values aren't being sent into the database. I know the values are being read correctly because "$res[name]" in the dropdown shows up, its just that it's not being submitted in. I think it may have something to do with the name of the form, I'm not certain though, a second pair of eyes would be extremely appreciated.
  2. Could you post your full code again in one block, I might be able to find your problem that way. And for html, are you using the echo function or a variable to output the html?
  3. [quote author=dgiberson link=topic=122836.msg507098#msg507098 date=1169059258] Are you using the GET/REQUEST or POST method? [/quote] You really should be able to edit posts after more than a few seconds o.0 Anyway: I was using the _GET function, but after tinkering I figured out my error. Thank you for your help though.
  4. There's absolutely no need for your childish condescending attitude, in any event I've fixed the problem using a variation of the eregi function.
  5. Yes, well I've tried that numerous times - it isn't working, hence why I came here.
  6. I'm not entirely sure how to explain my problem, but I'll try. I have the following code: [code]if(!$tid) accessDenied( );[/code] to prevent mysql attacks via the url: i.e. http://yoursite.net/thispage.php?tid="select  * from this_table" and it works except for when the single quotes are used i.e. http://yoursite.net/thispage.php?tid='select  * from this_table' and the databases are being selected and are accessible this way does anyone have any coding ideas that could prevent this?
  7. Nevermind. After some tinkering, I've solved it. I forgot to set permissions.
  8. I'm not sure what the problems, but I switched hosts recently, but I kept the exact same coding to my site - but for some reason  I'm now receiving "No database selected" as an error. [code]<?php $dbhost = 'localhost'; $dbuser = 'myusername'; $dbpass = 'mypassword'; $dbname = 'mydatabasename'; $mysql_access = mysql_connect($dbhost, $dbuser, $dbpass); mysql_select_db($dbname, $mysql_access);?>[/code] Does anyone see why I'm getting this error?
  9. ^ Ah, the 'by' was the problem as you said. Thank you all for your help. Now, it's finally working correctly.
  10. Same error again :( I guess I'll have to try again from scratch?
  11. I just tried that, I got the same error again.  :-[
  12. I keep getting the following error: [quote]Query send failedYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by,additional,sentdate,subject) VALUES ('','24,'Envi','','Jalee' at line 1[/quote] here's the code [code] $date = date('Y-m-d'); $send = "INSERT INTO report_user (id,ip,reported,rptmessage,by,additional,sentdate,subject) VALUES ('','$ip,'$_POST[reported]','$message','$userpenname','$add','$date','$sub')"; $sent = mysql_query($send) or die("Query send failed".mysql_error());[/code] I'm not sure what the problem is, I've looked at it a few times and I must be missing something...
  13. Ah, thank you. This worked out quite well.
  14. It seems that it would be simpler to create sessions for each user who signs up, and use the session variables to call up the user's specific information via mysql instead of using folders. That is if I'm understanding what you're trying to do?
  15. If you're referring to the page title then what needs to be done is: admin panel>>configuration>>site name and change the site name. PHPBB should then automatically change the page titles to match.
  16. I have the following code: [code]if($userpenname==($_POST['recip'])) {$output.="........."[/code] Problem is the 'if' function is only being carried if the character cases match exactly, is there a method to get the function to disregard capitalization?
  17. Thanks! That worked perfectly!
  18. My MYSQL table looks like this: [b]id  username  blocked[/b] 1         Bob             Jack 21         Bill               Bob 4              Bob                Jane The problem is, when I call up this table with [code]bresult = mysql_query("SELECT * FROM blocks WHERE username = '$recip'"); $cresult = mysql_fetch_array($bresult);[/code] Say, $recip = Bob, so the username [i]Bob[/i] is called up; and then I compare if with "IF...$userusername ==cresult[blocked]..." so that if a user is blocked by Bob, they can't contact him. The problem with this is, if you look at the table, Bob as two people blocked in two rows: Jane and Jack. So if Jack is trying to contact Bob, he's obviously blocked - but the MYSQL arrangment will read Jane as being blocked and let Jack contact Bob. (I'm sorry if this is getting confusing, I'm fairly poor at explaining things). So I need a method where the Select function will get the ID, since it's the only independent value, but I'm not sure how to go about this as I don't know what to put for "WHERE ________ = ___________" . (Or if anyone has any other ideas, they'd be much appreciated too.)
  19. Is there anyway to have multiple values in one field, and what would the seperator be? My Mysql table that I'm referencing is: ID - USERNAME - BLOCKED what I need is to be able to store more than one value in the same field on the same row, but be able to call it indvidually. I'm not even sure if this is possible currently this is my php code for the above table: [code]elseif ($userpenname ==''.$cresult[blocked].'') { $output.="<br><center><font color=red>.MESSAGE1.</center></font>"; }[/code]
  20. I tried changing the variables to what you suggested, but its still not blocking the request based on the "if" situation. 
  21. Thanks for your help I tried what you said, but I still have the same problem
  22. Here is the code snippet I'm having trouble with: [code]$recip= strtolower(mysql_escape_string(trim(strip_tags($_POST['recip'])))); $stringnew = nl2br(mysql_escape_string(trim(strip_tags($_POST['newmsg'])))); $stringnew = str_replace($banned,$edited,$stringnew); $stringnew = str_replace("'", "^", $stringnew); $qCheck = "select * from TB_Users where penname = '$recip' limit 1"; $rsCheck = mysql_query($qCheck)  or die(mysql_error()); $bresult = mysql_query("SELECT * FROM blocked_user WHERE username =  '$recip'"); $cresult =  mysql_fetch_array( $bresult ); $dresult = "SELECT * FROM blocked_user WHERE username =  '$recip'"; $eresult =  mysql_query( $bresult ); if (isset($_POST['newsent'])) { if ($eresult[blocked]==$userpenname) { $output.="<br><center><font color=red>MESSAGE2</center></font>"; } elseif (mysql_num_rows($rsCheck)==0) {$output.="<font color=red><center> - MESSAGE1</center>";} elseif ($recip==$userpenname) {$output.="<br><center><font color=red>MESSAGE3</center></font>";} [/code] The two specific areas that I need help with are: (full text in code) elseif....$recip==$userpenname and elseif...$eresult[blocked]==$userpenname ("$userpenname" is defined in another file - "$output" is similar to "echo") The problem is that "elseif...mysql_num_rows(rscheck)" is being correctly output, but the two I posted above are not printing. There is no error being reported. I assume there may be a mistake in the way I've selected the data, but I'm not sure. A second pair of eyes would really help. Thank you
×
×
  • 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.