Jump to content

Don E

  • Content count

  • Joined

  • Last visited

Everything posted by Don E

  1. Alert not working

    Looks like you're missing the opening double quote for type="text". Your browser developer tools is very useful for these situations or any situation. 😉
  2. The SMTP error means you're trying to send mail using the Outlook SMTP server because you have sendmail_from in php.ini set to your email address which is an Outlook email address and you haven't set up the authentication to do so with the Outlook SMTP server. What you can try is to send the mail locally from your server but if your server doesn't have an email server, then you may want to try something like PHPMailer. See this link for it provides how to do send email with PHPMailer with Outlook: https://subinsb.com/send-mails-via-smtp-server-gmail-outlook-php/
  3. Php mail() function first parameter is a string which is the "to" address. You have the $formproc object there instead. Example: mail($to, $subject, $message); // 'me@mail.com', 'this is subject', 'this is a message' Each parameter for the mail function is string. The fourth parameter would be headers which is optional but good to add. See: http://php.net/manual/en/function.mail.php
  4. Hey iwato, are you sure your column names are exactly like in your query? Also something to try, probably makes no difference but since you're calling get_result after execute, instead try to see if you have any num_rows with $mysqli_result->num_rows (get_result should return a result set on successful query) instead of $mysqli_stmt->num_rows.
  5. In the function construct, one of the parameters is the super global $_GET. After doing some testing just to be certain, you cannot re-assign values to it. This is the error I got while testing: Fatal error: Cannot re-assign auto-global variable _GET in /Applications/MAMP/htdocs/testing/classTest.php on line 12 Did you see this error? I noticed the super global $_GET earlier in the construct but dismissed/overlooked it.
  6. Have you tried printing the stmt and result objects after the match attempt to see for errors? Also not sure if this may be the issue but I don't think you need to call the first line below because when calling 'prepare' it returns a stmt object for you. $mysqli_stmt = $this->mysqli_obj->stmt_init(); $mysqli_stmt->prepare($sql_select); So instead try: $mysqli_stmt = $this->mysqli_obj->prepare($sql_select); Also noticed: $match = mysqli_num_rows($mysqli_result); Looks like calling procedural function calling attempt? Instead for number of rows, try: $mysqli_stmt->num_rows Use in the if condition instead of $match > 0. Also noticed and just to note, when calling a function from another function within the same object, use $this->update_record(); instead of just update_record(); Good luck! I'm sure some of the others will be here to assist as well!
  7. iphone videos no longer autoplay?

    I agree. It's not too awful. Good luck with everything. 👍🏼
  8. iphone videos no longer autoplay?

    What you can do to give you the result you're looking for is converting your videos to gifs. Gifs automatically play on iOS devices. Here is one of your videos converted to a gif using video gif maker at https://editthis.net/videogif The downside to this though is depending on the length(duration) and size(width and height) of gif, the file size can be big resulting in the gifs taking some time to load on the webpage.
  9. iphone videos no longer autoplay?

    I believe this was a change with iOS. I've noticed this for awhile now. (years)
  10. 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.
  11. 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($).
  12. Rule being ignored

    Try: RewriteCond %{HTTP_HOST} ^newsite.co.uk [NC] RewriteRule ^(.*)$ http://www.newsite.co.uk/$1 [L,R=301,NC]
  13. 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.
  14. 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.
  15. 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?
  16. 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
  17. how to detect which page im on

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

    Yes, good notice. Edit: $firstPara = substr($post, 0, strpos($post, '</p>'));
  19. 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.
  20. 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
  21. 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.
  22. 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>
  23. 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:
  24. Canvas question

    Hello everyone, I have a question about the HTML canvas element. If loading an image into a canvas where the canvas has been scaled down to a smaller size because of responsive design, say for example 300 by 300, how can then after playing in the canvas get the original size of the image for the canvas upon out putting to the browser to download? So for example, original image size may be: 600x600. Loading it into a canvas that is being rendered responsive is scaled to: 300x300. Upon finishing playing with the image in the canvas, how can I get a 600x600 version of it instead of the scaled size which is 300x300? I've noticed that whatever the canvas width and height is set to, you will get that size for your output, which is fine but if an image is loaded into the canvas, it would be nice upon output to output as the original width and height for the canvas. Appreciate it in advance. Thanks!
  25. Canvas question

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