
tapos
Members-
Posts
145 -
Joined
-
Last visited
Everything posted by tapos
-
u can use following: <?php $months = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'); $curr_month = date ('F'); ?> <form name="pickmonth" method="post" action="../schedules/editmonth.php"> <select name = "which_month" > <option value = "" >Select Month <?php foreach($months as $month){ $selected = ($month == $curr_month) ? 'selected="selected"' : ''; echo '<option '.$selected.' value = "'.$month.'" >'.$month.'</option>'; } ?> </select> <input type="submit" value="Submit month" /> </form>
-
u can use xpath functions. see here http://www.php.net/manual-lookup.php?pattern=xpath
-
use $_POST instead of HTTP_POST_VARS
-
Also one more thing should be hope this will solve your problem
-
[SOLVED] Inserting data from mysql into a div with php
tapos replied to obiwan's topic in PHP Coding Help
$sql = "SELECT * FROM $table_name WHERE username = '$_POST[user_name]' AND password = password('$_POST[user_password]')"; $result =@mysql_query($sql,$connection) or die(mysql_error()); $user_info = mysql_fetch_array($result); now in the div tag <div id="ProfileContainer"> <div id="mainProfile"> <div id="profilePhoto">Users Photography: <img src='/photography/<?php echo $user_info['photoUrlText']?>'></div> <div id="nameContainer"><?php echo $user_info['username']?></div> <div id="bDayContainer">Users Birthdate:<?php echo $user_info['birthday']?></div> <div id="profileBody"></div> </div> hope this will help u -
use bellow $link = mysql_connect('mysql400.ixwebhosting.com', 'my_user', 'my_password); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_select_db('my_database') or die('couldn't select db'.mysql_error); echo '<br>DB Selected successfully'; $res=mysql_query('select * from students'); $cnt=mysql_num_rows($res); echo "<br> COUNT : ".$cnt; ?> if you still getting same then there is no record in the database in the students table. Please check the students table again
-
getting lowest and highest value out of group of variables
tapos replied to advancedfuture's topic in PHP Coding Help
use max() and min(). for further info http://www.php.net/manual/en/function.max.php http://www.php.net/manual/en/function.min.php -
yes, thanks little guy
-
change this to bellow $query = "SELECT password FROM 'Accounts' WHERE email = '$email'";
-
Something's wrong with this, but I don't know what....
tapos replied to pmoore's topic in PHP Coding Help
May be the package id didn't sent to paypal, so that when the page return from paypal, u didn't get the package -
U have synaptic package manager to do this. BTW if u can't install php and mysql in Ubuntu use XAMPP for linux. Its easy to install (BTW i don't recommend this if u are using any linux OS)
-
yes, save the variable names and the values in the database, this will make simple what u want to to.
-
try to debug like bellow $result = mysql_query($query) or die('SQL error'); i think this is database connection problem that why $result variable doesn't contain any resource identifier, mysql_query() return a false
-
where is your class C declaration? we also need to see it. BTW hansford is right
-
see this http://www.php.net/manual/en/function.substr.php
-
try replacing \n with <br />, but when u need to send a html mail. a suggession for u, try to use PHPMailer to send mail http://phpmailer.codeworxtech.com/
-
no not this way u can use it. what about this $where = ''; if(isset($var1)) { $where? $where .= " AND var1 = '$var1' " : $where = " var1 = '$var1' " } if(isset($var2)) { $where? $where .= " AND var2 = '$var2' " : $where = " var2 = '$var2' " } if(isset($var3)) { $where? $where .= " AND var3 = '$var3' " : $where = " var3 = '$var3' " } . .//so on . $result = mysql_query("SELECT * FROM `common_traits WHERE $where ") or die(mysql_error()); hope this will help u
-
use move_uploaded_file. http://www.php.net/manual/en/function.move-uploaded-file.php for more file handling information http://www.php.net/manual/en/ref.filesystem.php
-
please put your code in code tag
-
U can't do the live thing using a serverside scripting language, you must need a client side scripting language and Javascript is the best choice for that
-
try this $array = array(); $previous = null; foreach($row as $current) { if($previous === null || ($previous == 0 && $current == 1) || ($previous == 1 && $current == 0) ) { array_push($array, $current); //or u can use simply $array[] = $current } }
-
you can make the $_POST variables as hidden like bellow <?php foreach($_POST as $key => $value) { echo '<input type="hidden" name="'.$key.'" value="'.$value.'">'; } ?> Hope this will help you
-
$_POST/$_GET variable will contain the name of the input not the id. id is used for client side (javascript and css).