Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,157,947 members, 7,835,160 topics. Date: Tuesday, 21 May 2024 at 06:16 AM

Php Class For Beginners. Question Will Be Treated With High Priority. - Webmasters (10) - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Php Class For Beginners. Question Will Be Treated With High Priority. (35213 Views)

How Should Archive And Label Pages Be Treated? / Blogging Advice For Beginners / Designing A Website: For Beginners (2) (3) (4)

(1) (2) (3) ... (7) (8) (9) (10) (11) (12) (13) (Reply) (Go Down)

Re: Php Class For Beginners. Question Will Be Treated With High Priority. by lashman(m): 7:30pm On Oct 12, 2010
@DualCore: Just like you have mentioned, we intend to reduce or eliminate "trashed based web devs" in the market to the barest minimum, the industry is filled with them, it makes it difficult for customers to really define value any longer. They (customers) begin to see every developer with the look of caution and begin to trivialize the value developers bring on board.

However, this PHP Training is one of the development trainings in our arsenal, we also will be commencing ASP.NET training in the first quarter of next year.

Once again, thanks DualCore, meanwhile, navigated to your website, Loving the concept of a desktop win vista style, pretty nice. If you know any newbies in the market please refer them for the training, kind regards
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by quadrillio(m): 3:33pm On Oct 13, 2010
lashman:

@DualCore: Just like you have mentioned, we intend to reduce or eliminate "trashed based web devs" in the market to the barest minimum, the industry is filled with them, it makes it difficult for customers to really define value any longer. They (customers) begin to see every developer with the look of caution and begin to trivialize the value developers bring on board.

However, this PHP Training is one of the development trainings in our arsenal, we also will be commencing ASP.NET training in the first quarter of next year.

Once again, thanks DualCore, meanwhile, navigated to your website, Loving the concept of a desktop win vista style, pretty nice. If you know any newbies in the market please refer them for the training, kind regards

if you want to do the text in bold then start by leading with example. your website (though looking simple enough) is not telling me anything except stalled news.

Give that site a FACE. until then can you mean what u said above. OK?

I won't want to say much about the site since it's not under review but, by now you should understand what DC is trying to point out.

- SAFE.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Nobody: 4:47pm On Oct 13, 2010
@Dual and Quadri, You guys are funny ohhh.

@Quadrillio, Start something on Advance PHP. I mean Crazily Nice functions and uses. That are handy!
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by ajaxphp7: 4:21pm On Oct 14, 2010
Thanks for all the contribution in Nairaland. quadrillio I actually saw one of your contribution and I am actually doing a project on that
Which is the form that does the posting

<form action="./upload.php" method="post" enctype="multipart/form-data">
<p>
<label for="file">Select a file:</label> <input type="file" name="userfile" id="file">

<button>Upload File</button>
<p>
</form>
The page that does the processing
<?php
// Configuration - Your Options
$allowed_filetypes = array('.jpg','.gif','.bmp','.png'); // These will be the types of file that will pass the validation.
$max_filesize = 524288; // Maximum filesize in BYTES (currently 0.5MB).
$upload_path = './files/'; // The place the files will be uploaded to (currently a 'files' directory).

$filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).
$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.

// Check if the filetype is allowed, if not DIE and inform the user.
if(!in_array($ext,$allowed_filetypes))
die('The file you attempted to upload is not allowed.');

// Now check the filesize, if it is too large then DIE and inform the user.
if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize)
die('The file you attempted to upload is too large.');

// Check if we can upload to the specified path, if not DIE and inform the user.
if(!is_writable($upload_path))
die('You cannot upload to the specified directory, please CHMOD it to 777.');

// Upload the file to your specified path.
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename))
echo 'Your file upload was successful, view the file <a href="' . $upload_path . $filename . '" title="Your File">here</a>'; // It worked.
else
echo 'There was an error during the file upload. Please try again.'; // It failed Sad.

?>
That is the code you gave. Please can you help me modify the script in a way that the picture uploaded to the folder in the server can be call up after it has been posted.
A good example is the kind you have in JAMB Website after Posting the form it does the processing and also call it Up on the Page.
Please help.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by quadrillio(m): 2:37pm On Oct 18, 2010
ajaxphp7:

Thanks for all the contribution in Nairaland. quadrillio I actually saw one of your contribution and I am actually doing a project on that
Which is the form that does the posting

<form action="./upload.php" method="post" enctype="multipart/form-data">
<p>
<label for="file">Select a file:</label> <input type="file" name="userfile" id="file">

<button>Upload File</button>
<p>
</form>
The page that does the processing
<?php
// Configuration - Your Options
$allowed_filetypes = array('.jpg','.gif','.bmp','.png'); // These will be the types of file that will pass the validation.
$max_filesize = 524288; // Maximum filesize in BYTES (currently 0.5MB).
$upload_path = './files/'; // The place the files will be uploaded to (currently a 'files' directory).

$filename = $_FILES['userfile']['name']; // Get the name of the file (including file extension).
$ext = substr($filename, strpos($filename,'.'), strlen($filename)-1); // Get the extension from the filename.

// Check if the filetype is allowed, if not DIE and inform the user.
if(!in_array($ext,$allowed_filetypes))
die('The file you attempted to upload is not allowed.');

// Now check the filesize, if it is too large then DIE and inform the user.
if(filesize($_FILES['userfile']['tmp_name']) > $max_filesize)
die('The file you attempted to upload is too large.');

// Check if we can upload to the specified path, if not DIE and inform the user.
if(!is_writable($upload_path))
die('You cannot upload to the specified directory, please CHMOD it to 777.');

// Upload the file to your specified path.
if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename))
echo 'Your file upload was successful, view the file <a href="' . $upload_path . $filename . '" title="Your File">here</a>'; // It worked.
else
echo 'There was an error during the file upload. Please try again.'; // It failed Sad.

?>
That is the code you gave. Please can you help me modify the script in a way that the picture uploaded to the folder in the server can be call up after it has been posted.
A good example is the kind you have in JAMB Website after Posting the form it does the processing and also call it Up on the Page.
Please help.


to achieve your goal we need to do the following modification to the processing.

- renaming the images with a unique name which should be generated automatically during upload
- a table or a column in a table(d one that stores d other information) that stores the name and location of the image.
- sql query that will call the name & location for display.

(I want to assume u already've d form and folder ready)

will put up a tutorial on the above and post it here ASAP.

Donpuzo:

@Dual and Quadri, You guys are funny ohhh.

@Quadrillio, Start something on Advance PHP. I mean Crazily Nice functions and uses. That are handy!
no mind us jare

I believe d solution above is a good way to start such advance tutorial, I want you guy to contribute o.

- SAFE.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by timmyade: 5:58pm On Oct 19, 2010
thanks for the help out here. May the good Lord reward and crown your efforts,
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Nobody: 8:18pm On Oct 19, 2010
@Quadrillion. I sure will contribute, if i am less busy.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Wexcel: 4:40pm On Oct 22, 2010
I also I some good E-Books to give out just post ur email and the book(PHP, Python etc.) will be mail to your box.
Regards
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by zenith2020(m): 11:43am On Oct 23, 2010
Am new in the discussion topic i want knew what and what to do to start design site using php can you help me please cheesy
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by noibilism(m): 5:28pm On Oct 25, 2010
Please can you help?
I need to populate a "select field" in a form from a mysql database.Can anybody help with the scripting?
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by utimayor(m): 7:24pm On Oct 25, 2010
i downloaded a certain web application from sourceforge, in the installation package, i was instructed to 'execute' the install.php on my control panel, how do i execute this file? i doubleclicked the file and it starts to download.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by geebengs(m): 9:14am On Oct 26, 2010
Hello guys. For those of u that really wants to learn and learn fast, u have to cultivate the habit of less reliance on somebody who will explain codes to u. Your most important tool on the web is google. Google all your challenges ( be it code or implementation of a function), u'll surely find an answer on google. There's no programming challenge u might be facing that some people on the web have not faced before and that has not been solved in several ways before. SO make google your friend even as you visit this forum for solutions. Good Luck!
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by geebengs(m): 9:30am On Oct 26, 2010
@ uti-mayor. I downloaded a certain web application from sourceforge, in the installation package, i was instructed to 'execute' the install.php on my control panel, how do i execute this file? i doubleclicked the file and it starts to download.

You can not view a .php file on a browser directly(unlike a .html file). You need an apache server like xampp or wampp. If u have an apache server installed on your computer already, make sure u start it and that apache is running on it. After doing that, go to the location where ur server is installed, find htdocs directory then copy and paste the folder you downloaded from source forge, which contains the installer.php file you want to view in a browser, into the htdocs directory. Once that is done, open your browser and type the url to the file like this: http://localhost/the foldername/installer.php. Hit enter. You should see the page show up if you followed the instructions correctly.

Hope this help.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by quadrillio(m): 2:45pm On Oct 26, 2010
@geebengs,
Thanks, Well said.

noibilism:

Please can you help?
I need to populate a "select field" in a form from a mysql database.Can anybody help with the scripting?

here is a function that poulate the LGs in a state from d database, let me know if u have an problem

function sellg_drop()
{
$lg="SELECT lgname FROM lg ORDER BY lgname ASC";
$lg2=mysql_query($lg) or die("Could not grab Location"wink;
$output .="<select name='lg'>";
$output .="<option value=''>Select Location</option>";
while($lg3=mysql_fetch_array($lg2))
{
$output .="<option value='$lg3[lgname]'>$lg3[lgname]</option>";
}
$output .="</select>";
return $output;
}
Just call d function and print d output.

I believe u get this.

zenith2020:

Am new in the discussion topic i want knew what and what to do to start design site using php can you help me please cheesy
please start with www.wschools.com

- SAFE
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by utimayor(m): 3:43pm On Oct 26, 2010
geebengs:

You can not view a .php file on a browser directly(unlike a .html file). You need an apache server like xampp or wampp. If u have an apache server installed on your computer already, make sure u start it and that apache is running on it. After doing that, go to the location where your server is installed, find htdocs directory then copy and paste the folder you downloaded from source forge, which contains the installer.php file you want to view in a browser, into the htdocs directory. Once that is done, open your browser and type the url to the file like this: http://localhost/the foldername/installer.php. Hit enter. You should see the page show up if you followed the instructions correctly.

Hope this help.

@geebengs thanks but i am a still a little confused, please explain in a layman's understanding.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Youngichou(m): 8:10am On Oct 27, 2010
A little tip here. It may be usefull depending on your Website Control Panel.
But this applies to Cpanel.
On CPANEL if you should create an uploading script and run it on. All files will by default be CHMOD to 0644 and this is not good in some instances for example if you are developing a downloading and uploading site as you wont have full control over those item untill you manually CHMOD it or you do so using the Php function. Now to combat this dont use the [B]Move_uploaded_file function rather use the Copy file function and by default all your items will be Chmod to 777[/b] note that this is usefull if you want to delete items on your site without doing it manually but by running a Script
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Youngichou(m): 8:29am On Oct 27, 2010
This is another tip i fill may be usefull i found it when i had similar problems.
You may be developing a client site for example a fashion site and its kinda a customised site where she uploads her fashion pics now since she do this uploading daily some files (by this i mean pictures) may have the same name with the others she uploaded yesterday now if she should upload this new files it will by default override the former file. In other to combat this Modify all file uploading file name by adding a UNIQUE NUMBER TO ITS NAME. AND THEN HAVE THIS FILE UPLOADED OR YOU CAN [b] Add the DATE AND TIME Of UPLOAD TO THE UPLOADING FILE NAME[/B] this will prevent overriding since No Day and time can ever repeat itsself.
PLEASE PARDON ME AM NOT EXPLAINING THIS WITH CODES BECAUSE AM ON MY MOBILE PHONE.
uti-mayor:

@geebengs thanks but i am a still a little confused, please explain in a layman's understanding.
ok Friend let me explain before Geebengs add more you cant view any SERVER SIDE LANGUAGE SCRIPT IN ITS PROCESSED FORM Just like that you have to use A Server and this is something like a Website Control panel. While if you want to view it on your local Computer you have to get a XAMPP OR WAMP SERVER. You can download it. They are open source but pls i would advice you Go for Xampp and not Wamp
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Youngichou(m): 8:31am On Oct 27, 2010
This is another tip i fill may be usefull i found it when i had similar problems.
You may be developing a client site for example a fashion site and its kinda a customised site where she uploads her fashion pics now since she do this uploading daily some files (by this i mean pictures) may have the same name with the others she uploaded yesterday now if she should upload this new files it will by default override the former file. In other to combat this Modify all file uploading file name by adding a UNIQUE NUMBER TO ITS NAME. AND THEN HAVE THIS FILE UPLOADED OR YOU CAN [b] Add the DATE AND TIME Of UPLOAD TO THE UPLOADING FILE NAME[/B] this will prevent overriding since No Day and time can ever repeat itsself.
PLEASE PARDON ME AM NOT EXPLAINING THIS WITH CODES BECAUSE AM ON MY MOBILE PHONE.
uti-mayor:

@geebengs thanks but i am a still a little confused, please explain in a layman's understanding.
ok Friend let me explain before Geebengs add more you cant view any SERVER SIDE LANGUAGE SCRIPT IN ITS PROCESSED FORM Just like that you have to use A Server and this is something like a Website Control panel. While if you want to view it on your local Computer you have to get a XAMPP OR WAMP SERVER. You can download it. They are open source but pls i would advice you Go for Xampp and not Wamp
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Youngichou(m): 8:57am On Oct 27, 2010
@UTI-MAYOR
this is a detailed explanation of what to do.
1. [B]DO THIS IF YOU WANT TO RUN THE SCRIPT ON YOUR COMPUTER[/B]
I will assume you are using XAMPP.
Now copy the files you downloaded from Source Forge. NOW OPEN Your Local Disk and look for where your XAMPP folder.
[B] NOTE THIS I use Windows Vista but am going to give little tip On Xp too because i dont know your Os[/b] if you use Xp open your Local Disk => goto programm files and search for Xampp. But if you use Vista follow the latter process. NOW OPEN THE Xampp folder and look for the folder named [B]HTDOCS[/b] open this folder and paste what you copied (i.e the file you downloaded).
NOW Follow Attentively.
Note or take a look at where the install.php folder resides in that htdocs folder. For example if when you open the htdocs you see the install.php file then it means the file exist in the root but if you have to open other files note the files you have to open to see this install.php after you note this
Open your MOzilla or any other browser and type in this
127.0.01/the folders path linkin to where the install.php file exist/ install.php
but if your file exist in the root folder which is when you open you Htdocs you see the install.php file then type in this 127.0.01/install.php this is it
2. IF YOU ARE ON A WEBSITE CONTROL PANEL FOLLOW THE SAME PROCEDURE THE DIFFERENCE HERE IS THIS upload the file into your Cpanel go to where you upload the file CHMOD it to 777 but i will advice you to do this to 755. If you know you dont want to delete the install.php file. This will prevent hackers. After doing this go to your browser and type in www.nairaland.com/the path to where the install.php file is /install.php or if the file is in your root folder type in www.nairaland.com/install.php pls note that you replace nairaland with the website domain. This is all.
I Think you ok now.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by quadrillio(m): 11:05am On Oct 27, 2010
^^^ Thanks bro, you're a darling, muuuah. grin grin grin

@UTI-MAYOR, I believe it's ok now?

- SAFE
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Nobody: 3:03pm On Oct 27, 2010
@Young. Very true of that example you gave of a file upload site.

But i must say your method is poor. Cause in sites like facebook, people upload files the same day with the name sample.jpg so concatenating will fail.

Ultimate solution is concatenating a uniquely generated random number, with the file name!

I am developing a chat solution currently among my many projects and i had to use such method, in case two people with the same name come online for a chat!
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by utimayor(m): 5:49pm On Oct 27, 2010
Youngichou, thanks, smiley i am now good, anybody with any news publishing source code? as in publishing news like sun news papres do online.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Nobody: 11:35pm On Oct 31, 2010
Sorry for going off topic, but we need more people for an upcoming programming contest, so I decided to post a link to it here since this thread has been sticky[b]ied.[/b]

https://www.nairaland.com/nigeria/topic-541906.0.html
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by lashman(m): 11:49am On Nov 01, 2010
Thank you all for attending our training programme, it wouldn't have been a success without you guys.

We really appreciate your presence and look forward to seeing you at the next event we will be organising in the first quarter of next year.

Please send in your comments so we can begin to include them in our delivery plan for the future.

Once again thanks a bunch !!!

for more information on our past programme please visit www.synkronsolutions.com/training.php
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by quadrillio(m): 4:23pm On Nov 01, 2010
lashman:

Thank you all for attending our training programme, it wouldn't have been a success without you guys.

We really appreciate your presence and look forward to seeing you at the next event we will be organising in the first quarter of next year.

Please send in your comments so we can begin to include them in our delivery plan for the future.

Once again thanks a bunch !!!

for more information on our past programme please visit www.synkronsolutions.com/training.php
Mr. Man, what's your problem?

This is your last warning.

- SAFE.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Youngichou(m): 5:19am On Nov 02, 2010
quadrillio:

Mr. Man, what's your problem?

This is your last warning.

- SAFE.

lol!
Small small guy
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by quadrillio(m): 9:50am On Nov 02, 2010
^^^ the guy is just annoying, why can't he just cari him market go front, must it be where people are learning.

If I ve a candidate that wants to learn, I wouldn't recommend d guy. How can u repeat d same nasty action twice. HABA.

even d dead link he supplied it not opening (sorry I ve already called it a dead link so how can it open)

- SAFE.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by noibilism(m): 2:08pm On Nov 02, 2010
lashman:

Thank you all for attending our training programme, it wouldn't have been a success without you guys.

We really appreciate your presence and look forward to seeing you at the next event we will be organising in the first quarter of next year.

Please send in your comments so we can begin to include them in our delivery plan for the future.

Once again thanks a bunch !!!

for more information on our past programme please visit www.synkronsolutions.com/training.php
All these people that keep advertising trainings of "php within 7 days" in my opinion are cheats.

quadrillio:

@geebengs,
Thanks, Well said.

here is a function that poulate the LGs in a state from d database, let me know if u have an problem

function sellg_drop()
{
$lg="SELECT lgname FROM lg ORDER BY lgname ASC";
$lg2=mysql_query($lg) or die("Could not grab Location"wink;
$output .="<select name='lg'>";
$output .="<option value=''>Select Location</option>";
while($lg3=mysql_fetch_array($lg2))
{
$output .="<option value='$lg3[lgname]'>$lg3[lgname]</option>";
}
$output .="</select>";
return $output;
}
Just call d function and print d output.

I believe u get this.
please start with www.wschools.com

- SAFE
God bless you for this code it is working fine now.
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by quadrillio(m): 10:41pm On Nov 02, 2010
^^^ AMEN, my bro, good to hear dat the code worked for u. No mind dat "7 Days miracle" guy. I am not against him advertising his miracle centre. He should take it to another thread. SIMPLE.

- SAFE
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by geniusauthor(m): 2:16pm On Nov 05, 2010
plz i need a help on site spinner licence key, the software is the best for beginers webdesign,i downloaded the trial version and it will expire in three days time,plz anybody got the key,i love the software and i don;t want to loseit
thanks
Re: Php Class For Beginners. Question Will Be Treated With High Priority. by Nobody: 3:14pm On Nov 05, 2010
@Geniusautthor, Buy the license!

(1) (2) (3) ... (7) (8) (9) (10) (11) (12) (13) (Reply)

best BULK SMS provider in Nigeria ? / When You Are A Computer Guru And Your Girlfriend Needs Your Assistance / The Meaning Of CAPTCHA & 6 Types Of CAPTCHA

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 76
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.