Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 23
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
No birthdays today

Next birthdays
05/11 ramses (16)
05/11 Arcstarter (31)
05/11 Zak (15)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: Computer Science
« Previous topic | Next topic »   

Anyone here good with PHP

1 2 3 
Move Thread LAN_403
Adam Munich
Sun Apr 10 2011, 02:54AM Print
Adam Munich Registered Member #2893 Joined: Tue Jun 01 2010, 09:25PM
Location: Cali-forn. i. a.
Posts: 2242
I need some (probably minor) php help. Is anyone here good with PHP?
Back to top
Adam Munich
Sun Apr 10 2011, 05:53PM
Adam Munich Registered Member #2893 Joined: Tue Jun 01 2010, 09:25PM
Location: Cali-forn. i. a.
Posts: 2242
So, nobody here knows PHP?
Back to top
Doubl3 Helix
Sun Apr 10 2011, 07:06PM
Doubl3 Helix Registered Member #1548 Joined: Mon Jun 16 2008, 09:22PM
Location: Ohio
Posts: 61
I've just started poking around with it as well. I guess if nobody else here offers up more help, maybe together we can figure it out? What kinds of problems are you having?
Back to top
Nicko
Sun Apr 10 2011, 07:10PM
Nicko Registered Member #1334 Joined: Tue Feb 19 2008, 04:37PM
Location: Nr. London, UK
Posts: 615
Grenadier wrote ...

I need some (probably minor) php help. Is anyone here good with PHP?
I've done a fair bit with it, though I'm rusty.

What do you need to know?

Back to top
Adam Munich
Sun Apr 10 2011, 08:01PM
Adam Munich Registered Member #2893 Joined: Tue Jun 01 2010, 09:25PM
Location: Cali-forn. i. a.
Posts: 2242
Well I decided to make a craigslist for electronics. Seeing as nobody else has tried to make one (except hackaday, but they did a poor job of it).

Link2

I ended up finding a nice PHP script online and I heavily modified the CSS and images to suit my likings. However the PHP script has a few issues:

*Large images >400kB will upload, yet thumbnails won't be made for them for some reason.
*There is no pagination, all the posts will show up on one page.
*There is no way to sort things by price; the only sorting going on is by date.
*Posts don't expire. They have timestamps but nothing deletes them after x amount of months, and that will clog up my server. The posts have timestamps so deletion might be easy to implement.

So... who thinks they can fix it? The last three should be easy fixes since all you are doing is re-arranging how the PHP displays the SQL database, but I know jack about PHP so I can't fix it.

I'm willing to give server access to those who think they can fix it (because if anyone decides to be a dick and change the password I could contact my server adnin and have him reset it)
Back to top
Carbon_Rod
Sun Apr 10 2011, 09:21PM
Carbon_Rod Registered Member #65 Joined: Thu Feb 09 2006, 06:43AM
Location:
Posts: 1155
PHP4 and PHP5 OO design are quite different.
Please post output from this code:
<?php phpinfo(); ?>

Note the maximum execution time, and memory limits.
Also remember the XSS attacks usually start with file uploads, and all images should be "watermarked" to check if it is really an image (trap an error flag, as content related to these IP are likely spam too).

I know about 28 different language lexicons (with countless dialects), and use PHP codeIgniter for quick remote server interfaces. SWiG wrappers are really handy for creating interfaces for C/C++ hardware drivers etc.

In my opinion, Craigslist is a horrible site as it is filled with too many scams, and still has no effective system of accountability.
=)

Cheers,
Rod
Back to top
Adam Munich
Sun Apr 10 2011, 11:21PM
Adam Munich Registered Member #2893 Joined: Tue Jun 01 2010, 09:25PM
Location: Cali-forn. i. a.
Posts: 2242
WAT.

I told you, I know absolutely nothing about PHP, it looks like swahili to me. Nonetheless I made that info page: Link2

And craigslist is a pretty good site IMO, it's often easy to tell who's a scammer. And with online money systems like google checkout and gaypal it's easy to get your money back if someone scams you.
Back to top
Carbon_Rod
Mon Apr 11 2011, 02:58AM
Carbon_Rod Registered Member #65 Joined: Thu Feb 09 2006, 06:43AM
Location:
Posts: 1155

Locate your php.ini file (like /etc/php5/apache2/php.ini) and edit the following configuration
(or override the defaults by placing a php.ini text file in a shared sever root web directory):

max_execution_time = 300
max_input_time = 60
upload_max_filesize = 8M
post_max_size = 16M
#and add or check if...
expose_php = Off
register_globals = Off
allow_url_fopen = Off

#Optional hide of Apache signature in /etc/apache2/apache2.conf
ServerTokens Prod
ServerSignature Off

Remember to restart your web server to propagate any changes:
sudo /etc/init.d/apache2 restart


Also, keep the number of concurrent file upload slots at 20 to reduce potential DoS issues.

Good luck,
Rod
Back to top
Nicko
Mon Apr 11 2011, 07:37PM
Nicko Registered Member #1334 Joined: Tue Feb 19 2008, 04:37PM
Location: Nr. London, UK
Posts: 615
Carbon_Rod wrote ...


Locate your php.ini file (like /etc/php5/apache2/php.ini) and edit the following configuration
(or override the defaults by placing a php.ini text file in a shared sever root web directory):
...
All good advice - more current than my PHP knowledge...
Back to top
Adam Munich
Tue May 03 2011, 01:45AM
Adam Munich Registered Member #2893 Joined: Tue Jun 01 2010, 09:25PM
Location: Cali-forn. i. a.
Posts: 2242
Well the person who was fixing it for me disappeared, so now I'm stuck again.

*Large images >400kB will upload, yet thumbnails won't be made for them for some reason.
The reason is line 174 of inc_thumbnail.php. It uncompresses the images and fills up the ram, 300kb image goes to 40MB, so that's no good.

*There is no pagination, all the posts will show up on one page.
Still not fixed.

*There is no way to sort things by price; the only sorting going on is by date.
This was fixed.

*Posts don't expire. They have timestamps but nothing deletes them after x amount of months, and that will clog up my server. The posts have timestamps so deletion might be easy to implement.
This was partialy fixed using a "scheduled task" php script, Link2 but it does not delete the post's associated image.


So, I'm still looking for some help and I'll give server access to those who think they can fix it. I really want to get this craigslist thing going, it could prove to be very useful.

Back to top
1 2 3 

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.