Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About 190319m9

  • Rank
  • Birthday 03/19/1989

Previous Fields

  • Languages

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
    New Delhi
  1. But I think changing ($y) to "$y" will render it as a string variable. Or may be we should find out a way of printing value of $y instead of using ($y) or "$y".
  2. You should spacify proper margins in your stylesheet. This will solve your problem considerably. Specification of margins will prevent overlapping of different sections. Floats can also be used.
  3. Initial Page Code <?php $con=mysql_connect("localhost", "root", "discreet"); if (!$con) { die ('Error : ' . mysql_error()); } mysql_select_db("hitcounter", $con); $initial_value = mysql_query("SELECT * FROM test_hit_counter"); while ($carried = mysql_fetch_array($initial_value)) { $y = $carried['hits'] + 1; } mysql_close($con); setcookie("hit", ($y)); ?> Is this code for generating a cookie is OK? Final Page Code <?php $con=mysql_connect("localhost", "root", "discreet"); if (!$con) { die ('Error : ' . mysql_error()); }
  4. Finally got it. Thanks for the advice. And yup Ingolme, found those errors, just typed in haste.
  5. <?php echo date("H") . "<br />"; $H=date("H"); if ($H>5 && $H<12) echo "Good Morning"; elseif ($H=12) echo "Good Noon"; elseif ($H>12 && $H<4) echo "Good Afternoon"; elseif ($H>4 && $H<8) echo "Good Evening"; else echo "Good Night"; ?> Is it must to declare time as a variable? Can't we use the date tie function directly to compare with the numerical values? Tried that but code doesn't work in that case.
  6. 190319m9

    File Upload.

    The page does not runs any scripts and shows a completely blank page. Probably a minor syntax error.And yes that code describes file formats and upload size limit, but it verifies it with the uploaded only after the file upload is complete on execution of action attribute of the form tag on the file upload page.
  7. 190319m9

    File Upload.

    <?php if (((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg") || ($_FILES["file"]["type"] == "image/png")) && ($_FILES[["file"]["size"] < 20*1024*1024)) { if ($_FILES["file"]["error"] > 0) { echo "Error : " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload : " . $_FILES["file"]["name"] . "<br />"; echo "Size : " (.$_F
  8. 190319m9

    Just Little Fun!

    Please check this page - My PHP playgroundTried some basic PHP snippets for the first time and it is already on my mind. Loving it.
  9. Thanks for the replies. Got the point. Quite fundamental, will be in memory forever now! Mistakes teach you in a very good way.
  10. Whats the error in this snippet?? <?php$d=date("H");if ($d>"19" && <"22")echo "Good Morning!";elseif ($d>"00" && <"04")echo "Good Afternoon!";elseecho "Enjoy, your time.";?>
  11. It works now. Thanks!
  12. <?php$txt1="Document generated at - ";$txt2="Enjoy!";echo $txt1 . " " . date("H:i:s T.")+15*60*60 . " " . $txt2;?> So this code should work! But it simply shows the numerical calculation followed by $txt2 like - "54000 Enjoy! "
  13. I publish my site on a server in a different time zone and sometime even dates are also different in both the zones. How can I modify the time stamp to show time and date of my region only? Please provide some examples.
  14. <?phpif (date("H")>"19" && <"22") echo "Good Morning!"; elseif (date("H")>"00" && <"04" && date("i")<"30") echo "Good Afternoon!"; else echo "Enjoy, your time."; ?>
  15. Well there is no need of using <p> or <br> tags. What you need is to properly nest div tag with desc class in div tag with img class. If you do this properly the output will be as in w3schools examples. Do you want a new text paragraph (not the description part) to come below the image rows? If yes then you will need to define some new div ids which ensure proper alignment of the content.
  • Create New...