Waldir
Members-
Posts
48 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Waldir's Achievements
Newbie (1/5)
0
Reputation
-
your going to have to post some of your code, we dont write your code, we help you with what you have written
-
function doCommision() { global $user; if ($user->jv == 'y') { define( "AFFILIATE_COMMISSION", 20 ); } else { define( "AFFILIATE_COMMISSION", 10 ); } }
-
thats probably not going work, post your result, meaing what you echo from your database
-
<?php //this function displays the calendar function showYear($month, $year){ ?> <table border="1" cellpadding="0" cellspacing="0" width="100%" id="calendar"> <tr> <th width="16%" height="48" align="center" valign="bottom"><?php echo $year; ?></th> <th align="center" valign="middle">Sunday</th> <th align="center" valign="middle">Monday</th> <th align="center" valign="middle">Tuesday</th> <th align="center" valign="middle">Wednesday</th> <th align="center" valign="middle">Thursday</th> <th align="center" valign="middle">Friday</th> <th align="center" valign="middle">Saturday</th> </tr> <?php //check if $month is above 0 but below 13. If so it writes out a month, and increments $month by one. //once it reaches 12 it stops. while($month > 0 && $month < 13) { showMonth($month, $year); $month++; } ?> </table> <?php } //This function writes the months function showMonth($month, $year) { $date = mktime(12, 0, 0, $month, 1, $year); $daysInMonth = date("t", $date); $booked_day1 = 2; $booked_month = date("n", $date); $booked[$booked_month] = array(1 , 2 , 5 ); // calculate the position of the first day in the calendar (sunday = 1st column, etc) $offset = date("w", $date); $rows = 1; echo "\t\t<tr>\n"; //displays month echo "\t\t\t<td align=\"right\"><strong>". date(F, $date) . "</strong></td>\n"; for($i = 1; $i <= $offset; $i++) { echo "\t\t\t<td width=\"12%\"></td>\n"; } for($day = 1; $day <= $daysInMonth; $day++) { if( ($day + $offset - 1) % 7 == 0 && $day != 1) { echo "\t\t</tr>\n"; echo "\t\t<tr>\n"; echo "\t\t\t<td></td>\n"; $rows++; } //checks if date is booked. If so sets it to class="booked" echo "\t\t\t<td align=\"center\" valign=\"middle\" width=\"12%\" height=\"48\">"; echo $day . "</td>\n"; //this is the $day statement I need to verify!! $sql = "SELECT day, month, year FROM booked"; $res = mysql_query($sql); while ($row = mysql_fetch_assoc($res)) { if( $year == $row[year] ) { if( $month == $row[month] ) { if( $day == $row[day] ) { echo "booked?"; } } } } while( ($day + $offset) <= $rows * 7) { echo "\t\t\t<td></td>\n"; $day++; } echo "\t\t</tr>\n"; } ?>
-
Sure. Assumption: the links are directly in the TD, there are no intervening elements. td.hover { styles for hovered TD } window.onload = function () { var x = document.getElementById('id_of_nav_table'); var y = x.getElementsByTagName('A'); for (var i=0;i<y.length;i++) { y.onmouseover = function () {this.parentNode.className='hover'} y.onmouseout = function () {this.parentNode.className=''} } } Now the className of the TD changes onMouseOver on the link to 'hover' and the browser applies the special styles. onMouseOut the className is removed again and the TD reverts to the standard styles.
-
<?php //User Name Verify function userver ( $userveri ) { $query = "SELECT username FROM users WHERE username = '$userveri'"; $sql = mysql_query($query); if(mysql_num_rows($sql) > 0) { echo "The username you have chosen already exists!"; die(); } else { return $userveri; } } ?>
-
my bad i missunderstod you, just change your form to this <select name=\"searchtype\" onChange="form.submit()"> and get rid of your button, *not tested
-
yes using SELECTED witch item you want to select? if u know the name of it you can do something like if($row[name] == "name u want") { echo "<option value=\"$row[sponsor]\" SELECTED>$row[sponsor]</option>\n"; } else { echo "<option value=\"$row[sponsor]\">$row[sponsor]</option>\n"; }
-
that measn you have more than one row as a result and each row is an array, you have to make a loop to echo each row for ($i = 0; $i < mysql_num_rows($result); $i++) { $row[$i] = mysql_fetch_assoc($result); print_r($row[$i]); } result being the result of your query (wich is what gives you Resource id #29)
-
javascript
-
no prblem, please mark as solved
-
<? while($row = mysql_fetch_array($results_of_query)) { $echo "link structure for example $row[calOwnerName]"; } ?>
-
http://us.php.net/foreach
-
<? include("config.php"); include("user_check.php"); print("<left><a href='$PHP_SELF?action=pass'><a href='$PHP_SELF?action=profile'><font color=red>[/url]</center><BR><BR>"); $sql = mysql_query("SELECT * FROM users WHERE username = '$_COOKIE[username]'"); $row = mysql_fetch_array($sql) or die("Mysql error in $sql\nError: " . mysql_error()); $sqlcheckn = mysql_query("SELECT * FROM users WHERE nickname = '$_POST[nickname]'"); if($action==update) { if(mysql_num_rows($sqlcheckn) > 0) { print("Nickname already in use!<BR>"); unset($nickname); } else { $sql = "UPDATE users SET nickname = '$_POST[nickname]' WHERE username = '$_COOKIE[username]'"; $update4 = mysql_query($sql) or die("Mysql error in $sql\nError: " . mysql_error()); print("Your information is now updated."); } } ?>
-
define the error in a variable and than echo it on ur form $Name = $_POST['Name']; $Age = $_POST['Age']; $Email = $_POST['Email']; $Comments = $_POST['Comments']; if ($Name==0) $error = "Please fill the spaces completely"; include ("contactus.html"); exit(); now inside youe contacus.html page have something like this <input type="text"> <font color="red"><?=$error?></font>