Jump to content

EchoFool

Members
  • Posts

    1,074
  • Joined

  • Last visited

Everything posted by EchoFool

  1. Oh so the second query temporarily makes it 1 to 16 ?
  2. Heres my table: UserSeats UserID | SlotID 2 | 4 1 | 6 5 | 1 7 | 7 Lets argue im UserID 4 and i need to find the next used seat ( 8 is not used so we go back to 1 then 2 then 3) then finally 4 which IS used which would be the result im trying to get. Hope this helps.
  3. Im slightly confused by the second SELECT query in the Union.
  4. Hey Im trying to use a query to check which slot of 8 (1 -8 ) is occupied from the person who is in a slot number. Say i was in slot 2 and slot 3 and 4 were empty then the next used slot is 5. This i find easy in MYSQL how ever - when some one is say in slot 7 and slot 8 is free it then needs to go back to and check slot 1 and continue in ascending order from that. Imagine a circle with 8 points equally spaced out so it would be 1 through to 8 then 1 and so on. How would i achieve this added complicated part?
  5. Well the links getting spammed are in these formats: (obviously its not really google links but this is example) some have IPs in the urls and some have .net / .co.uk etc
  6. Okay one final question.. I want to also check for links - thing is, links can vary in terms of how you type them out..and the website name could be anything (basically i'd use a wildcard) but can strpos detect what is and what is not a link ?
  7. Which is most efficient for finding a string within a string? Eregi or strpos? Currently im using Eregi to check a string again an array of blocked words and retrun true if one is present. But it seems i can do it also with strpos... so which is best function to use ?
  8. Sos thought i added the script to my post: function Filter($text) { // fill this array with the bad words you want to flag on $bads = array ("badword1","badword2"); // we are just checking $i = 0; while($i < sizeof($bads)) { // go through each bad word if(eregi($bads[$i],$text)){ return 1; echo 'flag'; }Else{ return 0; echo 'no flag'; } //if we find any, return 1 $i++; } }
  9. Hey My site is getting alot of spam and i need a way to keep up with what is being sent with some kinda system that will flag things which contain urls and chosen keywords. Problem i faced though was lets say a keyword was: skyspider Now some one could say sky or spider (as seperate words) but they still flagged. So "theres a spider in the sky" would be flagged when i only want "skyspider" flagged... does that make sense? What php function do i require to do such string checks like this? Thanks
  10. Hey Im trying to calculate a % of completion against a secondary table like so: Total number of rows where Complete = 1 would be a certain % of total number of rows of another table. So say i have 5 rows with Complete = 1 on "table1" and there was 10 rows on "Table2" then this would return 50% but am looking to then order than in DESC order and limit by 20 (i can do the orderby and limit - no problems). But im stuck as to how i would do this in a single query... any one got the faintest idea? Hope you can help.
  11. See image to see what i see when i receive the email... theres no other information that i can see regarding the headers.. http://i52.tinypic.com/167qx04.png
  12. Hey, I have a submission form to ask for support to my support email. But when i recieve messages the break lines are not counted for and i get the r/n. I then added the nl2br($Message) but that also does not work.... and so im not sure how i solve it ... here is my script: <?php If(isset($_POST['Send'])){ $supportemail ='support@mydomain.com'; $Username = $_POST['Username']; $Email = $_POST['Email']; If(strlen($Email)<3){ ?> Invalid email address! <br /> <a href="index.php">Continue</a> <br /><br /> <?php }Else{ $subject = 'I am requesting help!'; $headers = 'From: '.$Email.' <'.$Email.'>'."\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n"; $headers .= 'mailed-by: text/html; charset=iso-8859-1'."\r\n"; $message = "<b>".ucwords($Username)."</b> has requested help ! <br /><br />"; $message .= "Their message is: <br /><b>".nl2br($_POST['letter'])."</b> <br /><br />"; $message .= "Email is: <b>".$Email."</b>"; mail('$supportemail', $subject, $message, $headers); ?> Your message has succesfully been sent, you will be contacted by the email "<? echo $Email; ?>" that you have provided as soon as possible! <a href="index.php">Continue</a> <br /><br /> <?php } ?> Hope you can help!
  13. Hey, I just got a mysql query error but no idea what it means ... my query is: mysql_query("UPDATE user_data SET Proposal = 0 WHERE Proposal NOT IN (SELECT UserID FROM user_data)") or die(mysql_error()); Yet its not happy with it as i get this error: The idea is if your proposal has the id of a user that is no longer in the database then set proposal to 0. =/
  14. Hey. I been using a function to check if a string contains only letters which is: ctype_alpha But i would like to change it to allow numbers 0 to 9 and the letters is there a function to do that in PHP i can't find it.
  15. Hey I currently have a few divs with one in particular being a pain. It will not expand if i put text within the div boundries... This is my css and html: #logodiv{ margin: 0 auto 0 auto; width: 950px; height:168px; background-image: url('test.png'); background-position:center bottom; background-repeat:no-repeat; } #logotable{ margin: 0 auto 0 auto; width: 900px; } #bodydiv{ margin: 0 auto 0 auto; width: 950px; height: auto; background-image: url('bodybackground.png'); background-repeat: repeat-y; } #innerbodydiv{ margin: 0 auto 0 auto; width: 900px; height: auto; } Then my structure: <div id="logodiv"></div> <div id="bodydiv"> <div id="innerbodydiv"> <p>content</p> (image about 500 lines) </div> </div> Now the issue is - content does not expand the "bodydiv" div so the image will not repeat vertically. The only way i could solve it was to put a fixed height like height:200px;. Height: auto; and height:100%; did not work yet height:200px; does! Which is a problem because the height will vary depending on on the content of the pages. Why is this? Thanks
  16. Well the idea is to hide a DIV when any type of GET is set and it does work according to the page - the div hides when any GET is set but then this error occured at the same time even though it worked. Would the isset work ? Or would that require a specific GET['name'] because of again the array issue? And yes that is currently the test script - stuff before the line 114 is html output stuff
  17. Error Level: 8 Error Message: Undefined index: register Error File: index.php Error Line: 114 Error Context: Array The line 114 is: if($_GET){}else{ echo hi; } I thought this was perfectly fine syntax to check if a GET of any kind is set yet i get this error in my logs which is very odd. Any ideas?
  18. When you say compare it - what kind of comparison am i trying to do ?
  19. Thats my current method - but that doesn't solve the issue cos that means with the new artist i have 21 rows now but only 20 showing so i would need to replace one row some how to keep my database small.
  20. Hey, Im having difficulty storing a top 20 chart based on most sales in descending order. Lets say for simplicity the table was listed with 20 rows and the sales were 1 to 20 in perfect order. But now along comes a new artist who sold 3. So now there is 21 in total so the "1" has to drop off because thats the lowest and it can only show the top 20. So it would then be 2,3,3 ....20. How ever how can i apply this in php so it will always remain having 20 rows in the dabtase.. =/
  21. Which of the If statement clause's is true when the payment is made ? Cos it says: // uncomment this section during development to receive an email to indicate whats happened // $mail_To = "[email]payit@designertuts.com[/email]"; // $mail_Subject = "completed status received from paypal"; // $mail_Body = "completed: $item_number $txn_id"; // mail($mail_To, $mail_Subject, $mail_Body); This might help... it obviously won't send when commented out? But not sure which MailTo your saying doesnt work
×
×
  • 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.