PHP Help (I'm Offering!)

chris218

New Member
Messages
130
Reaction score
0
Points
0
I'm offering PHP help.

I am pretty "fluent" in php, and have specialised knowledge in certain php software, for instance phpbb.

If you need a bit of help, PM me, or reply to this topic.

Thanks

Chris
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
ok i was trying to create a speicalized download system that would check my bandwidth before letting the end user download the file and also generate a random code like validation kind of thing, idk if this is too confusing, but like it would send the generated random code to their e-mail
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
the random generating code is possible, and is a 5 minute job. As for bandwidth thing... Does your host use cpanel to "moderate" your bandwidth? if not what does it use?
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
Sorry, forgot to ask a few questions.

1. Do you use a database? and what engine is it i.e mysql?
2. Do you use some kind of connecting class to connect to it? or do you use the standard php functions? if you do use a class, please post it here, so I can customize the exaple aproriatly.
3. Do you have php mail() avaible on your host?
4. Do you have an existing download system?

Thanks

Chris
 
Last edited:

chris218

New Member
Messages
130
Reaction score
0
Points
0
checked out your site..

I will take a look at this e107 download system, and try and modify it..

As for the bandwidth, as seen as it is x10, it must be cpanel, I will try and find a way of pulling the bandwidth, from cpanel, I have never needed to before!
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
had a look, but I would need quite a bit of time to examine this e107, and I don't really have the time.

If You know a bit of php, and you understand the e107 system, you could try (I don't know the e107 system, and i don't have enough time to "learn" it)

use rand() when the user loads the page, this is the code (out put of rand is a random number)

stored in database with the requested download's ID, and the user's IP.

uses mail() to email it.

Then redirects to an input page, you input the code your emailed. POSTs to a script, SELECTs from the database, the code that the user inputs, checks that this user is indeed from that IP, then use the ID to find the download and download it..

DELETE the row with that activation code once all done.

For an example of any of the previous, just ask, I will give you one, but you might need to tweak it for e107.
 

randomize

New Member
Messages
674
Reaction score
0
Points
0
Hey,

I am a complete n00b at PHP and I know the probably one thing, and that is a PHP include!

I was wondering, if you could tell me how to do the code for the following thing:

index?=staff

or along those lines! I think you understand what I mean!

Anyway, help would be helpful!

Oh and is there anyway to pull the latest forum posts from the forums, without using a CMS?? so its just a plain old PHP page, and it just pulls the newest posts?

Your help is grately appreciated dude!

Regards,
Randomize

P.S If it works, Ill send you some points!
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
ok, well for page=staff on the end of an file..

Code:
if ( $_GET['page'] == 'staff' )
{
CODE HERE IF ITS HTML EITHER USE ECHO, OR DO THE BELLOW
?>
HTML HERE
<?php
}

The above saved in index.php (if index.php is the directory index) could then be accessed

yoursite.com/blah/?page=staff

or yoursite.com/blah/index.php?page=staff
What forum software do you use?
 
Last edited:

randomize

New Member
Messages
674
Reaction score
0
Points
0
Code:
[/FONT]
[FONT=Tahoma][/FONT] 
[LEFT][SIZE=2]if ( $_GET['page'] == 'staff' )
{
CODE HERE IF ITS HTML EITHER USE ECHO, OR DO THE BELLOW
?>
HTML HERE
<?php
}[/SIZE]
[SIZE=2]
[/SIZE]

I don't completly understand that bit of code!

Erm the forum software is phpBB[/LEFT]
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
well its an if statement.

between the curly brackets (if your web pages are html i.e you don't code in php) you would put

?>
// your html
<?php

obvious it would have to be in a .php file
what info would you like to be pulled. ie just topic title?
 
Last edited:

randomize

New Member
Messages
674
Reaction score
0
Points
0
Yeah just the topic title!

oh and perhaps how would I do it if I wanted to show which section its under as well!

and as for the page code, I still aint understanding it, But I will find somewhere that will teach me!

Regards,
Randomize
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
ok,

http://www.phpbbhacks.com/download/2057 - topics anyway good MOD which will do what you want.

ok put that code in whatever file you want as long as it is a php file

the code for the page, page=staff goes beween the curly brackets - not that hard to understand

<?php

if ( $_GET['page'] == 'staff' )
{
MY STAFF PAGE HERE
}

?>
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
hey chris218, it seems your pretty good at php :D i started maybe a week or two ago but umm, as for what i have requested, it would most likely be a stand alone system, i don't want something already developed, i would like to have just a customized system made specifically for me, if that's not too much, if you have some sample code that would help or something haha thanks!
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
billybob bo buck said:
hey chris218, it seems your pretty good at php :D i started maybe a week or two ago but umm, as for what i have requested, it would most likely be a stand alone system, i don't want something already developed, i would like to have just a customized system made specifically for me, if that's not too much, if you have some sample code that would help or something haha thanks!
so do you not want it "added in" to the e107 system?

If not, thats no problem! I will sort some code out for you. As its not e107, I will stick a login system for the admin aswell, so you can easily add downloads.

Chris
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
thank you much! no i DO NOT want it installed into e107 or anything, just a customized standalone product THANK YOU SOOOO much!!
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
Ok, its all done for you!

Ok, the attached.

1) unzip
2) open includes/SystemComponent.php
3) do as guided, filling in info for your site (the site address one, include the directory this download system is in.
4) open includes/mail.php Set all the settings in their as instructed, again the site address, include the directory the download system is in.
5) open header.php, right at the bottom, there is a link, where it says site here, put your main site address there (its a link back on all pages)
6) open db.sql, where it says INSERT INTO dl_users, find md5('admin') and relplace admin with your cp password
7) copy paste whole of db.sql, into something like phpmyadmin, and run it in the right database.
8) upload folder (I recommend yoursite.com/downloads)
9) the admin area is found at yoursite.com/downloads/admin

Enjoy!!
 

Attachments

  • downloads.zip
    17.2 KB · Views: 5

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
thank you so much chris218! that's great, i hope this works well, i'm sure it will but we all hope for the best
THANK YOU THANK YOU THANK YOU!
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
billybob bo buck said:
thank you so much chris218! that's great, i hope this works well, i'm sure it will but we all hope for the best
THANK YOU THANK YOU THANK YOU!
If you have any problems don't hesitate to ask me!
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
ok will do, i have wanted one of these for a while...as far as the random code generator, is that implemented into the system? i would love to have that in there, just sorta as a verifier and also is the bandwidth checker in there?
 

chris218

New Member
Messages
130
Reaction score
0
Points
0
billybob bo buck said:
ok will do, i have wanted one of these for a while...as far as the random code generator, is that implemented into the system? i would love to have that in there, just sorta as a verifier and also is the bandwidth checker in there?
the bandwidth checker isn't in there, but the code validation is.

I'm still trying to find out how to implement the bandwidth checker.
 
Top