Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 06-25-2022, 09:24 PM   #1
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
New php error message and I'm not sure what to fix

I'm getting the following error message on a basic newsletter program im putting together, I'm assuming that it may have something to do with additional white/ blank spaces in the code but, I cant find any in the code.

Quote:
PHP Parse error: syntax error, unexpected '<<' (T_SL) in /blah/blah/domain.com/news/admin/index.php on line 11
This is the index.php file code:

Quote:
<?php
require_once 'config.php';
login_required();
$users = count_query("SELECT COUNT(*) AS num FROM users");
$emails = count_query("SELECT COUNT(*) AS num FROM subscribers");
$subs = count_query("SELECT COUNT(*) AS num FROM subscriptions");
$nls = count_query("SELECT COUNT(*) AS num FROM newsletters");
$mess = count_query("SELECT COUNT(*) AS num FROM messages");
$temps = count_query("SELECT COUNT(*) AS num FROM templates");
$title = "Home!";
$content = <<<EOF
<h3>current stats</h3>
<p>$users user registered</p>
<p>$emails subscribers</p>
<p>$subs newsletter subscriptions</p>
<p>$nls newsletters</p>
<p>$mess messages</p>
<p>$temps templates</p>
EOF;
include 'layout.php'; ?>
Any help would be greatly appreciated, I've been fucking with this line 11 issue for the last 30 minutes with no resolve :/
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-25-2022, 09:30 PM   #2
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,281
https://stackoverflow.com/questions/...ide-eof-string
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-25-2022, 09:56 PM   #3
LaSexorcisto
Confirmed User
 
LaSexorcisto's Avatar
 
Industry Role:
Join Date: Mar 2022
Location: In the moment
Posts: 95
The error was because you used '<<' instead of '<<<'. You must've edited your question to fix the code to include 3 '<'. So now your question doesn't make sense.
LaSexorcisto is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-25-2022, 10:30 PM   #4
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by LaSexorcisto View Post
The error was because you used '<<' instead of '<<<'. You must've edited your question to fix the code to include 3 '<'. So now your question doesn't make sense.
Its always had three <<< in the code, thats what I don't understand, it should be working fine.

If i change that to 2 or 1 < I get a different error:

Quote:
PHP Parse error: syntax error, unexpected '<>' (T_IS_NOT_EQUAL) in /blah/blah/domain.com/news/admin/index.php on line 11
.
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-25-2022, 10:31 PM   #5
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by machinegunkelly View Post
Thanks will check it out now
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-25-2022, 10:39 PM   #6
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,281
Quote:
Originally Posted by Publisher Bucks View Post
Thanks will check it out now
I asked last time and Konrad brought up a valid point.

But are you looking to be a hirable PHP dev? if not... look into frameworks man, you're struggling for nothing.

If you desire a job as a PHP dev, ignore me, but if not .. use a framework and skip this bullshit you're suffering through.
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-25-2022, 10:46 PM   #7
LaSexorcisto
Confirmed User
 
LaSexorcisto's Avatar
 
Industry Role:
Join Date: Mar 2022
Location: In the moment
Posts: 95
I'm not sure why, but you are 100% bullshitting us with your "issue". The 1st error ONLY happens in you use '<<EOF'. The second error happened because you changed it to '<>EOF'. I'm not sure who you're trying to BS, but you can run the code yourself

https : // onlinephp.io/c/aacd1
LaSexorcisto is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-25-2022, 10:59 PM   #8
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,281
Quote:
Originally Posted by LaSexorcisto View Post
I'm not sure why, but you are 100% bullshitting us with your "issue". The 1st error ONLY happens in you use '<<EOF'. The second error happened because you changed it to '<>EOF'. I'm not sure who you're trying to BS, but you can run the code yourself

https : // onlinephp.io/c/aacd1
If he's workin' localhost all bets are off.. Weird shit happens in a pseudo linux environment.

I dont see any benefit in making up bugs.
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 12:03 AM   #9
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Jesus, just use quotes like a normal human being instead of this << heresy.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 12:10 AM   #10
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by k0nr4d View Post
Jesus, just use quotes like a normal human being instead of this << heresy.
I was under the impression that using <<<EOF was good to use when you have multiple fields to display as far as not having to escape multiple quotes in the code?

This code will actually have several more fields on the page once’s I’ve gotten it to a somewhat ‘working’ version, that’s the only reason I’m using the EOF stuff.
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 12:51 AM   #11
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,281
Quote:
Originally Posted by Publisher Bucks View Post
I was under the impression that using <<<EOF was good to use when you have multiple fields to display as far as not having to escape multiple quotes in the code?

This code will actually have several more fields on the page once’s I’ve gotten it to a somewhat ‘working’ version, that’s the only reason I’m using the EOF stuff.
Honestly in all my years Ive never seen EOF, maybe in some old ass smarty bullshit? idk.

So I suspect just listen to konrad!
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 12:58 AM   #12
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Quote:
Originally Posted by Publisher Bucks View Post
I was under the impression that using <<<EOF was good to use when you have multiple fields to display as far as not having to escape multiple quotes in the code?

This code will actually have several more fields on the page once’s I’ve gotten it to a somewhat ‘working’ version, that’s the only reason I’m using the EOF stuff.
I've went over 20 years now without using that so much as once
Just use quotes dude. " outer, ' inner for the fields or vice versa.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 01:58 AM   #13
redwhiteandblue
Bollocks
 
redwhiteandblue's Avatar
 
Industry Role:
Join Date: Jun 2007
Location: Bollocks
Posts: 2,792
Quote:
Originally Posted by k0nr4d View Post
I've went over 20 years now without using that so much as once
Just use quotes dude. " outer, ' inner for the fields or vice versa.
Indeed. Just use \r\n if you want new lines in your text string.
redwhiteandblue is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 08:08 AM   #14
andy erotic
Registered User
 
Industry Role:
Join Date: Jun 2022
Posts: 37
I mean, is no one else going to comment that it's some really, custy-nasty-ass code that really shouldn't be in production or should I be a sycophant?
andy erotic is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 08:38 AM   #15
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by machinegunkelly View Post
I asked last time and Konrad brought up a valid point.

But are you looking to be a hirable PHP dev? if not... look into frameworks man, you're struggling for nothing.

If you desire a job as a PHP dev, ignore me, but if not .. use a framework and skip this bullshit you're suffering through.
I am not using any PHP framework and so far there is nothing what i cant debug it or make it work.
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 08:39 AM   #16
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by k0nr4d View Post
Jesus, just use quotes like a normal human being instead of this << heresy.
Yep, i think i used EOF only when i sucked at coding
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 08:42 AM   #17
k0nr4d
Confirmed User
 
k0nr4d's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Poland
Posts: 9,228
Quote:
Originally Posted by andy erotic View Post
I mean, is no one else going to comment that it's some really, custy-nasty-ass code that really shouldn't be in production or should I be a sycophant?
If you check the previous questions we've long given up on that It honestly looks like he's improving slightly though.
k0nr4d is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-26-2022, 09:21 AM   #18
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,063
Just want to say that everybody was a beginner at some point.

.
__________________
All cookies cleared!
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 06:48 AM   #19
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by Klen View Post
I am not using any PHP framework and so far there is nothing what i cant debug it or make it work.
Indeed, it takes more time to read through all info in the docs than to just start writing a few custom functions from scratch.

Quote:
Originally Posted by sarettah View Post
Just want to say that everybody was a beginner at some point.

.
Lol, yeah I think we all fucked up a couple of times more than we'd like to admit.

As a beginner, just be careful with user input when using your own code in production...
It's better to write a paranoid rule for sanitizing user input, just to be safe (such as stripping everything except a-z and 0-9, which is fine for for most cases anyway).
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 06:56 AM   #20
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by zijlstravideo View Post
Indeed, it takes more time to read through all info in the docs than to just start writing a few custom functions from scratch.

It have sense only if framework contain class for something specific , and it helps you to reduce time since it's already made. But i find it annoying how so many people thinks how you are trash if you dont use one
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 07:20 AM   #21
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by Klen View Post
It have sense only if framework contain class for something specific , and it helps you to reduce time since it's already made. But i find it annoying how so many people thinks how you are trash if you dont use one
Yeah, like why would anyone need a fancy framework to pull and write some data to a database. Seems like a complete overkill to me.

I also really dislike digging through other people's code... debugging takes so much more time if you didn't write the code yourself.
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 07:44 AM   #22
Klen
 
Klen's Avatar
 
Industry Role:
Join Date: Aug 2006
Location: Little Vienna
Posts: 32,235
Quote:
Originally Posted by zijlstravideo View Post
Yeah, like why would anyone need a fancy framework to pull and write some data to a database. Seems like a complete overkill to me.

I also really dislike digging through other people's code... debugging takes so much more time if you didn't write the code yourself.
Lol that is exactly my though about it - if something fails on framework side, then you cant do shit but wait for support to fix it.
Klen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 08:10 AM   #23
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,281
Quote:
Originally Posted by zijlstravideo View Post
Yeah, like why would anyone need a fancy framework to pull and write some data to a database. Seems like a complete overkill to me.

I also really dislike digging through other people's code... debugging takes so much more time if you didn't write the code yourself.
My point was that if all he's aiming to do is a make a production ready site, and seems to be learning everything from the ground up. a frame work may come in handy.

As it takes a lot of the absolute bullshit out of raw PHP, that may keep this poor guy developing for years and never producing anything.

XSS prevention, Security, Media files, Image uploads, validation, relationships, etc etc etc, are a lot of work in raw php, and DEAD simple with a framework.

So is he trynna make a site? or trynna learn PHP.

If all he wants to do is make a site, and he has basic PHP Knowledge a framework will take alot of the pain out.

If he wants to learn PHP, have at 'er
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 08:13 AM   #24
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,244
Quote:
Originally Posted by Publisher Bucks View Post
I'm getting the following error message on a basic newsletter program im putting together, I'm assuming that it may have something to do with additional white/ blank spaces in the code but, I cant find any in the code.



This is the index.php file code:



Any help would be greatly appreciated, I've been fucking with this line 11 issue for the last 30 minutes with no resolve :/

This code runs fine on my server :

PHP Code:
<?php
$title 
"Home!";
$content = <<<EOF
<h3>current stats</h3>
<p>
$users user registered</p>
<p>
$emails subscribers</p>
<p>
$subs newsletter subscriptions</p>
<p>
$nls newsletters</p>
<p>
$mess messages</p>
<p>
$temps templates</p>
EOF;
echo 
$content?>

There seems to be no problem with that code.


__________________
Make Money with Porn
blackmonsters is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 08:27 AM   #25
zijlstravideo
Confirmed User
 
zijlstravideo's Avatar
 
Industry Role:
Join Date: Sep 2013
Location: The Netherlands
Posts: 805
Quote:
Originally Posted by machinegunkelly View Post

As it takes a lot of the absolute bullshit out of raw PHP, that may keep this poor guy developing for years and never producing anything.
OP does seem to be working on it for ages now... Gotta admire that.

Quote:
Originally Posted by machinegunkelly View Post
XSS prevention, Security, Media files, Image uploads, validation, relationships, etc etc etc, are a lot of work in raw php, and DEAD simple with a framework.

So is he trynna make a site? or trynna learn PHP.

If all he wants to do is make a site, and he has basic PHP Knowledge a framework will take alot of the pain out.

If he wants to learn PHP, have at 'er
You're right, OP does seem to always skip the official PHP docs and starts building right away... So yeah, I guess it makes sense to use a framework when you're just starting out learning PHP and the website needs more than just the basic SQL stuff.

Or perhaps even buying a fully working script and just modify it a bit to your own needs. That's what I often did when I barely knew the basics. Learned a lot that way (with trial and error... lots of error).
__________________
Contact: email
zijlstravideo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 08:31 AM   #26
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,281
Quote:
Originally Posted by zijlstravideo View Post
OP does seem to be working on it for ages now... Gotta admire that.



You're right, OP does seem to always skip the official PHP docs and starts building right away... So yeah, I guess it makes sense to use a framework when you're just starting out learning PHP and the website needs more than just the basic SQL stuff.

Or perhaps even buying a fully working script and just modify it a bit to your own needs. That's what I often did when I barely knew the basics. Learned a lot that way (with trial and error... lots of error).
Yea, thats why I asked him.

If I just wanted to build a site, I'd use a framework.

If I wanted to brush up my PHP skills, or master them.. Id not.

but if you just wanna get a site up and running.. and the syntax and fundamentals of PHP are slowing that down, alot of those fundamental problems become very trivial with a framework.

Based on his previous questions, the most likely outcome of him actually producing a live site, from the code he's been doing, is that it's instantly hacked, OR he's gotta spend 6 months learning hot to prevent every possible attack, how to sanitize data etc etc.

He'll NEVER get a site going.
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 07:26 PM   #27
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by blackmonsters View Post
This code runs fine on my server :

PHP Code:
<?php
$title 
"Home!";
$content = <<<EOF
<h3>current stats</h3>
<p>
$users user registered</p>
<p>
$emails subscribers</p>
<p>
$subs newsletter subscriptions</p>
<p>
$nls newsletters</p>
<p>
$mess messages</p>
<p>
$temps templates</p>
EOF;
echo 
$content?>
There seems to be no problem with that code.


Could it be something 'missing' on the server php wise (module perhaps, or is this pretty standard that should already be running?) as to why it isnt working for me? Im still getting the same error message
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 07:34 PM   #28
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by machinegunkelly View Post
Yea, thats why I asked him.

If I just wanted to build a site, I'd use a framework.

If I wanted to brush up my PHP skills, or master them.. Id not.

but if you just wanna get a site up and running.. and the syntax and fundamentals of PHP are slowing that down, alot of those fundamental problems become very trivial with a framework.

Based on his previous questions, the most likely outcome of him actually producing a live site, from the code he's been doing, is that it's instantly hacked, OR he's gotta spend 6 months learning hot to prevent every possible attack, how to sanitize data etc etc.

He'll NEVER get a site going.
I set myself a challenge of learning something new this year, PHP was what I chose to learn, if I'm using framework, I'm not really 'learning' anything substantial and I may as well just purchase pre-packed scripts and aplications.

By learning this myself, by hand, I'm actually enhancing my knowledge and have the option (at a later date) of putting something that I've learned into practice.

As far as not getting a site running, I'm already using a lot of what I've learned in the past few months as an ebook spinner and cover generator that has been a huge benefit to my main business, every day it generates as many new titles with covers as needed and they're all making sales each month

So while to some I may be taking the long route, as of right now, it appears to be paying off for me, despite hitting a few roadbumps along the way, but only by trying, asking and understanding where *I* am messing things up, will I actually learn anything and I genuinely do appreciate all of the help and advice (and yes, even criticism) that Ive bene getting for those of you who are more knowledgable about .php than I am at this point in time
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2022, 09:25 PM   #29
machinegunkelly
Confirmed User
 
machinegunkelly's Avatar
 
Join Date: Jun 2003
Posts: 3,281
Quote:
Originally Posted by Publisher Bucks View Post
I set myself a challenge of learning something new this year, PHP was what I chose to learn

Fair, Thats why I asked what your goal was.

Good luck brother!
__________________
dead.
machinegunkelly is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 05:45 AM   #30
Publisher Bucks
Confirmed User
 
Industry Role:
Join Date: Oct 2018
Location: New Orleans, Louisiana. / Newcastle, England.
Posts: 1,125
Quote:
Originally Posted by machinegunkelly View Post
Fair, Thats why I asked what your goal was.

Good luck brother!
Thanks
__________________
SOMETHING EXTREME IS COMING SOON!
Publisher Bucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 06:23 AM   #31
blackmonsters
Making PHP work
 
blackmonsters's Avatar
 
Industry Role:
Join Date: Nov 2002
Location: 🌎🌅🌈🌇
Posts: 20,244
Quote:
Originally Posted by Publisher Bucks View Post
Could it be something 'missing' on the server php wise (module perhaps, or is this pretty standard that should already be running?) as to why it isnt working for me? Im still getting the same error message
Download the file from the server, open it and make sure it's exactly what you uploaded.
See if line 11 has all 3 "<".

__________________
Make Money with Porn
blackmonsters is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-28-2022, 07:13 AM   #32
vdbucks
Monger Cash
 
Industry Role:
Join Date: Jul 2010
Posts: 2,773
Why use EOF at all?

https://onlinephp.io/c/ecc2f

Code:
<?php
  require_once 'config.php';
  login_required();
  $users = count_query("SELECT COUNT(*) AS num FROM users");
  $emails = count_query("SELECT COUNT(*) AS num FROM subscribers");
  $subs = count_query("SELECT COUNT(*) AS num FROM subscriptions");
  $nls = count_query("SELECT COUNT(*) AS num FROM newsletters");
  $mess = count_query("SELECT COUNT(*) AS num FROM messages");
  $temps = count_query("SELECT COUNT(*) AS num FROM templates");
  $title = "Home!";

  $content = "
    <h3>current stats</h3>
    <p>{$users} user registered</p>
    <p>{$emails} subscribers</p>
    <p>{$subs} newsletter subscriptions</p>
    <p>{$nls} newsletters</p>
    <p>{$mess} messages</p>
    <p>{$temps} templates</p>
  ";

  include 'layout.php';
?>
More importantly, you should work on your variable structure as conducting 6 different standalone queries like this isn't very efficient. Look into using subqueries instead.

vdbucks is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
error, code, php, message, blank, spaces, additional, white, parse, syntax, unexpected, assuming, fix, basic, putting, newsletter, program



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.