Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Bumping already! Do some debugging.. narrow down the point of error!
  2. Not quite if($_POST['ref'] >= 1) should be if($_POST['refid'] >= 1)
  3. Only simple when you know the answer If this is solved please click solved bottom left, it saves the time for people who help and welcome to PHP Freaks EDIT: Oh you did solved it
  4. okay if i do this echo "Hello World"; PHP echos the string between the quotes, BUT echo "Hello "world""; doesn't make sense! so i need to tell PHP that some of the quotes i wish to echo, to do this i "escape them" with the slash echo "Hello \"world\""; you could also use single quotes ie echo 'Hello "world" ';
  5. Okay, change it to a POST and add the input to the form (could be hidden) ie <INPUT type="hidden" value="<?php $_GET['ref']?>"> OR leave as GET <form method="POST" action="register.php?ref=<?php $_GET['ref']?>"> (personally i'll use the hidden field) other options are sessions, cookies
  6. It only loops once because during the first loop you redirect to another page header("Location: list.php");
  7. you need to escape the quotes ie print "<select name="jobs">\n"; should be print "<select name=\"jobs\">\n";
  8. As i said, for that form to process you need to POST the form BUT the form is NOT passing the get <form method="POST" action="register.php"> for example try <form method="POST" action="register.php?ref=10">
  9. you have the same key twice 'pub' => 'application/x-mspublisher', 'pub' => 'application/vnd.mspublisher' So only the second one applies
  10. I don't think you did, but the code is correct, so your doing something wrong or if everything else is correct then i guess reinstall PHP and apache!
  11. 1. are you posting to this image 2. remove the line echo "Req. Level 10 Eliminate Pro Special. Arsenal Megacorp issue sidearm level 1. +20 Attack, +30 Max HP, +3 Max Energy "; 3. php?>
  12. And what exactly are you stuck on ? this look more like a job brief and feel i should more it to the freelance section!
  13. You didn't pass anything in the URL.. add ?ref=10 to it!
  14. try this <?php //START DEBUG DATA $_POST['qty'] = array(1,2,"a",-1,3); $_POST['selectionsid'] = array("A","B","C","D","E"); //END DEBUG DATA $select = $_POST['selectionsid']; //Loop though and validate (as all will be numbers just need to check for the range) foreach($qtyArray as $K => $qty){ $qty = (int)$qty; //convert to int if($qty >= 1 && $qty <= 999){ $query = "update selections set qty='$qty' where selectionsid='$select[$K]'"; echo "$query\n"; //DEBUG output #$result = mysql_query($query) or die("Query failed : " . mysql_error()); } } EDIT: updated (was being dumb, no need to create function)
  15. okay lets go back to basics what do you get from this ? if ($_GET['ref'] >= 1){ $insert['ref'] = $_GET['ref']; } echo $insert['ref']; print_r($_GET); better still try this if (!empty($_GET['ref']) && $_GET['ref'] >= 1){ $insert['ref'] = $_GET['ref']; } echo $insert['ref']; print_r($_GET);
  16. ?ref=10 if ($_GET['ref'] >= 1){ $insert['ref'] = $_GET['ref']; } echo $insert['ref']; should result in
  17. Personally.. I go for Type first, if type fails use ext,
  18. Their are a few ways to do this, and I had the same problem a while ago, (Skip to the last few lines if you wish,) Now you can do some memory hacks to increase the memory limit and while this does work on some host, you may end up causing another problem, called resource limit, this is when the shared host will notice the extra resource and may even suspend your site causing the whole site to be down for a few hours or a day or worse remove your site for breaking the terms of agreement, So how can we resolve this? Well the problem I had was member were attempting to upload quite large images and this cause timeout and memory limit problems, and even when i got around all of that they complained about it taking ages to upload the images (that was due to their upload speed), so I looked at the problem as a whole, and the solution is very simple, resize the images before uploading.. okay that doesn't help the poor souls who have no idea how to do that, but the solution is the same.. i need the clients to resize the images or put another way.. i need the resizing to be done on the clients PC, So the real question is HOW ? I played around with a few client sided options, Silverlight, Java & Flash, I wrote some basic up-loaders for each and they all solved the problem, however Silverlight crashed a failed more times than i would care to support (could of been my code) Java worked great but not everyone has this pre-installed, but lots of people have Flash installed and it can look quite good.. So try swfupload here is a link the a demo doing the pre-resize Hope that helps
  19. you need to escape the quotes ie \" echo "<TR><TD><a href=\"{$_SERVER['PHP_SELF']}\"?action=show&id=\"{$row['dream_id']}\">'Comments'\"($comment_row[0])\"</TD></TR>";
  20. Thats not a valid RegEx Pattern, maybe try stripos instead
  21. I have no idea what that means! they are using GData, just like Zend's Photo Album, they even have an example of how to upload them via PHP here using Zend Gdata Photos PhotoEntry and Zend Gdata Photos AlbumQuery. If the above doesn't help you then in answer I'll say probably not.
  22. Humm..maybe read the API !
  23. Well error reporting should only be on, on a development server, by hole, I mean mysql_real_escape_string should be used on the all strings before the going to MySQL, using it on only 1 of 2 strings won't protect you. ie, this statement uses mysql_real_escape_string but won't protect you from an injection mysql_query("UPDATE table set firstname='".mysql_real_escape_string($POST['f_name'])."', lastname='".$POST['f_name']."' "); take a look at Dan's PHP security Tutorial
  24. of course you can still be attacked.. however if mysql_real_escape_string is used correctly and you have left no holes, you should be safe!
  25. as a note you don't need to convert it to upper case if your using natcasesort
×
×
  • 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.