Jump to content

todd3834

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

todd3834's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes, I would use an include file like [b]WhyWindows[/b] said and create an array that contains all of your queries in that file. Just be sure to have .php on the end like he said too...
  2. [!--quoteo(post=372393:date=May 8 2006, 01:07 PM:name=mistakes!)--][div class=\'quotetop\']QUOTE(mistakes! @ May 8 2006, 01:07 PM) [snapback]372393[/snapback][/div][div class=\'quotemain\'][!--quotec--] yeah thats what i mean i have used an alert box in java scripting i just wanted to find out the advantages of doing this instead of just echoing the msg with php. thanks alot [/quote] That all depends on preference. Depending on the design of your website, sometimes it may look/function nicer to have a javascript alert that gives the error message, sometimes it is better to use PHP. The advantage to using javascript to show errors is that you can create a function to validate your form with javascript and it can let the user know about any errors before they even submit the form. This could save time and save them from having to re-type anything. An advantage to using PHP would be you could create a custom msg box that simply shows up on the page where you want it and looks the way you want it. Ideally you will want to look into using AJAX for validating your forms in the future...
  3. Ok, well to narrow down the problem. Test your upload script, after you upload a file use a ftp client to browse to the file that should have been uploaded. If it is there, download it via FTP and see if it generates and error when you try to open it. If it is not there, then your upload script is obviously not transfering the file. If it is there and it doesn't open fine, then we are going to have to look a little closer at your upload script because obviously something is going wrong. If it [i]is[/i] there and you [i]can[/i] download it and it [i]does[/i] open just fine, its of course an error in the display script, most likely the extention. Please check this out first, if there is an error with the upload script I will look a little closer at it in a couple hours... I am in class right now so I am kind of limited to what I can do to help. If you have not changed the file permisions of the folder yet, that is also something that will probably cause you trouble with your upload script. In your FTP client try browsing to the folder you are uploading the images, select it and see if your FTP client has the feature to change permisions. In dreamweaver you can right click a folder and change the permisions through the FTP client. If your FTP client doesn't offer that feature, then if you have a control panel that you can log into, there may be a file manager utility in there. Most likely you will be able to browse to the folder and change the permisions from there as well.
  4. [!--quoteo(post=371058:date=May 3 2006, 01:40 PM:name=kaspm)--][div class=\'quotetop\']QUOTE(kaspm @ May 3 2006, 01:40 PM) [snapback]371058[/snapback][/div][div class=\'quotemain\'][!--quotec--] Hi, I have a multipage form I want to send to an email address. Do I have to use: mail($whatever && $next for all the fields or would there be an eaiser way to do it. Thanks [/quote] It really depends on how you want to format your message, here is an example of a way to send the mail: [code] //this will show whatever is entered in the fullname input on your form //<input type="text" name="fullname"> $mail_body = "Name: " . $_REQUEST['fullname'] . "\n"; // "\n" sends it to the next line $mail_body .= "Email: " . $_REQUEST['email'] . "\n"; $mail_body .= "Message: " . $_REQUEST['message']; // ".=" is used for adding to the end of the string that already exists mail("youremail@whatever.com", "Your Subject", $mail_body); [/code] If you would like to use HTML in your message or you would like to modify the e-mail headers so that you can use CC, BCC, or other features. For more information about using the mail function and some better examples than the one i wrote above go straight to the comments on the online documentation. [a href=\"http://www.php.net/function.mail\" target=\"_blank\"]http://www.php.net/function.mail[/a]
  5. [!--quoteo(post=371053:date=May 3 2006, 01:33 PM:name=Richard181)--][div class=\'quotetop\']QUOTE(Richard181 @ May 3 2006, 01:33 PM) [snapback]371053[/snapback][/div][div class=\'quotemain\'][!--quotec--] this is the view file code [code]<?php include 'config/db.php'; $q = 'SELECT name FROM upload2'; $getpic=mysql_query($q); while($row=mysql_fetch_array($getpic)) { echo'<img src="xml/'.$row[name].'">'; } ?>[/code] [/quote] Exactly! :) It is trying to view a folder that does not exist on the server. "xml/filename". The problem is you are not including the file extention. You must enter some code to determin the file type and supply the correct extention (ie: .jpg or .gif). With the file extention it will no longer send them to browse a directory that does not exist
  6. [!--quoteo(post=371044:date=May 3 2006, 01:11 PM:name=domic)--][div class=\'quotetop\']QUOTE(domic @ May 3 2006, 01:11 PM) [snapback]371044[/snapback][/div][div class=\'quotemain\'][!--quotec--] how to put this correctly? [/quote] $query="SELECT * FROM table WHERE date=NOW();"; As long as your dates use the format 00-00-00 00:00:00 then you use the NOW() function in MySQL instead of [b]TODAY[/b] use [b]NOW()[/b] The two functions that may be helpful to anyone reading this would be NOW() and CURDATE() [b]NOW()[/b] will return the date/time in the format "00-00-00 00:00:00" [b]CURDATE()[/b] will return the date in the format "0000-00-00"
  7. [!--quoteo(post=371047:date=May 3 2006, 01:20 PM:name=Richard181)--][div class=\'quotetop\']QUOTE(Richard181 @ May 3 2006, 01:20 PM) [snapback]371047[/snapback][/div][div class=\'quotemain\'][!--quotec--] picture comes out as a FORBIDDEN view file.. [/quote] the forbidden error usually comes up when you are trying to view a directory with no index file. ie: "www.mywebsite.com/blah" but the folder blah has no index file and folder browsing is not allowed. In order to help you, we are going to need to see the code you are using to display the image as well...
  8. You may also want to try out SPAW, much like FCKeditor although FCKeditor looks like it has more features so SPAW might not be a better option but just another script you may want to check out before you make the decision... [a href=\"http://sourceforge.net/projects/spaw/\" target=\"_blank\"]http://sourceforge.net/projects/spaw/[/a]
×
×
  • 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.