Search found 122 matches

by IChaps
Tue Nov 06, 2018 3:37 pm
Forum: PHP coding => Images
Topic: Is it possible to display an alternative image please?
Replies: 0
Views: 91

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: 250

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: 0
Views: 700

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: 376

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: 376

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: 376

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: 233

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: 749

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: 749

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: 749

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: 855

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: 749

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: 749

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: 855

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: 749

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: 855

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 ...
by IChaps
Mon Oct 02, 2017 4:28 am
Forum: mySQL & php coding
Topic: My script has stopped connecting to a database
Replies: 2
Views: 722

Re: My script has stopped connecting to a database

Hello Strider64,

Thank you for your post.

Kind Regards.
by IChaps
Sun Oct 01, 2017 9:33 am
Forum: mySQL & php coding
Topic: My script has stopped connecting to a database
Replies: 2
Views: 722

My script has stopped connecting to a database

Hello. Could I please just enquire. I have recently moved my site to a new server. I've created a new database and user, then changed the username, password and database name in my script to match the database. However I'm now finding I'm getting the error message:- Connection failed: SQLSTATE[HY000...
by IChaps
Tue Sep 05, 2017 2:26 pm
Forum: PHP General
Topic: How would I add to a dropmenu using php?
Replies: 2
Views: 952

Re: How would I add to a dropmenu using php?

Hello Again! Great News. I've found my old notes, and managed to create a drop down menu in php and PDO. :) <select name="comdomain" size="1"> <option selected="selected">Select</option> <? try { $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password); // set the PDO error mod...
by IChaps
Tue Sep 05, 2017 10:46 am
Forum: PHP General
Topic: How would I add to a dropmenu using php?
Replies: 2
Views: 952

How would I add to a dropmenu using php?

Hello. I'm looking to add items from a array to a dropmenu, however I'm only able to add the last item in the array. What I'm trying to do is:- 1st, Load and display data from one database field, and display it on a web page. 2nd Write the data to an array for later use. I'm able to achieve the abov...
by IChaps
Mon Sep 04, 2017 2:46 pm
Forum: PHP General
Topic: Can I link a drop down to a single database entry please?
Replies: 1
Views: 581

Can I link a drop down to a single database entry please?

Hello. I am just enquiring at present. I'm unsure how to explain this, please bear with me. I am looking into creating a search directory into my site, so users can Edit or Remove their entries, however I'm unable to link (or know how to go about) linking a drop menu to each of my database entries. ...
by IChaps
Mon Jul 10, 2017 2:21 pm
Forum: mySQL & php coding
Topic: How would I create a simple menu from a database?
Replies: 4
Views: 907

Re: How would I create a simple menu from a database?

Hello Hyper,

Thank you for your reply.
by IChaps
Fri Jul 07, 2017 2:47 pm
Forum: mySQL & php coding
Topic: How would I create a simple menu from a database?
Replies: 4
Views: 907

Re: How would I create a simple menu from a database?

Hello Hyper, Thank you for your reply, and soory for for not getting back to you sooner. I've had a quick browse on the web, and I think I've achieved what I'm trying to do (some-what). To add to items to the menu I've created a form, and once submitted I've written:- session_start(); $menu_header =...
by IChaps
Tue Jul 04, 2017 2:58 pm
Forum: mySQL & php coding
Topic: How would I create a simple menu from a database?
Replies: 4
Views: 907

How would I create a simple menu from a database?

Hello. Just a brief query. I'm looking into creating a simple menu, however I'm considering using a database to store the data, ie menu text (Home) and hyperlink (index.php) as an example. I'm just asking what would be the best way to create the hyperlink in php as I'm getting a blank page? I've wri...
by IChaps
Wed Jun 07, 2017 3:14 pm
Forum: PHP coding => General
Topic: How might I display an image using php please?
Replies: 1
Views: 536

How might I display an image using php please?

Hello. Could I please enquire how would I display an image using php? At present I've got my script to load from a database and store the filename in a variable named mimage ( $image = $row[2]; ) which dose work. Now I don't remember how to echo the image to the screen? What I'd like to do is displa...