AndyB
Staff Alumni-
Posts
5,465 -
Joined
-
Last visited
Never
Everything posted by AndyB
-
time for my afternoon nap
-
You can't pull some html code randomly! The example below would have California 'pre-selected' in the dropdown <select size="10" name="menu"> <option selected value="" >Select A State</option> <option value="New York">New York</option> <option value="California" select='selected'>California</option> <option value="Florida">Florida</option> <option value="Rhode Island">Rhode Island</option> </select> I did say
-
If you check the generated code, you'll see: <link rel="stylesheet" type="text/css" href="theme//visus.css"> That shows clearly that the value of $theme is not present and so is being interpreted as nothing. The problem (still) lies with how you're getting $theme
-
<link rel="stylesheet" type="text/css" href="theme/<?php echo $theme;?>/visus.css">
-
Assuming your list of states is in an array (anything else is deranged), as you use php to loop through the array to generate the dropdown options, add select='selected' to the option value that matches the pre-selected state.
-
Yes. See the manual for date() at http://ca.php.net/manual/en/function.date.php
-
Change: if('$mail,$to,$subject,$message,$headers'){ to: if($mail,$to,$subject,$message,$headers){
-
See http://ca.php.net/manual/en/function.getimagesize.php and use the third array element for height/width And it's a php issue, not MySQL. so I'll move it for you.
-
Let's fix the first one properly: <?php $host="localhost"; $username="wowdream_domaine"; $password="PASS"; $db_name="wowdream_domaine"; $tbl_name="maintenance"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ if ($rows['check'] == yes) { echo "<a href='turnmaintenanceoff.php'>Turn maintenance mode off</a>"; } else { echo "<a href='turnmaintenanceon.php'>Turn maintenance mode on</a>"; } } ?> Note how proper indentation makes it obvious that you were a closing brace short in your code.
-
if ($rows['check'] = yes) { should be if ($rows['check'] == yes) {
-
In 11 minutes you can check most of 37,000 links. At that rate you could have checked more than a quarter million links since you posted. If I couldn't find what I wanted after checking a quarter of a million links, it's probable that I'd give up and move on. Wish you luck in your quest.
-
I wasn't kidding about this. The ; does not belong.
-
http://www.google.ca/search?q=listbox+tooltips+%2B+javascript&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a 37000 links. Enjoy.
-
You checked the google listings in the link I gave and none of them were what you wanted? That's hard to believe.
-
if($row['check']; == yes) { is wong if($row['check'] == yes) { is good
-
http://www.tizag.com/mysqlTutorial/ - spend a few minutes there and you be fine.
-
One thing for certain. This has nothing to do with php! You actually want to display a tooltip in your generated HTML code. When all else fails ... http://www.google.ca/search?q=listbox+tooltips&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a
-
Improved variant: if ($type=="Debit") { $amount = 0 - abs($amount); } Generates a negative value for $amount even if the user mistakenly places a negative sign before their input debit value.
-
$res=mysql_query($sql) or die ("Sorry, it did not work!"); Spectacularly unhelpful! Instead, try: $res=mysql_query($sql) or die ("Error: ". mysql_error(). " with query ". $sql); Ah! Now you know the error that occurred AND you know the querystring where it failed. Then you can see what the real problem is.
-
This is not your personal chat line!! If you want to learn, you need to start by doing something on your own instead of holding out your hands. Spend time at www.tizag.com then come back and post some code you have created. Ask a relevant, coherent question and you'll probably get an answer. This thread is getting very close to being locked.
-
if ($_POST['_submit_check']){ $defaults = $_POST; // this makes no sense
-
CSS solutions - cross-browser, etc. Take your pick ... http://www.cssjuice.com/25-rounded-corners-techniques-with-css/
-
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
AndyB replied to topflight's topic in PHP Coding Help
Which bit of what I posted is confusing you? It's your code, properly indented for legibility and with loops closed. -
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
AndyB replied to topflight's topic in PHP Coding Help
So we're perfectly clear: <?php if($nume<0) { while ($data = mysql_fetch_assoc($query)) {?> <tr bgcolor=#EEEEEE> <tr style="background-color:#EAEAEA;" onmouseover="this.style.backgroundColor='#0099FF'" onmouseout="this.style.backgroundColor='#EAEAEA'"> <td><?php echo "{$data["login"]}"?></td> <td><?php echo "{$data["fname"]","{$data["lname"]}"?></td> <td><?php echo "{$data["hub"]}"?></td> </tr> <?php } ?> </table> <?php } ?> -
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
AndyB replied to topflight's topic in PHP Coding Help
One problem is the statement while($data = mysql_fetch_assoc($myquery){?> because $myquery is never defined, and it's a closing bracket short at the end.