-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
I have re-writen youre code a little - have a go with this, it's my best guess at what you are looking for (replaces everything within the second <?php ?>): <?php if (!isset($_POST['filter']){ $filter = 1; }else{ $filter = mysql_real_escape_string($_POST['filter']); } echo'<form action="#" method="POST"><label>Search By Model No. (Default is 1) </label><input type="text" name="filter" />'; $mfg = mysql_query('SELECT cars.nick, cars.vin, cars.model, cars.year, cars.color, cars.plate, cars.purchdate, color.shade, color.id, mfg.make FROM cars INNER JOIN color ON (color.id = cars.color) INNER JOIN mfg ON mfg.id = cars.make WHERE cars.make = '.$filter.')' or die($mfg.'<br>~-~-~-~-~-~<br>Caused an error when running. Error is -- <br>'.mysql_error()); echo "<body "; echo "<table border=\"1\" align=\"center\">"; echo "<tr><th>Name</th><th>VIN</th><th colspan='10'>Options</th></tr>"; {while($mic = mysql_fetch_assoc($mfg)) { $name = $mic['nick']; $vin = $mic['vin']; $make = $mic['make']; $model = $mic['model']; $year = $mic['year']; $color = $mic['color']; $colorID = $mic['id']; $shade = $mic['shade']; $plate = $mic['plate']; $purchdate = $mic['puchdate']; $purchprice = $mic['puchprice']; if ($color == $colorID){ $colorOut = $shade; }else{ $colorOut = $color; } echo "<tr>"; echo "<td><a href='car.php'>$name</a></td><td>$vin</td><td>$make</td><td>$model</td>"; echo "<td>$year</td><td>$colorOut</td><td>$plate</td><td>$purchdate</td><td>$purchprice</td>"; echo "<td><a href='parts.php'>Parts</a></td><td><a href='list.php'>Maintenance</a></td>"; echo "<td><a href='notes.php'>Notes</a></td></tr>"; } echo "</table>"; ?>
-
Did you actualy read the captcha instructions? cause you clearly didn't read the forum ones here, where's your php/code tags huh??? yeah! see! What captcha is wanting you to do is either use another page - over and above your own, not in place of your own or use your page in place of the one that it is naming as verify.php. It's quite tricky and lengthy to set up captcha, so I suggest going through the instructions line by line if you get a specific issue/error once you're done post it up here (inside the proper forum tags of cource!) and we'll do our best. But what you are asking already has some fairly in deapth step by steps, and would take the best part of the morning to write you another one.
-
Are you using GET or POST on details.php? and... +1 Thow us a bone here!
-
You will need to explain how you are counting your rating's then, because I count "2 - yyyy" as having 8 points.
-
that shouldn't work at all regardless of what browser you use :- you can't execute a header(location:) after returning data to the browser. Now you've got me confused . And please use the forum code or php tags when posting code.
-
Please read the rules : all code is to be posted within the forums [ ]...[ ] tags. answer to your question - just include target="_blank" at the end of the html for the anchor (just after the href="") however, your problem will be that you arn't concatenating your strings properly. Have a go at this: <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a href=\"$f5\" target=\"_blank\">$f4</a>"; ?></font></td> should get it
-
what do you meen it "loops endlesly"? is this code on the target page as well?
-
I suspect that's not the code that is causing the errors, where's the rest of the stuff?
-
if you still want help - we still want your code
-
that's not a lot to work with... try this: echo ' </div> <div id="copyright"> <span class="backtop">'."<a href=\"#top\" onclick=\"$.scrollTo( '#top', 900 ); return false;\" title=\"Back to Top\">Back to Top</a>".' </span> </div> </div>';
-
even though they are nested within a double quoted string rather than a single quoted one? never knew that to happen. I assume it's an array thing, as I have never actualy tried to echo anything from an array in this manner I was just working under it being the same as if it was a single flat variable. my bad.
-
Two identical DB fields do not compare equal
Muddy_Funster replied to AwHeck's topic in PHP Coding Help
there is more to the information that passes between your page and your database than meets the eye - litteraly. what steps have you taken to sanitise the input and output of these values? -
ok, couple of things - you know you don't need to open and close every line of php code with <?php ?> right?, also, where are you populating your array from? is it hard coded into the page (cause if it is it's still not "dynamic", it's just a more complicated way of doing what's already done in html)?
-
I'm sorry, I can't actualy find a question in there.
-
You must be getting mixed up with mysql_fetch_row() as mysql_fetch_array() works with both/either field name or relative index number. So while it does work as $row[0], it also works with $row['fieldName'] anyway, I would like to see the whole code related to this as it is, particularly the part where the SQL query is assigned. Also, you have over-complicated your checkbox generation, you don't need the counter, and I would drop the curly braces as well, they are also unneeded.
-
look up stripslashes() in the php manual.
-
except that the OP is using the mysql library, not the mysqli one....
-
PHP and WMI - querying for IP addresses on remote hosts
Muddy_Funster replied to ryamigo's topic in PHP Coding Help
you can't do it with PHP, it is run purely server side, you would need javascript or possably ajax. Although I can't think of a single legal reason you could have to be trying to obtain this information without simply enquiering from the person using the computer that you want the local IP address of. P.S. Bumping posts is against the rules. -
add the from address here: $mailto = '[email protected]' ; $subject = "ContactForm" ; $formurl = "http://www.your-directories.com/contact.html" ; $thankyouurl = "http://www.your-directories.com/Forms/Thankyoucontact.html" ; $errorurl = "http://www.your-directories.com/Forms/Errorcontact.html" ; $from = "[email protected]"; // assign the from address then further down... "From: \"$fullname\" <$fromemail>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.16.1" . becomes "From: \"$fullname\" -via WebForm- <$from>" . $headersep . "Reply-To: \"$fullname\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.16.1" . that should shut them up, and still have the script relay you the information that it originaly did, with the ability to use the "Reply" function still intact.
-
happy to help, any further problems let us know.
-
You have replaced the sprintf() with mysql_query(), thus your use of '%s' is being taken litteraly by the SQL. Don't place raw strings inside of mysql_query(). assign the string to a variable and then sanitise it fist, placing the sanitised variable inside the mysql_query(), this also has the benefit of allowing you to echo out your actual query string as it will be when it is sent to the database.
-
http://php.net/manual/en/reserved.variables.server.php http://www.php.net/manual/en/function.strrpos.php http://php.net/manual/en/function.substr.php combine the info on those three and you will have what you are looking for.
-
what array are you working with? $user_arr[] or $user_info[]?. and why are you not just working with the $user[] array that you are copying the information from in the first place?
-
php and mysql REGEXP curly braces and max characters
Muddy_Funster replied to fohanlon's topic in PHP Coding Help
then just include a less than in the where clause. $qry = "SELECT word, definition FROM dict_list WHERE UCASE(word) LIKE UCASE('$q%') AND CHAR_LENGTH(word) <= 11 LIMIT $limit"; -
php and mysql REGEXP curly braces and max characters
Muddy_Funster replied to fohanlon's topic in PHP Coding Help
wouldn't it be much easier to just make the query do it? $qry = "SELECT word, definition FROM dict_list WHERE UCASE(word) LIKE UCASE('$q%') AND CHAR_LENGTH(word) = 11 LIMIT $limit";