Jump to content

$Three3

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

$Three3's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a PHP contact form on my website. I have been using it for about a year now without any problems. Nothing has been updated on my website that has do to with the contact form. However, all of a sudden, when a user enters "line breaks" or "paragraphs" in the message box, when I receive the message, instead of having several paragraphs I have 1 long paragraph with "\r\n" in place of line breaks. Here is the code: $to = "[email protected]"; $headers = "From: $email"; $subject = $subject; $body = "Name: $name\n\n" . "Email: $email\n\n" . "Subject: $subject\n\n" . "Message: $message" ; mail ($to, $subject, $body, $headers) ; For example, if someone fills out my contact form, here is what it looks like in my inbox: Name: Allen Falcon Email: [email protected] Subject: Help Message: Hello,\r\n I would like to know more about you guys program and how it works.\r\n Thanks,\r\n Allen Flacon I really do not know why it started doing this out of the blue but any help is greatly appreciated!
  2. Hi everyone, I have a long list of names that I need to have quotes around (it can be double or single quotes) and I have about 8,000 of them. I have them in Excel without any quotes and I can copy all of the names and paste them no problem but there are still no quotes. I have looked and looked for an Excel formula to add quotes to the name in each row but I have had no luck. I have also tried some clever find and replace techniques but no have worked either. The format I am looking for is this: "Allen" or 'Allen' Any of those would work. I need this so I can store the info into a database. Any help is greatly appreciated. Thanks PS: I have found other people online needing the same thing done that I need done and this solution has worked for them but I do not know what do with it: Sub AddQuote() Dim myCell As Range For Each myCell In Selection If myCell.Value <> "" Then myCell.Value = Chr(34) & myCell.Value End If Next myCell End Sub Another solution that also worked for others was: Sub OneUglyExport() Dim FileToSave, c As Range, OneBigOleString As String FileToSave = Application.GetSaveAsFilename Open FileToSave For Output As #1 For Each c In Selection If Len(c.Text) <> 0 Then _ OneBigOleString = OneBigOleString & ", " & Chr(34) & Trim(c.Text) & Chr(34) Next Print #1, Mid(OneBigOleString, 3, Len(OneBigOleString)) Close #1 End Sub
  3. A leading / on a file system path refers to the root of the current hard disk. I suspect that you want - "users/$directory" or that you want to form an absolute file system path made up of your document root path followed by /users/$directory Thanks a lot man. That worked perfectly.
  4. Hi everyone, I am stuck on a simple script. I have tried Googling it and I have tried all of the stuff I found on Google but none of it has worked for me. I am trying to you the mkdir function but I keep getting an error that says: Warning: mkdir() [function.mkdir]: No such file or directory in /home/content/l/i/n/web/html/php/mkdir.php on line 6 Here is my code: <?php //Create the directory for the user $directory = time() . rand(0, 49716) ; if (mkdir("/users/$directory", 0777)) { echo '<p>Directory was created successfully.</p>' ; } else { echo '<p>Directory was NOT created.</p>' ; } ?> I am placing the script called mkdir.php in the same folder as the users folder. The users folder has the permissions set to 0777. I am not sure why I keep getting this error because the users folder does exists. Any help is greatly appreciated.
  5. Can You Import an Excel File to a MySQL Database using phpMyAdmin? I am looking to buy this database that has the data of all Colleges and Universities in the US. The file is in Excel format. Can this be imported into phpMyAdmin? Here is the site where I am going to buy the database from if this is possible: http://www.data-lists.com/universities-colleges-database.html?gclid=CPGXkN6H6aECFeQc5wodBFPRIg You can download a sample of the database that has 10 entries. I have tried importing this into phpMyAdmin but this is the error I am getting: And then at the bottom of the error it says: Any help is greatly appreciated.
  6. Hey everyone, I have a quick question. I want to build a web app for myself that will allow me to post stuff to Craigslist and retrieve postings from Craigslists. I am not doing this to spam Craigslist, I am just doing it to learn. My question is: Is this possible? If so, will knowing PHP be enough? Or will I also need to know how to use the cURL library? Thanks in advance for the help and advice.
  7. Hello everyone, I am working on a site similar to Craigslist where users can make postings and sell items in different cities. One difference between my site and Craigslist will be you will be able to search by zip code instead of having all of the cities listed on the page. I already have the ZIP Code database that has all of the city, state, latitude, longitude, and zip code info for each city. Okay, so to dive into what I need done and what I need help with: 1.) Although I have the ZIP Code database, it is not setup perfectly for my use. (I downloaded it off of the internet for free from http://zips.sourceforge.net/) 2.) I need help setting up my database structure (Ex: How many different tables should I use and how should I link them) I will be using PHP and MySQL. These our my thoughts so far on how the database can be setup: (I am not sure if this will work though.) Scenario: Someone goes to the homepage and it will tell them, "Please enter your ZIP Code.". If they enter "17241" for example, this ZIP Code is for a city named Newville located in Pennsylvania. The query would look like this with the current database setup: SELECT city FROM zip_codes WHERE zip = 17241; The result of the query would be "Newville". The problem I see here now is when they want to post something in the Newville section of the site, I will have to have an entire table setup just for the Newville city postings. There are over 42,000 cities which means I would have to have over 42,000 tables (one for each city) so that would be insane to have to do it that way. One way I was thinking of doing it was to add a column to the ZIP Code database called "city_id" which would be a unique number assigned to each city. So for example, the city Newville would have a city_id of 83. So now if someone comes and post a listing in the city Newville I would only need one other table. That one other table would be setup like this: CREATE TABLE postings ( posting_id INT NOT NULL AUTO_INCREMENT, for_sale LONGTEXT NULL, for_sale_date DATETIME NULL, for_sale_city_id INT NULL, jobs LONGTEXT NULL, jobs_date DATETIME NULL, jobs_city_id INT NULL, PRIMARY KEY(posting_id) ); (The for_sale and job_ column names are categories of the types of postings users will be able to list under. There will be many more categories than just those two but this is just for example.) So now when when someone comes to the website and they are looking for something to buy and not sell, they can enter their ZIP Code, 17241, for example, and this is the query that will run: SELECT city, city_id FROM zip_codes WHERE zip = 17241; //Result: Newville 83 (Please note that I will be using PHP to store the ZIP Code the user enters in SESSIONS and Cookies to remember them throughout the site) Now it will tell them, "Please choose your category.". If they choose the category "Items For Sale" then this is the query to run and sort the results: SELECT posting_id, for_sale, for_sale_date FROM postings WHERE for_sale_city_id = $_SESSION['zip_code']; Will this work? So now my question to everyone is will this work? I am pretty sure it will but I do not want to set this thing up and realize I overlooked something and have to start from all over from scratch. Any opinions and ideas are welcomed and I will listen to anyone who has some thoughts. I really appreciate the help in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.