Jump to content

IHaveAQuestion

New Members
  • Posts

    8
  • Joined

  • Last visited

IHaveAQuestion's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ISSUE. A User enters information into a form. If the 'username' is already taken, a 'message' in Red and with larger font-size will be returned, for example, "The username $username already exists." If the username is 'mattd' then the message should say, "The username mattd already exists." Within my php application, I have included 'inline html'. Here is part of the code: .... if (mysql_num_rows($query_run)==1) { // it will never = more than one because only //one user will or will not exist ?> <html> </body> <h1><font color="#FF0066">The username <?php echo $username; ?>already exists.</h1> </body> </html> <?php }else{ //start the registration process $query = "INSERT INTO `Names` VALUES .... 1. At one point I did get this: "The username mattd already exists." 2. But now I only get "The username already exists." I am not retrieving the $username variable. This screenshot is found here: http://imgur.com/lIwLZ1G thanks.
  2. Here is the text within those screenshot fields. Site window settings. Site Name: dwwdSite Local site folder: /Library/WebServer/Documents/dwwdSite Server window settings. Server Name: testing Server Address: Macintosh HD/Library/WebServer/Documents/dwwdSite Connect using: Local/network Testing: yes (checked) Server folder: /Library/WebServer/Documents/dwwdSite (I also tried this: Server folder: /Library/WebServer/Documents) Web URL: http://www.localhost/dwwdSite Server Advanced tab: (within server window settings) Testing server: PHP MySQL Advanced Settings window. Local info: Web URL: http://www.localhost/dwwdSite Enable cache: yes (checked) Thanks.
  3. Can you even read these screenshots ? How can i attach the others. they are about 35kb.
  4. The error is very common "Unable to Connect" I have been sorting out in my head why I should be using index.php rather than index.html. My pages are dynamic so I am using index.html. I modified my httpd.conf file because it only had index.html <IfModule dir_module> DirectoryIndex index.php index.html <IfModule> I am on a macbookpro 10.8.3 and this Document Root is standard. Document Root Library/WebServer/Documents so my path is: Library/WebServer/Documents/dwwdSite (dwwdSite = DreamWeaverWebDevelopmentSite) I set up the server settings as shown in the .pngs. Have to attach them separately. So many people know this stuff intuitively. Sorry that I am rusty. (not a novice). Can someone spot and Explain to me Why I am getting this error. I am really stuck. When I do this from within Netbeans /localhost/phpWithAlex/index.php I get output in the browser. It is not working with Dreamweaver. Thanks.
  5. You might want to know that I received this. 'Your message cannot be delivered to the following recipients: Recipient address: no-reply@phpfreaks.com Reason: Remote SMTP server has rejected address' It was a short email - unrelated to this post- and about a coincidence
  6. hi trq, Thanks for reminding me that my issue was not Mac specific. I like and almost prefer to work on the command line. But I was just so glad to get this running and did not want to take time to sort out the chmod settings like 777, 755 etc. I know that each position of those numbers is related to a different level of permissions. If you have a chance, can you please clarify things. I am still rusty using these unix commands. 1. I need to be in the exact directory to chmod 775 ? 2. Or how do I type the path and then chmod 755 from the top level. 3. And to do this should I be typing Macbookpro$ sudo nano directory name chmod 755. 4. Can you please explain this.... The strategy and best practice. Thanks again.
  7. Thank you to those who responded. After a crazy amount of troubleshooting and getting hints and feedback from others, I was so darn determined to get on with my tutorials and I found the solution myself. Keyword search: php and 'Mac computer' and fopen and chmod. Using:php and Mac and fopen() didn't get me there. I hope this forum allow for URL insertion. Others do. http://forums.macrumors.com/showthread.php?t=427742 1. This is the solution that I used. It was all about PERMISSIONS and I used the Mac Finder. This is my DocumentRoot path: /Library/WebServer/Documents This is the path to the directory where I am saving all of my example programs from tutorials: /Library/WebServer/Documents/phpWithAlex This was how I went about troubleshooting this just to make certain that I was clear about at which level I needed to allow 'read and write' permissions. I should have started from php/WithAlex but I started on the top. From the Mac Finder I navigated to Library and changed permissions to 'read and write' at all 3 levels: System Wheel Everyone. From the Mac Finder I navigated to WebServer and changed permissions to 'read and write' at all 3 levels: System Wheel Everyone. From the Mac Finder I navigated to Documents and changed permissions to 'read and write' at all 3 levels: System Wheel Everyone. I kept running the code which uses the fopen() function each time to see if I was able to create a new file and that this file ACCEPTED DATA input from my form. The code which is in the previous post, DID INDEED CREATE the file when I used FOPEN() once I changed permissions to 'read and write' for all levels on phpWithAlex. 2. Then I worked for the bottom back up the tree and reset permissions to just 'read' etc. etc. I wanted to find out the least amount of permissions required to run the code. The only folder that requires permissions set to 'read and write' for all 3 levels: system, wheel, everyone Was phpWithAlex. 3. I like to work at the command line. You can use terminal on a Mac and set permissions using the chmod() function. Here is the link.... Which explains many things and also why you may or may not want certain permissions at different levels. http://stackoverflow.com/questions/3740152/how-to-set-chmod-for-a-folder-and-all-of-its-subfolders-and-files-in-linux-ubunt 4. If you read the last post, you will notice that I also modified my phi.ini and I ; un-commented a line to find out if this allowed fopen() to work. It did not. Then i set the ;comment =On rather than = Off etc. etc. it still did not allow fopen to work. I am on a tablet or I would just copy paste those lines of code here. If I leave this page and go to another and come back, this entire post disappears. I learned that the hard way and had to start the post all over again. I actually was curious so I put the ;comment back and it did not reintroduce the obstacle that I started with, that fopen() would NOT create the file. 5. I am posting this exact post on 5 other forums that I am now frequenting because it was very time consuming to find this resolution. Although, this exact problem was not resolved from these forums, I LEARNED A TON FROM VERY HELPFUL PEOPLE WHO ARE JUST DONATING THERE TIME. IS THIS WHAT KEEPING THE INTERNET FREE IS ALL ABOUT ? Sure it is. Thank ALL of you. NOTE: I navigated away from this post to copy the URL and I lost my entire post and had to start over. Also, it is not easy to find my own posts once I logon- if they do NOT have new comments. It is really helpful to have a PREVIEW option.
  8. If there is a limit to the number of characters in a PM, I wish that would be apparent to the user. My message was truncated and I am unable to repost for 24 hours.
×
×
  • 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.