Search found 131 matches

by IChaps
Mon Oct 14, 2019 6:26 am
Forum: PHP coding => General
Topic: How do I check if a user is enactive for a period of time please?
Replies: 1
Views: 180

Re: How do I check if a user is enactive for a period of time please?

Hi. I think I may have sorted this query out. <?php //Add new member if(session_status() !== PHP_SESSION_ACTIVE) { session_start(); } $servername = $_SESSION['dbf_host']; $username = $_SESSION['dbf_user']; $password = $_SESSION['dbf_pass']; $dbname = $_SESSION['dbf_databasename']; try { $conn = new ...
by IChaps
Sun Oct 13, 2019 2:54 pm
Forum: PHP coding => General
Topic: How do I check if a user is enactive for a period of time please?
Replies: 1
Views: 180

How do I check if a user is enactive for a period of time please?

Hello. Could I please just enquire. I'm about to write/test some code that will check the current time and the last time a user used their account. If a user has been enactive for 15 minutes, then switch their status to offline, or log them out. At present I'm playing with the following code:- if(se...
by IChaps
Sun Oct 13, 2019 2:31 pm
Forum: PHP coding => Mail
Topic: I can't get the form method and submit button to work.
Replies: 6
Views: 2824

Re: I can't get the form method and submit button to work.

Hi, I can't seem to workout what your trying to do. If you're trying to build a form of some kind, have a look at my very basic form below. I've used html for the form, and php for the results. HTML Code <!DOCTYPE HTML> <html> <head> <title>Untitled</title> </head> <body> <form name="myform" action=...
by IChaps
Thu Oct 03, 2019 7:24 am
Forum: PHP General
Topic: How do I calculate Time Please? ie take the timestamp and subtract the current time
Replies: 4
Views: 123

Re: How do I calculate Time Please? ie take the timestamp and subtract the current time

Hello chorn.

Thank you very much for the link. I'll give it a try.
by IChaps
Tue Oct 01, 2019 5:02 am
Forum: PHP General
Topic: How do I calculate Time Please? ie take the timestamp and subtract the current time
Replies: 4
Views: 123

How do I calculate Time Please? ie take the timestamp and subtract the current time

Hello. Could anyone please advise me with regards writing a piece of code, which would check if a user has used their account in the past hour, and if not. Mark them as offline. At present, I'm unsure where I've gone wrong. And to get the timestamp, and the current time, then take one away from the ...
by IChaps
Sun Jan 13, 2019 3:45 pm
Forum: PHP General
Topic: How would I create a hyperlink to pass a search result to another website?
Replies: 3
Views: 1134

Re: How would I create a hyperlink to pass a search result to another website?

Thank you Hyper very much.
I'm unsure how to use urlencode, but will look into this further.

Thank you for your reply.
by IChaps
Fri Jan 11, 2019 3:52 pm
Forum: PHP General
Topic: How would I create a hyperlink to pass a search result to another website?
Replies: 3
Views: 1134

How would I create a hyperlink to pass a search result to another website?

Hi. Could I just enquire at this stage ( however I'm unsure to explain this ). I'm building a company review site, My main site works fine, however I would like to create a link so that a company can place a badge on their site, and link it to their review page on my site. The difficulty I've got, i...
by IChaps
Fri Jan 11, 2019 3:22 pm
Forum: PHP coding => Images
Topic: Unable to upload file
Replies: 3
Views: 2425

Re: Unable to upload file

Thank you for your reply.
by IChaps
Fri Dec 07, 2018 2:20 am
Forum: PHP coding => Images
Topic: Is it possible to display an alternative image please?
Replies: 2
Views: 1403

Re: Is it possible to display an alternative image please?

Thank yo very much for your reply.
by IChaps
Tue Nov 06, 2018 3:37 pm
Forum: PHP coding => Images
Topic: Is it possible to display an alternative image please?
Replies: 2
Views: 1403

Is it possible to display an alternative image please?

Hello. I'd just like to enquire if an image is not available for some reason, is it possible to show an alternative image instead? At present I've written <img src="/user/images/<?=row['myimage'?>", width="75", height="75", alt="scr='/system/graphics/noimage.png'"> At present, it displays the text s...
by IChaps
Thu Aug 09, 2018 10:36 am
Forum: PHP General
Topic: What would be the best way to encrypt and decrypt to and from a database please?
Replies: 1
Views: 791

What would be the best way to encrypt and decrypt to and from a database please?

Hello.

I'm currently looking into encrypting text before it's written to a database.

And decrypting the data when the database is read.

I'm unsure the best way to do this, could anyone please advise?

Thank You.
by IChaps
Tue Jul 17, 2018 2:50 pm
Forum: PHP coding => Images
Topic: Unable to upload file
Replies: 3
Views: 2425

Unable to upload file

Hello. Could I just briefly enquire? I've got some code which hopefully will upload a gif, jpg or png file to my website. However I can't get it to upload, and the folder I'm using on the server remains empty. I'm unable to figure out where I've gone wrong. The folder on the server has been chmod to...
by IChaps
Fri Jun 22, 2018 2:35 am
Forum: mySQL & php coding
Topic: Breif query about reading from PDO
Replies: 3
Views: 1539

Re: Breif query about reading from PDO

Hello chorn, At present, I've created a basic form signup form. When the form is submitted, it is encrypted using the code below, and got the last ID number from the database ( ie. $last_id = $conn->lastInsertId(); ) Then I copied a png file from another location and renamed it to $last_id.png Then ...
by IChaps
Thu Jun 21, 2018 8:46 am
Forum: mySQL & php coding
Topic: Breif query about reading from PDO
Replies: 3
Views: 1539

Re: Breif query about reading from PDO

Update:- Possible solution.


It's something to do with encryption/decryption.

I've discovered that when a function is called for the first time it works.
When it's called again it don't work.

Is there anyway is destroying the function after use?

Thanks.
by IChaps
Thu Jun 21, 2018 6:18 am
Forum: mySQL & php coding
Topic: Breif query about reading from PDO
Replies: 3
Views: 1539

Breif query about reading from PDO

Hello. I'd just like to enquire if the coding to read all records in a database has changed? Using PDO and php version 7, I'm now unable to read from a database part from the first record. try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // set the PDO error mode...
by IChaps
Wed May 30, 2018 6:08 am
Forum: PHP coding => General
Topic: Encrypt Query
Replies: 1
Views: 660

Encrypt Query

Hello.

I'd jusr like to enquire.
I'm about to/like to encrypt an entry in a text box before writing it to a database.

I'd just like to know if there's a simple way of doing it please?

Thank You
by IChaps
Tue Nov 14, 2017 3:49 pm
Forum: PHP General
Topic: How do I create a unique link?
Replies: 9
Views: 1620

Re: How do I create a unique link?

Hello chorn. I'd just like to thank you very much for your time and help. I have now managed to create the unique link I wanted with your help ! In my directory file I used the line: <a href="request.php?member_id=<?=$id?>">request friendship</a> and in the request.php file, I've written:- $userid =...
by IChaps
Fri Nov 10, 2017 2:57 pm
Forum: PHP General
Topic: How do I create a unique link?
Replies: 9
Views: 1620

Re: How do I create a unique link?

Hi.

I've tried using

Code: Select all

<a href="/request.php?member_id=<?php echo $user['member_id']; ?>">Link</a>
However it don't work, and the page will not load.

As I'm using a php file, I've forgotten the php way to create a hyperlink.

Thanks.
by IChaps
Thu Nov 09, 2017 1:11 pm
Forum: PHP General
Topic: How do I create a unique link?
Replies: 9
Views: 1620

Re: How do I create a unique link?

Hello chorn.

My apologies,

I'm still not understanding.

I've tried to follow your example, but I'm sill unsure.
I have created the line:-

Code: Select all

<a href="/request.php?member_id=<?php echo $user['member_id']; ?>">Link</a>
In my database, for the primary key I've used member_id

Thanks.
by IChaps
Wed Nov 08, 2017 2:56 pm
Forum: PHP coding => Images
Topic: How do I rename an image file?
Replies: 5
Views: 2251

Re: How do I rename an image file?

Hello Hyper,

First of all, leaving the code tags out, was just an error.
I'm not getting any return values or any errors reported.
It's just uploading the file and not renaming it.

And as for not explaining myself as well as you may expect. This could be due to a stoke I've suffered.
by IChaps
Wed Nov 08, 2017 2:34 pm
Forum: PHP General
Topic: How do I create a unique link?
Replies: 9
Views: 1620

Re: How do I create a unique link?

Hello chorn,

Thank you very much.
I'll try it.

Kind Regards.
by IChaps
Tue Nov 07, 2017 2:32 pm
Forum: PHP General
Topic: How do I create a unique link?
Replies: 9
Views: 1620

Re: How do I create a unique link?

Hello chorn,

Thank you for your reply.

I'm not sure what you mean.
Do you mean the primary key?

If so, I don't know how to do it, and how to proceed if the link is clicked.

Thanks.
by IChaps
Tue Nov 07, 2017 2:24 pm
Forum: PHP coding => Images
Topic: How do I rename an image file?
Replies: 5
Views: 2251

Re: How do I rename an image file?

Hello Hyper, Thank you for your query. When I try and rename the image file, nothing happens. My first thought was an incorrect path name, so I did a copy and paste and tried again, and still the image filename didn't rename. My second thought, was the filename was read only, so I inserted a chmod, ...
by IChaps
Mon Nov 06, 2017 3:36 pm
Forum: PHP General
Topic: How do I create a unique link?
Replies: 9
Views: 1620

How do I create a unique link?

Hello. I'm looking into creating a member's directory. The results will show, the member's profile image, full name and either 1 or 2 unique hyperlinks. ie. Image Name Friend Request Contact John Smith Request Get In touch Joe Bloggs Request Get In touch If I want to make a friend of John Smith, the...
by IChaps
Mon Nov 06, 2017 3:21 pm
Forum: PHP coding => Images
Topic: How do I rename an image file?
Replies: 5
Views: 2251

How do I rename an image file?

Hello. Could I please enquire, how do I rename an image file after it's been uploaded? At present the code I'm using reads:- [code<?php /* * Simple file Upload system with PHP. * Created By Tech Stream * Original Source at http://techstream.org/Web-Development/PHP/Single-File-Upload-With-PHP * This ...