Jump to content

Don E

  • Content count

  • Joined

  • Last visited

  • Days Won


Don E last won the day on March 14 2016

Don E had the most liked content!

Community Reputation

122 Excellent

About Don E

  • Rank
    Invested Member
  • Birthday November 3

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  • Location

Recent Profile Visitors

17,564 profile views
  1. Problem in calling static and non static method

    Function select is not defined as a static method. PHP gave the error because select is not a static method and when trying to access a non static method, you need to create an object for it, for that class to access that method. When not, like in your code, you're using $this as a non object resulting in the fatal error. getInstance is a static function thus why it worked.
  2. Rule being ignored

    Well, I was just offering a quick solution to try. I would comment out all the rewrite conditions and rules that are not of concern at first and work only with the non www to www. Although the poster mentioned re-ordering the rules and still not working, commenting out the other rules for testing the condition and rule you want is helpful in isolating incase any of the other conditions and rules are conflicting somehow. I see that the poster does not have ^ and $ for the RewriteRule for (.*). This may or may not be the the issue but from my understanding it's good practice to have in the rewrite rule the beginning(^) and end indicators($).
  3. Rule being ignored

    Try: RewriteCond %{HTTP_HOST} ^newsite.co.uk [NC] RewriteRule ^(.*)$ http://www.newsite.co.uk/$1 [L,R=301,NC]
  4. Show php filename instead stream url?

    Sounds like URL rewriting is taking place. In most cases this is taking place in the .htaccess file. If so, you may want to comment out the lines in the .htaccess file that is taking place or remove it all together but be cautious to not remove anything that can cause an internal error for your site; making your site inaccessible.
  5. Prepared statement with UPDATE

    Yes that's what I meant. Instead of SET $colName = $colName + 1, you can just do: SET opener_Ask = opener_Ask + 1. In this situation you probably don't need to do a prepare statement for that column. Usually/typically, doing prepare statements are when user inputs are being used/supplied for SQL queries but on some occasions it's not necessary. But it's definitely good practice.
  6. Show php filename instead stream url?

    Are you saying that the actual file name is stream.php but the URL appears as steam.m3u8 in the browser but would like to see it in the browser as stream.php instead?
  7. Prepared statement with UPDATE

    Looks like you are trying to set a column name with bind_param. You can just name the column after SET instead of trying to bind_param it with ?. Also if the column name is opener_Ask, why aren't you updating that column row value with "opener_Ask + 1"? Also, Between bind_param and execute, you set the parameters like the following: $stmt->bind_param("ssi", $colName, $colName, $sesID); $colName = $colName; $sesID = $sesID; $stmt->execute(); See https://www.w3schools.com/php/php_mysql_prepared_statements.asp
  8. how to detect which page im on

    Check out some of the $_SERVER vars: http://php.net/manual/en/reserved.variables.server.php
  9. How Can Select First Paragraph select in a Post

    Yes, good notice. Edit: $firstPara = substr($post, 0, strpos($post, '</p>'));
  10. How Can Select First Paragraph select in a Post

    One thing you can try, depending on how the paragraphs are stored, meaning if you have something like this for one $post: <p>This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.</p> <p>This is another paragraph. This is another paragraph. This is another paragraph from same post.</p> You can use PHP substr function along with strpos to try and get the first paragraph like: $firstPara = substr($post, 0, strpos(‘</p>’, $post)); This should retrieve the first paragraph.
  11. How Can Select First Paragraph select in a Post

    You can try checking out the SUBSTR MySQL function(s). https://www.w3schools.com/sql/func_mysql_substr.asp
  12. edit button on php table created from sql DB

    Last time i checked GET is for query strings (using <a> tag, although can be applied to form via method get) which is what you mentioned in your post. But okay man.
  13. edit button on php table created from sql DB

    dsonesuk is referring to using <a> tag. Like: <a href="edituser.php?cust_id=n">Edit User</a>
  14. The cookie/session that is being set in the browser is only an identifier. The browser sends the identifier back to the server for PHP to retrieve the data for that identifier(cookie/session data) which is on the server. Basically what JSG meant here:
  15. Canvas question

    Thanks Foxy Mod for that code snippet, was able to figure out. Also thanks dsonesuk.