Search found 934 matches

by hyper
Sun Feb 23, 2020 3:47 am
Forum: mySQL & php coding
Topic: why my code not working
Replies: 3
Views: 126

Re: why my code not working

The $host in your script isn't used?

This is one of the many fly-by-night posts where I suspect the poster either had an answer from another forum, sorted it out for themselves, found something else or just plain gave up?
by hyper
Sun Feb 23, 2020 3:43 am
Forum: Other Database Engines
Topic: What is 3D Furniture Modeling? Can someone kindly let me know?
Replies: 3
Views: 1618

Re: What is 3D Furniture Modeling? Can someone kindly let me know?

This is a spam post, there don't seem to be any active mods on here so there are many spam posts, nothing seems to be done when reported.
by hyper
Sun Feb 23, 2020 3:40 am
Forum: PHP coding => General
Topic: Ajax DataTables with jQuery
Replies: 2
Views: 1044

Re: Ajax DataTables with jQuery

It's an old post.
by hyper
Sun Feb 23, 2020 3:08 am
Forum: PHP coding => General
Topic: spl_autoload_register problems
Replies: 2
Views: 751

Re: spl_autoload_register problems

Linux filesystem is case sensitive: 'foo.php' is not the same file as 'Foo.php' so PHP autoload takes your class name Foo and looks for Foo.php but your class is in foo.php change these: $foo = new Foo; $bar = new Bar; to: $foo = new foo; $bar = new bar; Or change your filenames to Foo.php Bar.php I...
by hyper
Sat Feb 22, 2020 7:19 pm
Forum: PHP coding => General
Topic: PHP PDO Registration OOP Class Not submitting to DB
Replies: 8
Views: 86

Re: PHP PDO Registration OOP Class Not submitting to DB

real_escape_string was removed from PHP version 7, so it looks as though you are using PHP V7+. As I said in my previous post, you don't need to use it as you are preparing your statements.
by hyper
Sat Feb 22, 2020 10:56 am
Forum: PHP coding => General
Topic: PHP PDO Registration OOP Class Not submitting to DB
Replies: 8
Views: 86

Re: PHP PDO Registration OOP Class Not submitting to DB

Are you sure that you are not getting any errors? Check that you have display_errors set or check your error log. A couple of observations on the last script posted: $UsrName = real_escape_string($_POST['UsrName']); $Email = real_escape_string($_POST['Email']); $Emaili = real_escape_string($_POST['E...
by hyper
Fri Feb 21, 2020 10:57 am
Forum: PHP coding => General
Topic: session_start error
Replies: 4
Views: 59

Re: session_start error

If you're using PHP version 7 or above, mysql_connect etc. has been removed as it was insecure, this means that you won't be able to use the old functions, you can still use MySQL. Semi colons are required at the end of each and every PHP instruction. You would be safer to install a more recent and ...
by hyper
Thu Feb 20, 2020 2:15 pm
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 16
Views: 134

Re: Create photo gallery (no mysql or widget)

You'll run into problems if you duplicate variable names or make slight alterations to it, if you already had a value for $pid_text and made it global, then changed the value in a function, you would change the value of it from the calling script. You can do this: echo pid_text($sub_div = 'test_subd...
by hyper
Thu Feb 20, 2020 12:27 pm
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 16
Views: 134

Re: Create photo gallery (no mysql or widget)

You're calling the function without recieving the return value: pid_text($sub_div = 'test_subdiv'); A function does not need to return a value, and you do not need to set the calling instruction to receive a value, but there's no point returning a value if you do not need it, so in answer to your qu...
by hyper
Thu Feb 20, 2020 12:18 pm
Forum: PHP coding => General
Topic: session_start error
Replies: 4
Views: 59

Re: session_start error

You're missing the end semi colon:

Code: Select all

$db = mysql_select_db($db_name, $conn)
by hyper
Mon Feb 17, 2020 10:39 am
Forum: PHP coding => General
Topic: PHP Table refresh
Replies: 2
Views: 55

Re: PHP Table refresh

AJAX may be the best route, unless your users have JavaScript disabled in which case you can fall back on the <meta> refresh tag providing your pages don't take too long to load.
by hyper
Sat Feb 15, 2020 6:13 am
Forum: PHP coding => General
Topic: Issues using a Git Repo
Replies: 2
Views: 42

Re: Issues using a Git Repo

The word 'error' is not going to help find a solution as there are many errors and we would need the full error given. That said: There are so many alarm bells ringing in these scripts that it would be better to find something else rather than try to "fix" it (it would be easier to re-write it), the...
by hyper
Fri Feb 14, 2020 10:26 am
Forum: PHP General
Topic: String problems.. echo random garbage?
Replies: 2
Views: 38

Re: String problems.. echo random garbage?

We need more information and code.

Are you only using the PHP from the command line?
by hyper
Fri Feb 14, 2020 10:18 am
Forum: PHP coding => General
Topic: function __construct
Replies: 1
Views: 90

Re: function __construct

The __construct function allows you to pass parameters to the class when it is instantiated (when it is created, constructed or an instance is made of it.) As a very simple example, the code below shows the same thing, done it two ways: Without __construct <?php class myClass { private $something = ...
by hyper
Wed Feb 12, 2020 10:51 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 16
Views: 134

Re: Create photo gallery (no mysql or widget)

This is turning into spaghetti code. The use of global variables is considered bad practice, the correct use functions will mean that you do not need to use them. <?php function sub_div_abb($sub_div) { switch ($sub_div) { case "gallery": return 'GALLERY'; break; // breaks are not needed if you retur...
by hyper
Tue Feb 11, 2020 12:53 pm
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 16
Views: 134

Re: Create photo gallery (no mysql or widget)

I don't understand the first part of your post?
Should I be looking at switch and case for this functionality?
Probably be the easiest way for you to do it.
by hyper
Mon Feb 10, 2020 10:58 am
Forum: PHP coding => Images
Topic: Create photo gallery (no mysql or widget)
Replies: 16
Views: 134

Re: Create photo gallery (no mysql or widget)

You need to use two equals signs when comparing.

One equals sign is assignment:

Code: Select all

if ($sub_div = 'glenbrook_resort') // Always true

if ($sub_div == 'glenbrook_resort') // might be true or false
by hyper
Sun Feb 09, 2020 1:57 pm
Forum: PHP coding => General
Topic: Function for images
Replies: 3
Views: 57

Re: Function for images

Basically, but in quotation marks. If you are using the path as an image in a page, then it should be the path from the web site: <!-- absolute path --> <img href = "https://www.mywebsite.com/path/image.jpg" width = "xxx" height = "yyy"> <!-- relative path --> <img href = "/path/image.jpg" width = "...
by hyper
Sun Feb 09, 2020 6:13 am
Forum: PHP coding => General
Topic: Function for images
Replies: 3
Views: 57

Re: Function for images

If you literally mean return the image, then yes you can, but, it's pointless.

Return the path to the image file instead of the Company Name.
by hyper
Wed Feb 05, 2020 9:17 am
Forum: PHP General
Topic: RegForm Post Jquery Validator
Replies: 3
Views: 43

Re: RegForm Post Jquery Validator

Sorry, I mis-understood your post.

Use the HTML requried
by hyper
Tue Feb 04, 2020 7:16 pm
Forum: PHP General
Topic: RegForm Post Jquery Validator
Replies: 3
Views: 43

Re: RegForm Post Jquery Validator

Validate on the server and return a form with the missing parts where applicable. Do not rely on client side validation. How can I check if the last name + first name + address and I agree checkbox is really filled for validate the form? It is not possible on the clients computer as it can be faked ...
by hyper
Tue Feb 04, 2020 7:11 pm
Forum: PHP coding => General
Topic: Cannot access website folder
Replies: 8
Views: 208

Re: Cannot access website folder

You'll have to search for a set of full instructions as there are variations with versions and operating systems.

a2ensite is used to register your new virtual host with apache 2 - enable - site.

I don't use windows so I can be more specific than that.
by hyper
Tue Feb 04, 2020 9:28 am
Forum: PHP coding => General
Topic: Payubiz Payment Gateway success page return blank page
Replies: 1
Views: 71

Re: Payubiz Payment Gateway success page return blank page

You need to use localhost or probably 127.0.0.1

192.168.1.65 is probably your machine's IP.
by hyper
Tue Feb 04, 2020 9:24 am
Forum: PHP coding => General
Topic: Cannot access website folder
Replies: 8
Views: 208

Re: Cannot access website folder

You need to edit 'sites-available' and your 'hosts' file and also create a 'xxx.conf 'file, then you'll also need to execute 'a2ensite xxx' and then restart apache.

There should be a tutorial for your win 8 set up somewhere.
by hyper
Thu Jan 30, 2020 1:01 pm
Forum: PHP Installation
Topic: Customized PHP installation
Replies: 2
Views: 28

Re: Customized PHP installation

Did you install a server? Try typing http://localhost/ or 127.0.0.1 into your browser, this should load a page of some sort, if not go back over the instructions on installing PHP from source that you used, to make sure that you have done everything correctly; PHP does have a built in server, but yo...