Jump to content

phpmo

Members
  • Posts

    33
  • Joined

  • Last visited

    Never

Everything posted by phpmo

  1. I'm having trouble with a select statement. I've got a table where if have a sender and owner field. I then have a deleteowner and deletesender field. THey are 0=NO and 1=YES I want to write a statement that says. select * from table where owner=$idfield and deleteowner = 0 and sender=$idfield and deletesender=0 This isn't working. I only want it to pull by owner if deleteowner=0 and likewise for sender. How do I do this without using 2 statements.
  2. On my site if a person logins in at www.site.com and then goes to site.com/page.php. The session doesn't exist. I'm assuming its because of the www. and the way the session is named upon creation. Any way to have the same session alive for the www. and without?
  3. I'm trying to do the following but it's not working. I've gotten it to work when I do an Order By but it's not working on the BETWEEN. select field1,round(((f2+f3+f4)/3)) as newfield from table where newfield BETWEEN 2 AND 4 ORDER BY field1 asc limit 20
  4. That didn't work for me. It probably isn't a big deal. I doubt this issue will come up often. Gayner: If you'd read my earlier post you'd see I'm making a forum and was just trying to come up with a good way to handle a large image hitting my forum that a user might post. My career is just fine, but good luck with yours.
  5. I was able to get it to work using this on the image, but the height of the table doesn't adjust with the image like it does here so I'm still missing something.. style="position:relative;z-index:10"
  6. In the forum I'm making if I post a large image like the one I posted here it stretches the table and messes up the layout. How does one get the image above everything like it does here so the forum layout stays intact?
  7. Are there any exploits to be concerned with as long as I"m htmlspecialchars on the data before it's saved to the DB?
  8. Here is what I'm doing. The enter link.com that gets placed into $message So I do: Before it is added the the DB. $_POST[message] = htmlspecialchars($_POST[message]); Then when showing the DB field I run it through this to get my link and html. $message = preg_replace ('/\[url\](.*?)\[\/url\]/is','<a href="$1">$1</a>', $message); Any problems with this method?
  9. NVM I answered my own ? $message = preg_replace ('/\[url\](.*?)\[\/url\]/is','<a href="$1">$1</a>', $message);
  10. I have a custom forum I made on my site and am adding many forum features. I'm wanting to add the ability for them to insert links but want to make sure it's safe. I was thinking of doing this as that is how I do my bold, colors etc. They enter http://link.com $message = htmlspecialchars($message); $message = preg_replace('|\[url\](.*?)\[/url\]|is', '<a target=_blank href=\\1></a>', $message); Of course this doesn't work and only ends up being <a target=_blank href=link.com></a>. What is the safe way to do this. Should I just automatically insert Click Here before the </a>? The ultimate questions is there any risk in allowing links to be placed.
  11. That worked great. What if I want to load this in another window and then send it to a different page. For example how on the smilies here you can click [more] and it will open them up in a different page but it still goes to this text box. Also, any suggestions on how that select box works?
  12. <img name="7" img src="../images/italic.gif" border="0" alt="Italic"onClick="sendText(document.form2.rep, '[i] [/i]')"> I'm using the above code to insert various text fields as bbcode so that I can transfer it to html once viewed. This works but inserts the text at the end of the text. So if text already exists and I try to type above the old text, when you click them it still inserts it below the old text and not where my cursor is. Any thoughts on a way to make the text go to the cursor rather than the end of the textbox?
  13. What I"m asking is the query correct. I changed the tablename to table simply because I'm anal and don't like the names of all my tables etc on the net. All table names etc are correct but something must be wrong with the way I have the query written using the math calculations.
  14. PHP Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/******/public_html/test.php on line 3
  15. This is what I have above. I'm not getting anything. It's actually coming back as a syntax error. I haven't really fine tuned the formula yet but I need to do it based of fields in a table as I've posted above. All I'm asking is should that work since it's not working now. What am I missing.
  16. Trying to get the formula to work in this query...I"ve never really mess with major formulas so this one is throwing me for a loop. Any help would be appreciated.
  17. Ok I have 2 tables. Table1 Table 2 ID ID Name T1ID Age I'm wanting to sort the data in Table 1 by the Age column in Table 2 and then display NAME as it appears in order of AGE. In this case ID on table 1 is the same and T1ID on table 2. Is there a way to do this?
  18. $search = @mysql_num_rows(mysql_query("select id,round(((stata+statb+statc+statd)/4)) as total from table where total BETWEEN $vone AND $vtwo")); I need to know if the record exists that meet the search criteria. Bascially I have 4 fields in a table used in the formula above to create a new stat. The person searching is seeing if they have the total between vone and vtwo which they type in. Such as 1 to 100 I doing manual math there should be several that meet this creteria but the $search variable is only returning 0.
  19. I have a PHP MYSql statement as follows $search = @mysql_num_rows(mysql_query("select id,round(((stata+statb+statc+statd)/4)) as total from table where total BETWEEN $vone AND $vtwo")); I have records where total should equal what I'm setting those variable to so I should be pulling them but it's not. Do you see anything wrong with this statement?
  20. Here is where the $_POST is coming from and these rows can change. The user can either select to generate 1-100 rows from this line. print "<tr><td>$variable </td><td><input type=text size=2 maxlength=2 name='a[$x]' value=$_POST[a][$x]> <input type=text size=2 maxlength=2 name='b[$x]'> <input type=text size=2 maxlength=2 name='c[$x]'> <input type=text size=2 maxlength=2 name='d[$x]'> <input type=text size=2 maxlength=2 name='e[$x]'></td></tr>"; So each name is an array so I use $_POST[b][$x] to check the value etc.
  21. I've tried this and when echoing the $_POST I'm still getting array instead of the value. foreach($_POST as $form_field => $user_input) { if(!is_numeric($_POST[$form_field])) { echo $_POST[$form_field]; $emessage = "You May Only Use Numbers!<br>"; $error = 1; break; } }
×
×
  • 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.