Jump to content

Sam Granger

Members
  • Posts

    46
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Sam Granger's Achievements

Member

Member (2/5)

0

Reputation

  1. you have the following code: if (isset($_POST['submit']) && $error_stat == 0) { mysql_query("INSERT INTO walker (MemberRef, WalkNo, DateJoined) VALUES ('$MemberRef', '$WalkNo',NOW())"); } echo "<h4>You has been successfully added to the walk program</h4>"; Try replacing it with: if (isset($_POST['submit']) && $error_stat == 0) { mysql_query("INSERT INTO walker (MemberRef, WalkNo, DateJoined) VALUES ('$MemberRef', '$WalkNo',NOW())"); echo "<h4>You has been successfully added to the walk program</h4>"; }
  2. First of all, thanks for having a look here! I appreciate it. <?php foreach(scandir($scandirectory) as $dirName) { echo ' <li><a href="' . $location . 'browse:' . $dirName . '/">' . $dirName . '</a></li>' . PHP_EOL; } ?> I have managed to create the code above. This outputs all directories and files in a certain directory. I want to make 2 foreach statements. One for directories only and one for files only. How would I go around doing this? Would I be better off using glob? What are the differences? Looking forward to your replies! Thanks, Sam
  3. Awesome that works! How would I go about echoing the tag contents one by one in a loop/while statement?
  4. SQL Injection occurs when you have a variable in your sql query that a user can modify. Before putting user entered info or info you can edit in the url ($_POST, $_GET etc...) save it as a variable and use mysql_real_escape_string to make it sql safe. eg: $username = mysql_real_escape_string($_POST["username"]); Example of sql injection. // user input that uses SQL Injection $name_bad = $_POST["username"]; // they enter 'OR 1=1 //inturn the SQL query below will look like the following $query_bad = "SELECT * FROM members WHERE username = ''OR 1=1";
  5. Ok, all looks good so far! What you first need to do, is make sure that the users image gets uploaded to your server. From there on you can send it as an attachment. First modification to your code is that you need to copy the image to your server. This should replace your $file = $_REQUEST['Image'] ; copy ($_FILES['Image']['tmp_name'], "files/".$_FILES['Image']['name']) or die ("Could not copy"); Make sure you have a folder called files in the same directory your contact form is in. From there, we need to include this uploaded image in your email. I will include this in my next reply unless someone answers sooner. Check this by the way - the code I gave you is very simple and doesnt check if the file uploaded is actually an image. You should add this checker since its a security risk not to: http://www.phpfreaks.com/tutorials/36/0.php
  6. You dont have any spaces in front or after your php tags?
  7. Strange, I'm trying to duplicate your problem but I don't get any errors, I get redirected to paypal instantly.
  8. Have you tried removing all header's and placing one at bottom of page on its own with the ammount variable in it?
  9. Just to make it clear, I don't need to input the images inbetween the text, I will strip the text for the tags+filenames, output that and then will output all images at end.
  10. I don't believe thats a problem . Try visiting your config file. It will display as plain html - unless its a txt file or whatever, but I assume you have variables in php. I believe the other server would include a blank html file which won't get the person anywhere. And like the poster above said, chmod the file to read only
  11. Hey! I have a pdf class, and I can use it to output images. I want to get info from the database. The content could look like this for example: Anyway, you get the point . How do I get the contents out of the tag and put them into images? I think array? or? I need to use a seperate code for text and images to generate the pdf. For text: $pdf->ezText("$title", 22); And for images: $pdf->ezImage('http://www.domain.com/logo.jpg', '0', '150', 'none', 'left'); for each image. Help! Do I use preg_match?
  12. Awesome, thanks! Solved. Will rename query to result as recommended! Ps. Thanks for all the great help guys!!
×
×
  • 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.