Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. file is not uploaded or in a different place.. you post some code where the error is generating from the problem is probably in a include.
  2. Ahh your using post and have already grabbed the ID so try header("Location: OrganiseIDASX.php?id=$id");
  3. without delimitors your need to pad them to the exact length then use something like substr, just an idea 1 question, why are you doing it this way?
  4. erm.. try this (created on the fly, may have errors) <?php if ($status == 1) { //Added following for crediting Logic if($ip == "75.126.157.90" or "204.10.140.62" or "204.10.140.63") $sql="select oWeight from offers where oCampID='" . $campaign . "'"; else $sql="select oWeight from offers where oName='" . $name . "'"; $result = mysql_query($sql); $oWeight=0.0; if($r=mysql_fetch_array($result)) { $oWeight = (float)$r['oWeight']; } //Updating ostatus with weightage rather then 1 or 0. $totalO=0; $result =mysql_query("SELECT `ostatus` FROM `users` WHERE `uid`='$sid'"); $currOStatus = 0.0; if($r=mysql_fetch_array($result)) { $currOStatus= (float)$r['ostatus']; } if(($currOStatus+$oWeight)>1) $totalO=100; else $totalO=$currOStatus+$oWeight; ?>
  5. Well done also said its 90% done but
  6. just a quick one (on the phone so kinda hard to do) <p><font color="#999999"><span style="font-size: 15pt">Question Asked<br> </span></font><font size="2"> <?php $question = addslashes($_POST['question']); echo $question; ?> </font></p> <p><font color="#999999"><span style="font-size: 15pt">Answer<br> </span></font><font size="2"> <?php $host = 'localhost'; $user = '?'; $pass = '?'; $db = '?'; $connect = mysql_pconnect($host, $user, $pass); $selectdb = mysql_select_db($db); mysql_connect($host, $user, $pass); mysql_select_db($db); $SQLq = "SELECT * FROM `search` WHERE "; $parts= explode(" ", $question); $start = "`question` LIKE '%"; $middle = "%' AND `question` LIKE '%"; $end = "%'"; $search = $start.implode($middle, $parts).$end; echo $SQLq.$search; $SQLq = $SQLq.$search; //$SQLq = "SELECT * FROM `search` WHERE `question` LIKE '$question'"; $sql = mysql_query($SQLq)or die(mysql_error()); $fetch = mysql_fetch_array($sql); $answer = $fetch['answer']; if($answer == ""){ echo 'Sorry, I dont know the answer to that one.'; } else { echo $answer; } ?> </font></p>
  7. try <?php header("Location: OrganiseIDASX.php?id={$_GET[$id]}"); ?> if this fails what error, also we really need to see more code
  8. see last post basically have 90% done
  9. No.. "SELECT * FROM `search` WHERE `question` = 'what' will only find record(s) which ONLY have 'what' in the question field if you do "SELECT * FROM `search` WHERE `question` LIKE '%what%' it will find all that have 'what' anywhere in the field question.. heres the code i would use <?php $search = "what is vb"; $SQLq = "SELECT * FROM `search` WHERE "; $parts= explode(" ", $search); $start = "`question` LIKE '%"; $middle = "%' AND `question` LIKE '%"; $end = "%'"; $search = $start.implode($middle, $parts).$end; echo $SQLq.$search; $SQLq = $SQLq.$search; ?> NOTE it needs cleaning up (ie search on 0/1 word) will fail
  10. hint: start = "`question` LIKE '%" middle = "%' AND `question` LIKE '%" end = "%'"
  11. if you look at my last post, a few tweak and you should beable to get it working.. basically you final SQL query should be something like this $SQLq = "SELECT * FROM `search` WHERE `question` LIKE '%what%' AND `question` LIKE '%is%' AND `question` LIKE '%vb%' "; so you need to alter the basic script i wrote from what OR is OR vb to `question` LIKE '%what%' AND `question` LIKE '%is%' AND `question` LIKE '%vb%'
  12. maybe use explode & implode $search = "what is vb"; $parts = implode(" ", $search); $search= explode(" or ", $parts); echo $search; your need to clean this up but its a start
  13. in the first chunk of code.. your not setting $folder_id etc.. infact i can't see a single time you fetch the data!
  14. Last one looks nice, but i feel that its a little empty in the white space around the "dummy text of printing and", but i am usless as a designer
  15. Cool, well done as a note $question = addslashes($_POST['question']); cleans up the user input can you click solved (bottom left)
  16. check the database name is being selected! change $db = '?'; $connect = mysql_pconnect($host, $user, $pass); $selectdb = mysql_select_db($db); to $db = '?'; $connect = mysql_pconnect($host, $user, $pass) or die(mysql_error()); $selectdb = mysql_select_db($db) die(mysql_error());
  17. try moving mysql_close(); to the end (when you finished with it)
  18. try with the changes (my first post) i updated it try the WHOLE thing their a few changes
  19. try <p><font color="#999999"><span style="font-size: 15pt">Question Asked<br> </span></font><font size="2"> <?php $question = addslashes($_POST['question']); //<-Changed echo $question; ?> </font></p> <p><font color="#999999"><span style="font-size: 15pt">Answer<br> </span></font><font size="2"> <?php $host = 'localhost'; $user = '?'; $pass = '?'; $db = '?'; $connect = mysql_pconnect($host, $user, $pass); $selectdb = mysql_select_db($db); mysql_connect($host, $user, $pass); $SQLq = "SELECT * FROM `search` WHERE `question` LIKE '%$question%'"; echo $SQLq; $sql = mysql_query($SQLq)or die(mysql_error()); $fetch = mysql_fetch_array($sql); $answer = $fetch['answer']; echo $answer; ?> </font></p> any errors ? EDIT: updated the SQLq
  20. thats nice, thanks for letting us know that
  21. note you can remove the ."($red)" as they are just for debugging
  22. you need to store the IP's i would also recommend MySQL, look here Simple MySQL PHP Hit Counter
  23. try this <?php $red = ($red); switch($red) { case '0': echo '<img src="./one.gif"> - red zero'."($red)"; break; case '1': echo '<img src="./four.gif"> - red one'."($red)"; break; case '2': echo '<img src="./three.gif"> - red zero'."($red)"; 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.