Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. no idea its hard to read as you didn't use the code tag(#) OK after a quick look $lenght isn't needed (use count), and $error,$succ i would handle on the returned page so replace the header with return true/false and on the return redirect of course the script can be improved that just after a quick review and that my personal view function fun_add($tab,$id,$iman,$lenght,$error,$succ) { if ($id==0){//its insert function ! $res=("insert into $tab ()values()"); mysql_query($res); $id=mysql_insert_id(); }//end if // Get table Info $res1=mysql_query("desc $tab "); $c=0; while ($row1=mysql_fetch_array($res1)){ $c=$c+1; $fname[$c]= $row1[0]; } //2 to the first field acept id $q="update $tab set "; for ($i=0; $i<$lenght ; $i++) { $fi=$i+2; $q.="$fname[$fi]= '".$iman[$i]."' "; if($i!=$lenght-1) $q.=","; } $q.=" where id = '".$id."'"; //print $q; mysql_query($q) or die("not query"); if ( mysql_affected_rows()>0) { header("location:"."$succ"); exit; } else { header("location:"."$error"); exit; } } //$iman =array("hi","iman",125,"wo"); //iman_add("test",2,$iman,4,"error.php?a=1","view.php");
  2. try this <?php echo "<td width='30'><form name='editdetails' action='editpage/"; echo "$editpage" ; echo "' method='POST'><input type='hidden' name='login' value='" . $row['login'] . "'><input type='submit' class='main' name='Submit' value='Edit' /></form></td>"; ?> you need the quote the value
  3. what about this, to filter the html.. you could replace "good tags" with [] then filter then replace back ie <B> replace with [b] filter [b] replace with <B> $html= preg_replace('%<(/?B)>%sim', '[$1]', $html); html = "<html> <body> test <script>"; $html = preg_replace('%<[a-zA-Z/][^>]*>%sim', '', $html); $html= preg_replace('%\[(/B)\]%sim', '<$1>', $html);
  4. this should be in Third Party, should have code tag, and i'm not sure what your asking
  5. i should of checked this $sql = "SELECT * FROM Booking Database where price cat = '$CAT'"; to $sql = "SELECT * FROM `Booking Database` where `price cat` = '$CAT'"; i assume price cat contains A's & B's ?
  6. Ahh ok, so you got it ? it helps to see a few matches and invalid matches.. if this is solved then please click topic solved
  7. post some code so i can see what your doing
  8. Use only the functions you need to per site but if a function seams to have "too many" parameters it should "probably" be setup as a class and/to be broken down into smaller functions.
  9. $text_line = explode(":" , $line); $X = count($text_line); //<--$X will be the columns so for the whole file $X = 0; $lines='db.txt'; foreach ($lines as $line) { $text_line = explode(":" , $line); $X = $X+ count($text_line); } echo "$X: columns ";
  10. SELECT * FROM Booking Database where price cat = '$CAT' should be $sql = "SELECT * FROM Booking Database where price cat = '$CAT'"; also you need to add this
  11. a.php ----------- <?php $a = 'dog'; ?> b.php ----------- <?php include "a.php"; $b = $a; echo $b; ?>
  12. what about this preg_match("/\$Lock\s\w+\sPk=\w+\|/", $lock, $matches)
  13. Welcome to the board.. erm.. "this thing become horrible" isn't the most detailed question.. can you re-phrase, also a link to a member with a wish list may help
  14. use $field = urldecode($_GET['field']); to resolve the encoding issule urldecode or use post
  15. welcome please click topic solved (bottom left) and welcome to the board
  16. we looking for a random error or if their is an error or what? more details not all of us can read minds (not at this distance anyway) would be nice if you closed the else statement or the first if..
  17. change $rs = mysql_query($sql,$conn); to $rs = mysql_query($sql,$conn)or die(mysql_error()); it may reveal the problem
  18. Animated gif would be better then as with a processbar percent your need to know how long the way i work it out is something like this 1. get the current time = StartTime 2. get the number or items/records etc = R, 3. during the processing, after echo records, i do RT = Total Records RP = Records processed so far PerRecord = ((Current Time - StartTime) / RP) TimeRemaining = ((RT - RP) * PerRecord) i hope that makes sense but
  19. Create new file <?php phpinfo(); ?> save here C:\xampp\htdocs\phpinfo.php now load this link http://localhost/phpinfo.php whats displayed
  20. you can have some of my spam if you like, i have loads LOL
  21. oh $rs = mysql_query($sql,$conn); //add code below while ($row = mysql_fetch_assoc($rs)) { echo $row["Customer Username"]; echo $row["Booking ID"]; echo $row["Check In"]; }
  22. 1. Wrong section 2. check the URL (If you entered the URL manually please check your spelling and try again.) this isn't a PHP problem
  23. erm.. really depends what the code is for? heres some Expandability Upgradeability Flexibility Useability but really we need a more detailed question and in the correct section (this isn't a PHP problem)
  24. Try this <?php mysql_query($query) or die ("Er is een fout opgetreden tijdens het registreren van de ingevoerde gegevens"); //--Snip $email_from = "webmaster@gebr-sluijer.nl"; $onderwerp = "Rally-online account activatie"; $mime_boundary = "----Rally-online----".md5(time()); $headers = "From: Rally-online <$email_from>\n"; $headers .= "Reply-To: Rally-online <$email_from>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n"; $url = "http://www.gebr-sluijer.nl/test/"; $bericht = "Beste rally-online gebruiker\nUw activatie link: <a href='$url'>here</a>"; ini_set("sendmail_from", $email_from); //---End Snip if(mail($email, $onderwerp, $bericht, $headers) == true) { ?> PS the only stupid questions is the unasked one EDIT: if this fails comment out the $URL line change $url = "http://www.gebr-sluijer.nl/test/"; to //$url = "http://www.gebr-sluijer.nl/test/"; and try that, (just need to know the patten)
  25. i have commented out the lines //$VariableName = $_GET['VariablePassed']; //$sql = 'SELECT * FROM `Booking Database` ORDER BY `Booking Database` . `Price Cat` ASC LIMIT 0, 30'; and replaced them with $Acat = $_GET['Acat ']; //Acat being the form element name were passing $sql = 'SELECT * FROM `Booking Database` ORDER BY `Price Cat` WHERE `Price Cat` = $Acat LIMIT 0, 30'; Basically the 'Acat' is the element in the form (thus the new GET) and i am selecting the records where `Price Cat` = $Acat (field `Price Cat` = the value of the Acat field)
×
×
  • 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.