Jump to content

tapos

Members
  • Posts

    145
  • Joined

  • Last visited

Everything posted by tapos

  1. 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>
  2. u can use xpath functions. see here http://www.php.net/manual-lookup.php?pattern=xpath
  3. use $_POST instead of HTTP_POST_VARS
  4. Also one more thing should be hope this will solve your problem
  5. i didn't see any object. You can't use $this variable without object
  6. $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
  7. 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
  8. 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
  9. change this to bellow $query = "SELECT password FROM 'Accounts' WHERE email = '$email'";
  10. May be the package id didn't sent to paypal, so that when the page return from paypal, u didn't get the package
  11. 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)
  12. yes, save the variable names and the values in the database, this will make simple what u want to to.
  13. 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
  14. where is your class C declaration? we also need to see it. BTW hansford is right
  15. see this http://www.php.net/manual/en/function.substr.php
  16. 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/
  17. 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
  18. 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
  19. please put your code in code tag
  20. 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
  21. 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 } }
  22. 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
  23. $_POST/$_GET variable will contain the name of the input not the id. id is used for client side (javascript and css).
×
×
  • 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.