Jump to content

Notretsam

Members
  • Posts

    144
  • Joined

  • Last visited

Everything posted by Notretsam

  1. After thinking about it more there, am now thinking its what justanotherguy said (an Ingolme eluded to), the parse error isn't triggering any code, so the date error is a result off the second error. If there was an actual error with the date timezone, then it would always show up as a single error I would think. You's know how to wrap paragraph tags around each error reported on a page? below code is what I use but bit of a pain with the date error showing up. ini_set('display_errors', 1); error_reporting(E_ALL);
  2. I deliberately did the error, so I can see the date error , I put plain text instead of a variable in sql query , so "Var" instead of "$Var" The error is only out putted by PHP when there a 2nd error, you would think it always show up if it was an actual error, if that makes sense. Maybe it is something in php.ini but I don't touch that file. so if it is misspelled, then that be hosting company then. Maybe I need to contact them.
  3. That code doesn't show anything dsoneuk All I see is below, line 116 is the sql bind line in code. Warning: Unknown: 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 admengine.php on line 116 /* this second error ignore, above only shows up when there's a 2nd error on page */ Parse error: syntax error, unexpected '$matchIDpone' (T_VARIABLE) in admengine.php on line 116
  4. thanks dsoneuk , I give that a go and see what it says.
  5. Ingolme this is what I get using php error coding 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.
  6. yeah I put it at top of any file that uses date but still getting the error far as I know there shouldn't be anything wrong with this but still shows the error seen in OP. <?php date_default_timezone_set("Europe/London"); /* then rest of page code below it */ ?> I should add that when there not a 2nd error on page, it doesn't show then, but always shows up along side a 2nd error, which is very weird.
  7. I keep getting the below error, I know its related to the date timezone and I need to add it to page. However, for some reason adding date_default_timezone_set("Europe/London"); to page doesn't get rid of error any ideas on what code I can use to get rid of this annoying error. 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.
  8. no kidding, first time I ever got someone in live chat that wasn't very good.
  9. yup just figured that out about 5 mins ago lol its funny I went to my hosting live chat about a issue earlier, turns out they upgraded our PHP version from 5.2 to 5.5 without telling me so all of a sudden I had errors galore on my website, starting with the date issue which showed up on firefox but not chrome , then everything on my site went to after that, and now I got a lot of error fixing as turns out I need to use 5.5 at least now.
  10. my website works perfectly on chrome and other browsers, but was checking something and went on firefox, an discovered this outputted error. 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. what is fireforx problem with using date(); and this nonsense about setting a timezone and not using systems timezone.
  11. I am aware that they different , I always find PHP much easier to work with but first coding language I ever worked with, was mIRC scripting which is similar to PHP. Also aware off view source, don't like that javascript code showing up on it, but love that PHP doesn't. Can do some cool stuff with javascript, but I only ever use it after I go searching on how to do something and find a javascript answer before PHP. Even then, I try and find a way to get the javascript over to PHP, then do what I want to do.
  12. edited above post and moved quotes outside, would that be right for text string?
  13. ah I see, could I maybe do something like below, which I highly doubt <script type="text/javascript"> var btype = "<?php echo $btype ?>"; </script> as I said, doubt that work but just curious I got it working fine with just using number sequences and that sufficient for what am doing.
  14. thank you Ingolme, got it working Instead of setting $btype as "show" or "event" , I setting it as "1" or "2" also instead of setting $eventCurrhistid as "blank" , am setting it as "1" $eventid is always a 14 digit number, so why that always worked. Didn't realize it had to be numbers instead of letters/words being passed, seems a bit weird to me. thanks for the help.
  15. OK checking F12 , I see this when I go to "Console" 4content.js:191 NO OEMBED setupshow.php?corpid=1234698567:74 Uncaught ReferenceError: show is not defined setupshow.php?corpid=1234698567:97 Uncaught ReferenceError: show is not defined setupshow.php?corpid=1234698567:120 Uncaught ReferenceError: blank is not defined setupshow.php?corpid=1234698567:134 Uncaught ReferenceError: blank is not defined setupshow.php?corpid=1234698567:120 Uncaught ReferenceError: blank is not defined setupshow.php?corpid=1234698567:134 Uncaught ReferenceError: blank is not defined the "show" and "blank" are potential values in the last two variables listed in the onclick event $btype = "event"; if ( $eventCurrhistid == "" ) { $eventCurrhistid = "blank"; } echo " <div class='contframe' onClick='gotoshow($eventid,$btype,$eventCurrhistid)'> I hope that makes sense to you, if not I'll start again and explain what am doing.
  16. I don't understand how you can't see the variables are filled with information from a mysql database table row, so its random. /* this is taken from view source */ <div class='contframe' onClick='gotoshow(14680020425539,event,)'> /* this is the actual code */ <div class='contframe' onClick='gotoshow($eventid,event,$eventCurrhistid)'> I will need to check if $eventCurrhistid is blank and set something in that variable it appears. As I stated in original post , below coding has always worked for me. <div class='contframe' onClick='gotoshow($eventid)'> <script type="text/javascript"> function gotoshow($sids) { var x=$sids; var bocorp = document.getElementById('bocorp').value; window.location.href = "showsetup.php?showid=" + x + "&corpid=" + bocorp; } </script> Just never been able to get it working when passing more than one variable across to the function, always been able to work around that until now.
  17. Don't know how seeing the full coding going help , as its just a normal prepare/bind sql query to get the information in variables. <?php /* create a prepared statement */ $stmtcommedit = $conn->prepare("SELECT eventid, eventName, eventImage, eventSize, eventStatus, eventCurrhistid, eventDesc, GMtype, eventGMmain, eventGMupper, eventGMmidcard, eventGMlower, eventGMopener, eventdivimain, eventdiviupper, eventdivimidcard, eventdivilower, eventdiviopener FROM companyEvents WHERE corpid=?"); /* bind parameters for markers */ $stmtcommedit->bind_param("s", $corpid); /* execute query */ $stmtcommedit->execute(); $stmtcommedit->store_result(); $eventcount= $stmtcommedit->num_rows; /* bind result variables */ $stmtcommedit->bind_result($eventid, $eventName, $eventImage, $eventSize, $eventStatus, $eventCurrhistid, $eventDesc, $GMtype, $eventGMmain, $eventGMupper, $eventGMmidcard, $eventGMlower, $eventGMopener, $eventdivimain, $eventdiviupper, $eventdivimidcard, $eventdivilower, $eventdiviopener); while ($row = $stmtcommedit->fetch()) { /* checking if person viewing the page is listed as GM for event */ if ( $visitID == "$eventGMmain" ) { $dispeve = "yes"; } elseif ( $visitID == "$eventGMupper" ) { $dispeve = "yes"; } elseif ( $visitID == "$eventGMmidcard" ) { $dispeve = "yes"; } elseif ( $visitID == "$eventGMlower" ) { $dispeve = "yes"; } elseif ( $visitID == "$eventGMopener" ) { $dispeve = "yes"; } /* end off checking if person viewing the page is listed as GM for event */ if ( $dispeve == "yes" ) { $eventDesc = stripslashes("$eventDesc"); if ( $eventImage == "" ) { $eventImage = "No Image Set"; } else { $eventImage = "<img src='$eventImage' alt='$eventName'>"; } echo " <div class='contframe' onClick='gotoshow($eventid,event,$eventCurrhistid)'> <h2>$eventName</h2><br> <table class='container'> <tr> <td id='showleftcol'> <p class='centertext'>$eventImage</p> <p class='lefttext'>$eventDesc</p> </td> <td id='showrightcol'> <p class='centertext'><h2>Event Size</h2><br>$eventSize</p> </td> </tr> </table> </div><br>"; } } ?> <script type="text/javascript"> function gotoshow($sids, $booktype, $histid) { var x=$sids; var bocorp = document.getElementById('bocorp').value; var fshowhistid = $histid; var fbooktype = $booktype; window.location.href = "showsetup.php?showid=" + x + "&corpid=" + bocorp + "&histid=" + fshowhistid + "&btype=" + fbooktype; } </script>
  18. $showid and $showhistid are set via a database query before the output you see. the "show" isn't a variable (I wonder if that causing the problem, but doubt it)
  19. am a novice with javascript but really don't see why this code isn't working. this is the trigger, person clicks on the area and page changes over to a new page <div class='contframe' onClick='gotoshow($showid,show,$showhistid)'> below is the function <script type="text/javascript"> function gotoshow($sids, $booktype, $histid) { var x=$sids; var bocorp = document.getElementById('bocorp').value; var fshowhistid = $histid; var fbooktype = $booktype; window.location.href = "showsetup.php?showid=" + x + "&corpid=" + bocorp + "&histid=" + fshowhistid + "&btype=" + fbooktype; } </script> I can always get the onclick event to work with just passing one var across, but never been able to get more than one var passed across.
  20. thank you, I took a note of that and remember it in future, working on something else now, most likely change over to it at some point, but not a big hurry.
  21. You know like a form select field, the value could be the corp id and the output is the name? I did get an ID outputted with the name results, but sadly it didn't correctly match the result. Just went back to name only and it is working , even with quotes in the outputted result. Was thinking, if I could still get the results via the search query, but actually have the ID sent over instead of name, it make life easier when people use single or double quotes.
  22. drat, turns out that code doesn't work to well moved it over to another area and turns out it will attach wrong id to name, if you type "O" in field , it adds an id but could be id related to any info with the O.
  23. lol love when coding makes you feel like an idiot Had this all working when I posted this, but went to make a change yesterday when I been awake for around 18 hours, never a good idea, so messed it up. Went back to it after a power nap, one of my first thoughts "Instead of sending the company name over, why don't I send the company ID over" would have saved myself a lot of trouble if I had thought of that sooner lol now have below code working , so no longer matters if people put quotes in there company names. <?php /* database connection code here */ /* create a prepared statement */ $stmtgethintcorp = $connfizzleshizzle->prepare("SELECT companyID, companyName FROM companyDirectory ORDER BY companyName"); /* execute query */ $stmtgethintcorp->execute(); $stmtgethintcorp->bind_result($companyID, $companyName); /* fetch value */ $id = "1"; while ($row = $stmtgethintcorp->fetch()) { $a[]="$companyName"; $corpid[$id] = "$companyID"; $id++; } // get the q parameter from URL $q=$_REQUEST["q"]; $hint=""; $i = "0"; // lookup all hints from array if $q is different from "" if ($q !== "") { $q=strtolower($q); $len=strlen($q); foreach($a as $name) { if (stristr($q, substr($name,0,$len))) { if ($hint==="") { $i++; $hint="<a href='?corpid=$corpid[$i]'>$name</a><br>"; } else { $i++; $hint .= "<a href='?corpid=$corpid[$i]'>$name</a><br>"; } } } } /* close statement */ $stmtgethintcorp->close(); // Output "no suggestion" if no hint were found // or output the correct values echo $hint==="" ? "no suggestion" : $hint; ?>
  24. I presume I replace who's Peter with $name off to try and thank you dsoneuk
×
×
  • Create New...