RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 3501 | Replies: 18 | Thread Tools  Display Modes
Reply
Join Date: Apr 2004
Posts: 27
Reputation: Gnome_101 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
Gnome_101 Gnome_101 is offline Offline
Light Poster

Re: Hello Dani Web members

  #11  
Jun 4th, 2005
you could also open a localhost on your machine, as long as you have internet connection.

Try downloading Apache servers with the self installing php!
It'll make the hosting problem dissapear!

Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: Hello Dani Web members

  #12  
Jun 4th, 2005
I learnt php + mysql from Internet sites. One I most recommended is http://www.php-mysql-tutorial.com/index.php. It would be easier if you know VB.

For hosting, you can get a few free for practice purposes. Do google search.
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
Join Date: May 2005
Posts: 9
Reputation: michaelK5 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
michaelK5 michaelK5 is offline Offline
Newbie Poster

News Re: Hello Dani Web members

  #13  
Jun 4th, 2005
Hey all,

Ok here is an new update on my behalf. I have printed all 1801 pages of the php.net manual.

I have study this manual inside and out and have read all pages and did all exmples they had posted in the manual. The I went to the book store and bought 10 different php books and have read about 3 of them already.

You would think after reading the php.net manual and at least 3 books I would know how to write php, but I am still not understanding everything I have read.


I am trying to make a contact form, a Place Ad form, and a edit ad form,
the contact use form is I am sure all easy to you guys. But for some reason I do not know where to begin.

the Place ad form, I want people to be able to post ads about there cars they have for sell, and well with the Edit Ad I am sure you know what that means as well.

One other thing I am trying to make a Upload script as well for the same site, that will upload and update the clients pictures of there cars or to add new pictures.


Can any one here give me a hand on how this would all be done.


Thank you all for the help in advanced.
MichaelK5 - :cheesy:
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: Hello Dani Web members

  #14  
Jun 7th, 2005
I don't think reading is enough and effective way to learn something like php. hand on practical experience is more important. I learnt php not even bought a book or print out the manual. I suggest you search for script (from Internet) that you want to program with and modify the code to suit your need. I only refer the manual when I need function that I not totally understand, or cannot remember, such as date's variables.

Here's email contact script:
[PHP]<?php
if(strlen($_POST["textarea"]) > 10 && isset($_POST["email"])) {
$mssg = str_replace(Chr(13), "<br>", $_POST["textarea"]);
$mssg = stripslashes($mssg);
$to = "yourself@yourdomain.com";
$subject = $_POST["subject"];
$message = "<i>Message from ". $_POST["client"] .":</i>\r\n<br><br>";
$message .= $mssg;

// and now mail it and print confirmation
mail($to, $subject, $message, $headers);
echo "<h1>Email Sent! </h1>";
}
?>
<form name="form" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<table width="100%" border="0" cellspacing="2" cellpadding="3">
<tr>
<td width="25%">Your Name:</td>
<td width="75%"><input type="text" name="client" size="30"></td>
</tr>
<tr>
<td>Your Email:</td>
<td><input type="text" name="email" size="30"></td>
</tr>
<tr>
<td>Subject:</td>
<td><input type="text" name="subject" size="30"></td>
</tr>
<tr valign="top">
<td height="25">Message:</td>
<td><textarea name="textarea" rows="10" cols="65"></textarea></td>
</tr>
<tr valign="bottom">
<td></td>
<td><input type="submit" name="Submit" value=" Send Email "></td>
</tr>
</table>
</form>
[/PHP]
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: Hello Dani Web members

  #15  
Jun 7th, 2005
Here is the upload script:
[PHP]<form method="POST" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%">File 1:</td>
<td width="80%"><input type="file" name="file1" size="35"> </td>
</tr>
<tr>
<td>File 2: </td>
<td><input type="file" name="file2" size="35"> </td>
</tr>
<!-- can add more input here -->
<tr>
<td>&nbsp;</td>
<td height="40"><div align="center">
<input type="submit" name="submit" value=" Upload ">
</div></td>
</tr>
</table>
</form>
<?php
// In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of $_FILES.
if($_FILES["file1"]["size"] > 0) {
echo "<h4>Upload Result</h4>";
for ($i=1; $i<=5; $i++)
{
$file = $_FILES["file".$i];
echo "File ".$i.": ";
if($file["size"] > 0) {

$fileName = basename($file["name"]);
$ext = substr($fileName, -3, 3);
// filter file you allow to upload
$accept = array('pdf','doc','xls','ppt','txt','zip');

// filter filesize
if ($file["size"] > 500000) {
echo "Filesize over 500 KB limit.<br>\n";
}
elseif(!in_array($ext, $accept)) {
echo "Invalid file format. <br>\n";
}
else {
// set folder path to which image uploaded
$uploaddir = "../shop/".$shop_id."/"; // name of directory

//copy the file to some permanent location
if (move_uploaded_file($file["tmp_name"], $uploaddir . $file["name"])) {
echo $file["name"]." uploaded.<br>\n";
} else {
echo "Error found. Please try again. <br>\n";
}
}
} else {
echo "File not found.<br>\n";
}
}
}
?>[/PHP]
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
Join Date: May 2005
Posts: 9
Reputation: michaelK5 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
michaelK5 michaelK5 is offline Offline
Newbie Poster

Re: Hello Dani Web members

  #16  
Jun 8th, 2005
Zippee,

For some reason the e-mail script is not working it never sends the test mail to me.

Upload script is not working either, its giving me the following.....


File 1:
File 2:


Upload Result
File 1: Invalid file format.
File 2: File not found.
File 3: File not found.
File 4: File not found.
File 5: File not found.
Reply With Quote  
Join Date: Jan 2005
Location: Sheffield, UK
Posts: 294
Reputation: zippee is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
zippee's Avatar
zippee zippee is offline Offline
Posting Whiz in Training

Re: Hello Dani Web members

  #17  
Jun 9th, 2005
1. Make sure your hosting enable smtp, so that email can be sent out.
2. Make sure you upload the correct file extension, as listed.
Ecommerce-Web-Store.com Building Your e-Business.
Reply With Quote  
Join Date: Jun 2005
Posts: 13
Reputation: axieaxie is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
axieaxie axieaxie is offline Offline
Newbie Poster

Solution Re: Hello Dani Web members

  #18  
Jun 11th, 2005
:cool: You're come a right place
Reply With Quote  
Join Date: May 2005
Posts: 9
Reputation: michaelK5 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
michaelK5 michaelK5 is offline Offline
Newbie Poster

Re: Hello Dani Web members

  #19  
Jun 11th, 2005
Well Ok I have gotten the Contact us form to work.
But I still can not upload anything using the script Zeppe gave me even with the changes within our pms.


I am wondering if anyone else can help fix this problem.

Thank you.

P.S. I have started a New community forum and could use some feedback and php helpers.. If anyone is could help please let me know..
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the PHP Forum
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:13 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC