Jump to content

redarrow

Members
  • Posts

    7,306
  • Joined

  • Last visited

Everything posted by redarrow

  1. so $john="john"; $john="male"; adding the first douler sign gives john and then john turns into another varable to add $john as male. i think i go that right thank you. [!--sizeo:6--][span style=\"font-size:24pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--] correted echo $$john;
  2. if($submit) { insert code } try good luck
  3. Can someone exspaian what the double varable varables doller sign for, and how to use it, An example would be grate cheers. examples //assign a varable is $john='house'; //echo varable is echo $john; // how to use this double varable method please thank you. $$whatever Advance thank you
  4. i found a good object link for you good luck. [a href=\"http://www.osix.net/modules/article/?id=774\" target=\"_blank\"]http://www.osix.net/modules/article/?id=774[/a]
  5. I hope this works for you. an example ok [code] <?php if($go == "1") { mysql_connect("host","username","password"); mysql_select_db(databaseName); $sql = @mysql_query("SELECT * FROM table WHERE username='$name' && email='$email' "); if(!$sql) { echo "The user name and email do not match."; exit; } $query = mysql_query($sql); $fPass = mysql_fetch_array($query); mail($email, "Your Password", "User Name: ". $fPass[username] ."\nPassword: ". $fPass[password]); echo "Your Password has been sent to ". $email ."."; } ?> <form action="<?= $PHP_SELF ?>" method="post"> Name: <input type="text" name="name" size="24" border="0"><br> E-mail: <input type="text" name="email" size="24" border="0"><br> <input type="hidden" name="go" value="1" border="0"><input type="submit" name="submitButtonName" border="0"> </form> [/code] good luck.
  6. How can i get this to update when you enter a page automatickly thank you so much. [code] <? $sql_host =   'xxx';  //add host information here (localhost, mysql.host.com, etc.) $sql_un   =   'xxx';  //add your user name here $sql_pass =   'xxx';  //add your password here $sql_db   =   'valadate';  //add your database name here mysql_connect("$sql_host", "$sql_un", "$sql_pass") or     die ("Could not connect to database"); mysql_select_db($sql_db) or     die ("Could not select database"); do { $random_min = 1; // change to your min $random_max = 2; // change to your max. $rand_no = rand($random_min, $random_max); $updatedb = mysql_query("UPDATE `valadate` SET `var` = $_post($rand_no!)"); } while(mysql_affected_rows() === 0); echo $rand_no; ?> [/code]
  7. thank you for the code but i got a error please help someone cheers. This line. } while(mysql_affected_rows() === 0); [code] <? $sql_host =   'xxx';  //add host information here (localhost, mysql.host.com, etc.) $sql_un   =   'xxx';  //add your user name here $sql_pass =   'xxx';  //add your password here $sql_db   =   'valadate';  //add your database name here mysql_connect("$sql_host", "$sql_un", "$sql_pass") or     die ("Could not connect to database"); mysql_select_db($sql_db) or     die ("Could not select database"); do { $random_min = 1; // change to your min $random_max = 200; // change to your max. $rand_no = rand($random_min, $random_max); $updatedb = mysql_query("UPDATE `validate` SET `var` = $rand_num!); } while(mysql_affected_rows() === 0); echo $rand_no; ?> [/code]
  8. So what i am trying to do is get a random number to be in the database and change each time a user goes to that page via the update statement but also show the user that random number. hopefully if you press the refresh button a random number will come up diffrent but also entred in the database to one colum thanks. This will display a 8 digit number. [code] <?php //post rand_pass $rand_pass=$_POST['var']; // create a random number $length    = 8; $key_chars = '0123456789'; $rand_max  = strlen($key_chars) - 1; for ($i = 0; $i < $length; $i++) {    $rand_pos  = rand(0, $rand_max);    $rand_key[] = $key_chars{$rand_pos}; } $rand_pass = implode('', $rand_key); // show the random number to the user. echo $rand_pass; // insert into the database the first random number $query = "insert into  valadate values( '$var')"; $results = mysql_query($query) or die("Failed on query!"); // check the number in the database to the one displayed and update with new number. else{ $check_ver=mysql_query("SELECT * FROM valadate WHERE var='$rand_num' "); if(mysql_num_rows($check_var = '$rand_num') ){ UPDATE valadate SET var = $rand_num; } } ?> [/code] Someone kindly give an example how to update a random number on a singles field and then display it and make it change on one field in the database and also change the number each time the page is called. advance thank you.
  9. To call switch code to other pages [code] <? include("whatever.php"); ?> [/code] Page name whatever.php [code] <? if ($page == ""){ $page = 0; } $next = $page+1; $previous = $page-1; switch ($page) { case 0: $content = "home.htm"; break; case 1: $content = "company.htm"; break; default: $content = "home.htm"; break; } ?> [/code]
  10. I got the function to work but is it the correct way thank you. [code] <?php function counting($count) { $sql_host =   'xxxx';  //add host information here (localhost, mysql.host.com, etc.) $sql_un   =   'xxxx';  //add your user name here $sql_pass =   'xxxx';  //add your password here $sql_db   =   'freedating';  //add your database name here mysql_connect("$sql_host", "$sql_un", "$sql_pass") or     die ("Could not connect to database"); mysql_select_db($sql_db) or     die ("Could not select database"); $q = "select count(*) as num_msgs from membercomments WHERE id=$id"; $res = mysql_query($q) or die('Problem with query: ' . $q . '<br>' . mysql_error()); $rw = mysql_fetch_assoc($res); echo $rw['num_msgs']; } echo $count ?> [/code]
  11. Can you kindly take a look, I got the function in the correct order of code but know i get a database error, But without the function the code is correct, What can you see wrong please thank you. [code] <?php $sql_host =   'xxxx';  //add host information here (localhost, mysql.host.com, etc.) $sql_un   =   'xxxx';  //add your user name here $sql_pass =   'xxxx';  //add your password here $sql_db   =   'freedating';  //add your database name here mysql_connect("$sql_host", "$sql_un", "$sql_pass") or     die ("Could not connect to database"); mysql_select_db($sql_db) or     die ("Could not select database"); function counting() { $q = "select count(*) as num_msgs from membercomments WHERE id=$id"; $res = mysql_query($q) or die('Problem with query: ' . $q . '<br>' . mysql_error()); $rw = mysql_fetch_assoc($res); echo $rw['num_msgs']; } counting() ?> [/code] This is the error i get but only in the function method overwise no error. [code] Problem with query: select count(*) as num_msgs from membercomments WHERE id= You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 [/code]
  12. Thank you ken How can i put this in a function and echo the funtion were i want it cheers. my example [code] <?php function counting(); { $q = "select count(*) as num_msgs from messages WHERE id=$id"; $res = mysql_query($q) or die('Problem with query: ' . $q . '<br>' . mysql_error()); $rw = mysql_fetch_assoc($res); echo $rw['num_msgs'];   } counting(); ?> [/code]
  13. I was using this code the member has only got 1 message but i receve 18 please help thank you. [code] <?php $sql_host =   'xxxx';  //add host information here (localhost, mysql.host.com, etc.) $sql_un   =   'xxxx';  //add your user name here $sql_pass =   'xxxx';  //add your password here $sql_db   =   'xxxx';  //add your database name here mysql_connect("$sql_host", "$sql_un", "$sql_pass") or     die ("Could not connect to database"); mysql_select_db($sql_db) or     die ("Could not select database"); $res = mysql_query("select * from membercomments WHERE id='$id'"); $row = mysql_fetch_array($res); echo count($row); ?> [/code]
  14. Hi there can you help please i want to count the number of messages a user has and echo that number cheers example thank you. Example but needs help. [code] <?php $res = mysql_query("select * from messages WHERE id=$id") $row = mysql_fetch_array($res); echo count($row);   echo $row[0]; echo count($row); ?> [/code]
  15. Hi there i read your post, and i understood what i could, You sate that when a user sends a email message with out a attachment the message dosent have no relavent information within the mail message. but if the user does attach a file you get all the inforation needed i think this is correct ok. The users that use the mail script will have to be the ones that are a members to your website or all the requast information in your code not work. Try to logon as a user then just press submit you should receve all the requst information becouse your loged in as a user tyr that first then post your findings. Make sure that users sendind messages are the users that are logged as a member to your website ok. good luck.
  16. Hi there all has there been a change in the search engines on msn and google i can not seem to find my web site. Does anyone know if the bot structure has changed on the search engine of msn and google thank you. my code is in php and i have the header in html for the metatags and always got good results is there a change thank you.
  17. i wont to select the member vdate vtime and vote from the database in that order how please $query = ("SELECT vote,member,vdate,vtime,id,session FROM s "); $result = mysql_db_query("freedating",$query); while(list($vote,$member,$vdate,$vtime,)=mysql_fetch_row($result)){
×
×
  • 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.