Jump to content

Giri J

Members
  • Posts

    20
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Giri J's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Guys, Anyone tried moving a forum from ccBoard to phpBB ? Any help would be greatly appreciated. Thanks a lot in advance.
  2. Hi, this is a simple thing I used. If the user is inactive 10 mins I will log him out. <?php $_session['timein']=time(); $maxTime = 600; // this is 10 mins in secs. $tot_time = time() - $_session['timein']; if($tot_time > $maxTime) { session_destroy(); header("Location: logout.php"); } ?> I check this on every page. This might now be the exact code but I've just put whatever is on my mind. hope it makes sense. Cheers
  3. Brilliant Calver... this works .... Thanks a lot for the help .... :)
  4. I forgot one thing sorry. It works with datatype "datetime"
  5. Hi I usually update the date using now() function like this $qrydate = mysql_query("INSERT INTO table (date) VALUES (now()) WHERE id = $id"); now() is a mysql function. when u execute the query it will automatically updates the date and time. By the way can we use a where clause in insert ?? Please lemme know. thanks
  6. Hello All, I have a problem with my update query. The insert query works fine with all the values. But when I use the update query it throws me error. I'm stuck. please help. Here is my update query in php $q1="update vehicle SET vdesc='$vDesc',SET vimg='$vImg1',SET user='$uid',SET log=now() where vname='$vName'"; Here are my values (retrieved from form): $vDesc=This is my vehicle test $vImg1=1.jpg $uid=test $vName=My Car Model 000T Here is the error message: 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 'SET vimg='1.jpg',SET user='test',SET log=now() where vname='My Car Model 000' at line 1 Please help... Thanks a lot in advance.
  7. Hi, You mean to say I have to request the support guys to configure smtp in php config to some gmail servers or something? Please let me know. thank you
  8. Hi, I'm not sure if it works for you. But try echoing the html a tags and just use 1 php close and open. eg: <?php ...some code if (true) echo "<a href=\"true.html\"">True</a>"; else echo "<a href=\"false.html\"">False</a>"; ...some php code ?>
  9. Hello Guys, I'm trying out on the mail function. I've created my website and added a contact form. Now I want the contact details to come to my gmail id. I've written the following code. ---------------------------------------------------------------------------------------- <?php $to = "g.mymails@gmail.com"; $subject = "Test My Code"; $name_field = $_POST['cName']; $email_field = $_POST['cEmail']; $from = "Contact Form"; $message = $_POST['comments']; $ph=$_POST['cPh']; $cLoc=$_POST['cLoc']; $body = "From: $name_field\n E-Mail: $email_field\n Phone: $ph\n Country: $cLoc\n Message:\n $message"; echo "Data has been submitted to $to!"; mail($to, $subject, $body, "From: $from") ?> ---------------------------------------------------------------------------------------- When I tried the code on my local it threw a error saying some smtp problem. Later I uploaded the same code onto my server. I didn't see any errors but at the same time I didn't receive any data in my gmail inbox. I've tried searching old threads but it didn't help. Did I miss something? I don't know. Please Help. Thanks in Advance.
  10. The following code perfectly works. u ROCK man \m/. tons and tons of thanks to ya and thank you every one for your super fast responses. much much appreciated
  11. Hi guys, That's like a rocket response. Here is my test code. <?php //Connections mysql_connect("localhost", "root", "giri") or die(mysql_error()); mysql_select_db("hexl_data") or die(mysql_error()); //Get Week No. //$wkno=$_POST['wkno']; //Mysql Querys $qry1="select distinct (coder) from daily_reports where week_no=2"; $exeQ1=mysql_query($qry1) or die ("Q1 :: Error ::: ".mysql_error()); $num1=mysql_num_rows($exeQ1); //Result set if($num1<1) { echo "Unable to retreive data. Please try again."; } else { while($rows = mysql_fetch_array($exeQ1, MYSQL_ASSOC)) { echo "Coders:".$rows['Coder']; } } ?> and here are my errors: Notice: Undefined index: Coder in D:\wamp\www\Reports\qau\test.php on line 25 Coders: Notice: Undefined index: Coder in D:\wamp\www\Reports\qau\test.php on line 25 Coders: Notice: Undefined index: Coder in D:\wamp\www\Reports\qau\test.php on line 25 Coders: Notice: Undefined index: Coder in D:\wamp\www\Reports\qau\test.php on line 25 Coders: Let me know if anything is confusing. Cheers G.
  12. Hi, My code is as follows: $qry1="select distinct (coder) from daily_reports where week_no=$wkno"; $exeQ1=mysql_query($qry1) or die ("Q1 :: Error ::: ".mysql_error()); $num1=mysql_num_rows($exeQ1); I need some help / syntax on how to retrieve the results of mysql query (select distinct (coder) from daily_reports where week_no=$wkno) The query is working fine on mysql it retrieves 4 rows. I want to know how to get the results in php. I tried mysql_fetch_array(). I get the following error: Notice: Undefined offset: 1 in D:\wamp\www\Reports\qau\processGU.php on line 27 I tried searching but didn't exactly get the relevant solution. Please post if there are any existing threads. Thank you very much ! Cheers G.
  13. Hi, I'm trying curl. I was successful when I worked it on my laptop. But when I bought the files to office and tried to run the php it gives me a error "couldn't connect to host " What could be the reason and Is there any solution. i'm using wamp 2.0 Thanks in advance Giri.
  14. that's alright It was great you actually took time and replied me. Thank you. Have a good day.
  15. Hi Maq, Thanks a lot for the help. I've just made some experiments based on the change you told and went through the following link http://www.phpfreaks.com/forums/index.php/topic,216783.0.html and finally my problem is solved. now I generate 100 text fields and I'm able to get all the data in one shot thanks PHP Freaks ! If some one out there having some similar problem like mine here is the solution. MY HTML CODE : (Dynamic Form using JS for generating the textfields) <html><head> <title>My Test Page - Giri JS + PHP + Bynamic Form it works</title> <script type="text/javascript"> function addFieldz() { var i = document.getElementById('rows').value; alert ("i val = "+i); while (i > 0) { txtFields.innerHTML = txtFields.innerHTML+"<br><input type=\"text\" name=\"t[]\" id=\"t[]\" \/><br/>"; i--; } } </script></head> <body> <form method="post" action="test-js-php.php"> No. of Text Fields: <input type="text" name="rows" id="rows" style="width:30px;"> <input type="button" onClick="addFieldz()" name="add" id="add" value="Add"> <div id="txtFields"> </div> <br/> <input type="submit" name="submit" id="submit" value="submit"> <input type="reset" name="reset" id="reset" value="reset"> </form> </body></html> MY PHP CODE: <?php $num = $_POST['rows']; //echo "<br/>num val outside - ".$num; while ($num > 0) { //echo "<br/>num val in while - ".$num; echo "<br/>form value: ".$_POST['t'][$num-1]."<br/>"; $num--; } ?> Hope this helps someone. A 100,000 thanks to Maq and 1,000,000,000 thanks to PHP Freaks ! Giri.
×
×
  • 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.