Jump to content

Paul-D

Members
  • Content Count

    31
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Paul-D

  • Rank
    Member
  1. Hi I call a function with values of 51 and 100 but the function receives values 1 and 50 <?php // EmilyMoor Version 1.0.0 05-07-2019 Desmond O'Toole. ini_set('display_errors', 1); error_reporting(E_ALL); require("../secure/SecureFunctions.php"); require("secure/SecureFunctionsEmilyMoor.php"); $page = "Emily Moor"; session_start(); $Browser = $_SERVER['HTTP_USER_AGENT']; if (!isset($_SESSION["PageValue"])) $_SESSION["PageValue"] = '1'; $_SESSION["PageValue"] = 2; // Keeps going back to 1 if($_SESSION["PageValue"] == 1) { $_SESSION["StartValue"] = 1; $_SESSION["EndValue"] = 50; } if($_SESSION["PageValue"] == 2) { $_SESSION["StartValue"] = 51; $_SESSION["EndValue"] = 100; } if($_SESSION["PageValue"] == 3) { $_SESSION["StartValue"] = 101; $_SESSION["EndValue"] = 150; } if($_SESSION["PageValue"] == 4) { $_SESSION["StartValue"] = 151; $_SESSION["EndValue"] = 200; } if($_SESSION["PageValue"] == 5) { $_SESSION["StartValue"] = 201; $_SESSION["EndValue"] = 250; } if($_SESSION["PageValue"] == 6) { $_SESSION["StartValue"] = 251; $_SESSION["EndValue"] = 300; } echo $_SESSION["PageValue"] . " - " . $_SESSION["StartValue"] . " - " . $_SESSION["EndValue"] . "<br>"; $qStationDetails = GetChanelInfo($_SESSION["StartValue"],$_SESSION["EndValue"]); $rs = mysql_fetch_array($qStationDetails) or die ("E3001-101A"); $Name = $rs['Description']; ?> function GetChanelInfo($StartCH, $EndCH) // E2004 { echo "Channels = " . $StartCH . " " . $EndCH . "<br>"; // values are 1 and 50 $sqlChanelInfo = "SELECT * FROM TV_EmilyMoor WHERE ID >= $StartCH and ID <= $EndCH"; echo $sqlChanelInfo . "<br />"; $qChanelInfo = mysql_query($sqlChanelInfo) or die ("E3004-01A"); return $qChanelInfo; }
  2. No that doesn't always work. If websites use Name="Name" for an input form which they do. You can get auto complete to work the wrong way. I don't want to turn off auto complete. As for To have a variable name value means a headache for your receiving script which has to figure out what to call that specific field when having simple static values is so much easier. $Comment_Name = $_SESSION['COMMENT_NAME']; $Comment = $_POST[$Comment_Name];
  3. ginerjm seems to have done this. What I have been doing is using a variable into the name of the text box. This has worked before. I use dechex(time()) and use this as the name. The reason is that some of the older web pages got screwed up by a web browser trying to artificial intelligent and complete what I am entering based on the name of the text box. I then store the name in a session variable so the update page can use it for the name of the text box. Hope this makes $Comment_Name = dechex(time()); $_SESSION['COMMENT_NAME'] = $Comment_Name; and for the text box <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name?>"; value="<?=$SE_Comment?>"> This has worked before but can't work out how I did it.
  4. I have a text box on page 1 that has a unique changing value using $Comment_Name = dechex(time()); $_SESSION['COMMENT_NAME'] = $Comment_Name; // Lines 42/43 Comment&nbsp;&nbsp;&nbsp;&nbsp; <input type="text" maxlength="32" size="42" name= "<?=$Comment_Name?>"; value="<?=$SE_Comment?>">&nbsp;&nbsp;Max 32 Characters As the name of the text box is stored in a session variable then it should be a simple mater of retrieving the value on page 2. /****************************/ $CommentID = $_SESSION['COMMENT_NAME']; if($direction == "Add record") { $Comment_Name = $_SESSION['COMMENT_NAME']; $_SESSION['DE_MyReason'] = $_POST['Reason']; // Keep the default regardless $_SESSION['DE_Money_In'] = $_POST['MoneyIn']; $_SESSION['DE_Money_Out'] = $_POST['MoneyOut']; $_SESSION["DE_DD_Entry"] = $_POST['DD_Entry']; $_SESSION["DE_MM_Entry"] = $_POST['MM_Entry']; $_SESSION["DE_Comment"] = $_POST[$CommentID]; /* This should retreve the posted value */ Any help on this please?
  5. Hi I want the border to be red not the entire contents <div style="width:650px;height:230px;padding:10px;border:solid;color:red;"> Des </div>
  6. Cant close this topic. Wanted to but have a new problem. When I look at the page in google chrome I get This page isn’t working ... ERR_TOO_MANY_REDIRECTS But works fine in firefox. I am not doing any redirecting only if I haven't logged in then back to the log in page.
  7. www.desmond-otoole.co.uk/secure/securefunctions.php /bank/admin/index.php what should I do in the index.php file to access securefunctions.php require("../secure/SecureFunctions.php"); require("../../secure/SecureFunctions.php"); require("www.desmond-otoole.co.uk/secure/SecureFunctions.php"); Nothing seems to work I just get a stupid google chrome page saying This page isn’t working
  8. Thanks echo date('Y-m-d', strtotime('first day of last month')); is beeter than $date = new DateTime('first day of last month'); But how do I get a php.ini into the system for future class related programming I have [Date] date.timezone=Europe/London Will it be picked up automatically or as a shared server be ignored?
  9. Do I relay have to do all this in PHP 5.0? <?php $Date = time(); $Month = date('m' ,$Date); $Year = date('Y' ,$Date); $Month -= 1; if ($Month == 0) { $Month = 12; $Year -= 1; } $Date = $Year . "-" . $Month . "-01"; echo $Date; ?>
  10. would CURDATE() + INTERVAL 5 DAY take me back to the first of the previous month. In this case 1st December 2018 ? ? ? ? ?
  11. $get_date->modify('-30 days'); I could just as well do $date = time() $diff = 60*60*24*30; $date = $date - $diff; However if it was the 31st of the month this would not take me to the previous month.
  12. I have created a php.ini file and added it to the website root contents [Date] date.timezone=Europe/London
  13. I have never used a php.ini file and don't know how it is implemented. Can I not use $date = new DateTime('first day of last month', "Europe/London"); or do I just create a file php.ini in the www root of my website with the lines [Date] date.timezone=Europe/London
  14. Using your code supplied I get Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/class.php:6 Stack trace: #0 /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/class.php(6): DateTime->__construct('first day of la...') #1 {main} thrown in /vhost/vhost15/d/e/s/desmond-otoole.co.uk/www/class.php on line 6
×
×
  • 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.