Jump to content

joshi_v

Members
  • Posts

    168
  • Joined

  • Last visited

    Never

Everything posted by joshi_v

  1. It this what you are looking for? [code] <input name="name" type="radio" value="value" onClick="document.location.href='filepath' "> [/code] Regards, Joshi.
  2. Well! Your first problem is to assign the contents of  db to other variables! See this one.. [code] $sql="select one,two from table_name [where_caluse] "; $qry=mysql_query($sql) or die (mysql_error()); # here i am assuming that you had only one row. $result=mysql_fetch_array($qry); $var_one=$result['one']; $var_two=$result['two']; [/code] First let us know this is the same you want for the first problem or not.If it is not i would like to know little more description about your problem. Regards Joshi.
  3. [code] Function limited_words($var,$limit) #String to break , and  the limit of number of words should be in string. {       $word='';       $arr=explode(" ",$var);        for($i=0;$i<=$limit;$i++)       {             $word.=$arr[$i].' ';       }       return $word; # return string with limited number of words. } [/code] Hop it will be useful for you! Regards Joshi.
  4. Is there any line separator in you file? Like '\n' or anything else?
  5. Yeah! you are right.This function is not yet documented..but as much as i know it will return only contents of the URL. Have it a try! Regards, Joshi.
  6. Try this! [code] $sql="select field_name, field_value from table_name where field_value!='' "; $qry=mysql_query($sql) or die (mysql_error()); while($res=mysql_fetch_array($qry)) { echo $res['field_name'].'          '.$res['field_value'].'<BR>'; } [/code] Regards, Joshi
  7. Sorry! Didn't observe the query as it seems to be good in syntax. The output you are getting is because of your query only! See the  order by part.it is in desc order by date. So the out showing was Fine. Don't mind i want to give u a suggestion as you are new to PHP. When you are displaying mysql records if you display in present way ,easily u will get confused. Try to display all the rows one by one.don't append it to previous rows.so that u can understand easily what is going on. Replace and with you for loop with this and..give it a try. [code] for ($i=0; $i < $nrows; $i++) {   $row = mysql_fetch_array($qr);   echo 'Counter Value:  '.$i.' ID Value: '.$row['id'].' Image Name:  '.$row['image'].'<BR>'; } [/code] You will observe the output row by row! Cheers, Joshi.
  8. [code] document.form_name.reload.true(); [/code] Cheers!
  9. If you provide the output of the PHP what is displaying in browser it will be more helpful than how it should be . By the way are you sure than u want to increment id by 11 each time? When you define an integer column as 'auto_increment' coulmn there is no need to pass that value in the insert query. Cehck these two things .if still u face the same problem come ip with teh output next time. Cheers!
  10. Use 'url_multi_getcontent' . it will returns the content of a cURL handle if CURLOPT_RETURNTRANSFER is set Regards, Joshi.
  11. In my openion it is better to display these contents just after successful user registration..and if possible later also..means the way just we are doing in PHPFreaks profile area. Regards, Joshi
  12. It is saying that you are missing ; or } braces are not matching correctly.
  13. Problem is in your query only! not in while loop see! [code] mysql_query("SELECT * from users where status='active' order by id asc"); [/code] In the query status='active' , but while creating table you mention it as 'Active'.So that is the difference. [code] mysql_query("SELECT * from users where status='Active' order by id asc"); [/code] Regards, Joshi.
  14. Yes.You should! It will be safe , in case your $sess_five has a single value in it.
  15. well it would be like this.. [code] $file_name="06.11.07-reports.doc"; $extension=substr($file_name,-4);#Here i am assuming that , file extension will always be 'doc' $file=substr($file_name,0,-4); $final_name=str_replace(".","-",$file).$extension; [/code] Regards, Joshi.
  16. Yes.You can do. But there is a small mistake in your example... [code] <?php $data = 'New company 1'; ?> <form action="../code/validate_insert.php" method="post"> <input type="hidden" name="company" value=" <?php $data ?>" /> # Here it should be like <?php echo $data;?> <input type="image" name="submit" src="../images/submit_button.jpg" /> </form> [/code] Regards, Joshi.
  17. See this for an example for HTMl mailer. <A HREF="mailto:mailaddress@web.com">Send me an email</A> When you click on the above link, your default email client will be launched (if you've configured one). You'll notice that the Subject and Body fields of the email message are empty. With mailto, you can include a default subject and body for your emails and make it look a little more professional. Not only that, you save your visitors some typing. <A HREF="mailto:address@web.com?subject=Testing Mail&body=The Tips and Tricks section is great">Send me an email</A> Regards, Joshi.
  18. mostly IDs will be used in CSS . check this tutorial.. http://www.w3.org/TR/html4/struct/global.html Hopes  this helps you.
  19. It is showing space just because of your setting in table declaration. <table width='207' height='75' valign='top' border='1' cellpadding='0' cellspacing='0' bordercolor='#465461'> remove the height from the above line <table width='207' valign='top' border='1' cellpadding='0' cellspacing='0' bordercolor='#465461'> then try.if you want to specify the height..do it in <TR> tags. Regards, Joshi.
  20. Replace this code [code] if(!$result){     echo "<p style=\"color:#CC0000;\" align=\"center\"><b>Error: </b>Could not update the investment tip database. </p><p align=\"center\"> Click the BACK button in the browser to go back or click <a href=\""investment_tip_manager.php">here</a> to start all over.</p>";     exit; } [/code] with this code [code] if(!$result){     echo "<p style=\"color:#CC0000;\" align=\"center\"><b>Error: </b>Could not update the investment tip database. </p><p align=\"center\"> Click the BACK button in the browser to go back or click <a href=\" investment_tip_manager.php\">here</a> to start all over.</p>";     exit; } [/code]
  21. Check Mcrypt Encryption Functions  in PHP manual.There are lot of function to encrypt and deccrypt the data. Regards, Joshi.
  22. No, Just create a file with the code, then execute in the server where you are facing this problem. [code] <?php phpinfo();//which will display all the php settings. ?> [/code] Regards, Joshi.
  23. magallforever, It is always best to print the errors to browser (in testing servers) when you are executing a query. Try to run this code and check what are the erros it is showing. [code] <?php $connection = mysql_connect(localhost,zack_rpg,omfgg212) or die ('Connection Failed'); $db = mysql_select_db(zack_rpg,$connection) or die ('Db selection failed'); $sql111 = "SELECT * FROM stats WHERE id='$_COOKIE[id]' ";//Put it in single quotes if it is a number. $res454 = mysql_query($sql111) or die ($sql111.":".mysql_error()); $res1 = mysql_fetch_array($res454); $mana = $res1[mana]; $level = $res1[level]; $ladd = $level * 20; if($mana < $ladd){ $sql = "UPDATE stats SET mana = $mana + 2"; $result = mysql_query($sql); }else{ die(); }; ?> [/code] Regards, Joshi.
  24. First get the IP address of the user and then assign it to a variable. [code] <?php $domain = GetHostByName($REMOTE_ADDR); ?> [/code] pass this value to a  hidden variable. [code] <input type="hidden" name="domain" value="<?php echo $domain;?>" [/code] when u submit the form this value is also getting passed. so u can use there.. another option is , storing IP address in a session variable. so you can use any where in your scripts.
  25. I will suggest to store in different variables. bcoz it will be flexible for further processing of the values.
×
×
  • 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.