|
Well done David YAUT
"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Parse error: syntax error, unexpected variable "$query" in C:\xampp\htdocs\sys\functions.php on line 10
here is the code -
<?php
function check_login($con)
{
if(isset($_SESSION['user_id']))
{
$id = $_SESSION["user_id"]
$query = "select * from users where user_id = '$id' limit 1";
$result = mysqli_query($con,$query);
if($result && mysqli_num_rows($result) > 0)
{
$user_data = mysqli_fetch_assoc($result);
return $user_data;
}
}
}
|
|
|
|
|
You should read the posting rules, the top entry in this list. You could read there that this is the wrong place for your question.
|
|
|
|
|
This forum is the wrong place to post this, as it says at the top of the page.
The right place is here: Ask a Question[^]
And don't do SQL like that: Never concatenate strings to build a SQL command. It leaves you wide open to accidental or deliberate SQL Injection attack which can destroy your entire database. Always use Parameterized queries instead.
When you concatenate strings, you cause problems because SQL receives commands like:
SELECT * FROM MyTable WHERE StreetAddress = 'Baker's Wood' The quote the user added terminates the string as far as SQL is concerned and you get problems. But it could be worse. If I come along and type this instead: "x';DROP TABLE MyTable;--" Then SQL receives a very different command:
SELECT * FROM MyTable WHERE StreetAddress = 'x';DROP TABLE MyTable; Which SQL sees as three separate commands:
SELECT * FROM MyTable WHERE StreetAddress = 'x'; A perfectly valid SELECT
DROP TABLE MyTable; A perfectly valid "delete the table" command
And everything else is a comment.
So it does: selects any matching rows, deletes the table from the DB, and ignores anything else.
So ALWAYS use parameterized queries! Or be prepared to restore your DB from backup frequently. You do take backups regularly, don't you?
But to be honest, the problem you have noticed is pretty trivial to fix: what should a line end with in PHP?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
You don't wipe an entire database for a fine.
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
How is it possible to discuss such matters without a link to Bobby Tables[^]?
Sure, it has been referenced in numerous earlier threads. That is because it has been equally relevant to numerous earlier threads. As well as to this one.
|
|
|
|
|
While XKCD is right, and spot on (and generally Randal is very good at science stuff) it is a cartoon. So those who have never explored the internet other than FarceBook and Twatter - which includes most students - can easily assume that it's a joke. Which it is, but they don't see the levels of reality behind the joke. Omitting Bobby Tables was a deliberate choice to not have the "less experienced" reader disregard it as humour.
Since most of 'em don't read past the first sentence of any reply that doesn't start with "here's code you can hand in as your own homework" anyway, it's probably a moot point. But still, we try ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
Ref: The Lounge[^]
And: The Lounge[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
I know nothing about PHP, but aren't you missing a terminating ";" after your $id assignment?
(and I won't get into what others have pointed out already, including the posting rules...)
|
|
|
|
|
I got a 14 inches windows tablet, and it just hit me this morning that I could take note with it!
(well, it just hit me yesterday that I could do the same with my eInk tablet! ^^)
Anyway, any app recommendation for taking notes?
(I mean using the pen to write or doodle, not the keyboard to type)
EDIT
Just tried OneNote.. it ain't too bad!
modified 24-Jan-22 20:31pm.
|
|
|
|
|
I used to use Microsoft OneNote for my handwritten notes but then I was forced to stop using Microsoft Windows (had to convert to Linux) and there is no OneNote here with handwriting capabilities.
So I search for long and now I have been using Stylus Labs Write[^] for years (on both Linux and android).
The good:
- it works in Windows, Linux, mac, IOS and Android
- has pressure sensitivity if your pen supports it (on any OS)
- the file format is just a HTML file with one SVG per page so it is easy to convert to another program if it ever gets to that point
The bad:
- it only supports pen input, you can not even write text with the keyboard
- no fancy functionality like OCR (but with such open file format you can always use an external program to scan the SVGs)
- they do not update it very often (but I never had an error while using it)
- not open source (if you are a purist)
If you intend to use it on multiple devices like I do, it is just a matter of syncing the folder throughout your devices taking care that the sync completes before you edit any file on another device since the program is not "sync aware". Personally, I have it syncing to my private nextcloud server.
|
|
|
|
|
|
I think there is a sort of message here.. something about slant.co...
Actually... I got one not on my phone (which is an Android/Linux), and they all sync together..
Good point here!
|
|
|
|
|
I just click the button on the end, and it brings up Microsoft Whiteboard (I think that is the default operation).
It's pretty basic, but drawing, writing ... it works for me. It doesn't have OCR, but with my handwriting, that's a bonus ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
My (Microsoft) Surface Pen has a "pointy bit" which is pressure sensitive, and acts as the left mouse button, a button on the side near the tip that is the right mouse button, and a button on the "blunt end" that opens Whiteboard and Snip.
How to use your Surface Pen[^]
(It also acts as an eraser in some drawing apps)
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
haha, it all became clear!
- I don't have a surface, I have a Lenovo tablet (quite thin and long battery life and 14")
- my pen doesn't have a back button
- I didn't have Whiteboard installed
Thanks for the detailed info though. And installing Whiteboard now!
|
|
|
|
|
There are many apps available that you can use. Apps are available in Paid and Free versions. In the free version you are having True Paper Feel, Pro Drawing Tool, Take Control of PDFs, Multipurpose Inking, etc. And if you are looking for Paid Apps then Write Music With Ease, Infinite Canvas, etc.
|
|
|
|
|
been here done that.
The best app overall is OneNote. Butttttttt it doesn't work with Linux except the web version which "works" sort of. But it does work.
2nd best overall is an App called Joplin. Joplin[^] It just works every where but doesn't support Pen input. To get around that on Linux just use Xournal that app is built only for pen and outputs to svg or png or pretty much whatever you want. Then place the resulting file into the Joplin file.
Trust me on this. Joplin is the next go to app in notetaking. Very very well thought out. Nearly as good or better than OneNote in so many respects.
I see others have mentioned lots of other apps. They work but they all have some sort of fatal flaw in my opinion. Like they don't work on all my systems. (I currently run Linux, Winders, Android) or the integration with other apps or reminders/emails don't work.
just my opinion. Take it for what it is worth (not much)
To err is human to really elephant it up you need a computer
|
|
|
|
|
I use OneNote for all my work related notes and the notebooks are located on the cloud which is nice. I can access them from any device.
I have been using Evernote for my personal notes. Paid version allows you to access them from any device. I also have been using OneNote. -- My dilemma is that I like both; they both have features the other does not that I like. Now only if I could find one that has everything I like. I know, I know, roll my own. No thank you.
|
|
|
|
|
I found OneNote to be actually pretty darn amazing, including handwriting recognition. It is IMHO on the large side of feature sets, meaning getting familiar with it is quite the chore.
|
|
|
|
|
If you're considering trying it again, OneNote has a web version (works well with any chromium based browser)
Professional Nerd
|
|
|
|
|
Your handwriting must be a lot better than mine.
I would take a note then not be able to read it!
ed
|
|
|
|