Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Are the pages being saved by dreamweaver to the www folder under mamp? If it is not in the www folder then it will not run, due to the fact that just installing PHP on your system does not make it work everywhere. Try saving it to that folder and see what happens.
  2. <?php $packages = array("ult"=>'',"sngl"=>'',"mnth"=>'',"ssn"=>'',"po"=>'',"spl"=>''); while ($a = mysql_fetch_assoc($q)) { $packages[$a['package']] = $a['picks']; echo '<pre>'; myPrintArray($packages); echo '</pre>'; function myPrintArray($array, $key=false) { if (is_array($array)) { if ($key) { print_r($array, true); }else { echo "Array (\n"; foreach ($array as $keys => $val) { echo $val ."\n"; } echo ")\n"; } } } ?> Not sure if PHP has a way to do it, but that should work.
  3. SELECT c.id ,(sum(cs.sale_count) - sum(cs.nosale_count)) as sum_sales FROM travel_companies c,travel_company_sales cs WHERE approved = 1 AND deleted = 0 AND c.id IN (3575,182,15,701,4550) AND (c.name LIKE '%sport%' OR c.code LIKE '%sport%') ORDER BY sum_sales asc LIMIT 0,5; Should produce the desired result, note the change of the column to sum_sales. Since you have a column called sales in another table, that is the best way to do it to make sure you know what you are calling.
  4. It would be a good idea, but chances are the latter will overwrite the earlier. But I would do it just so there is no mistake/errors after you install it.
  5. Session and or cookies would be your best bet IMO. Although these are bypassable not many people know how to bypass it. You can also do an IP deal. if the IP has hit more than 5 times in x minutes or x seconds then inform them of the infringement and that their stats are now under investigation and may be altered. Just remember that unique hits are not always accurate cause it is hard to know who is legit and who isn't.
  6. Yeah the all-in-one solutions are great, I use them whenever I have the chance. Getting Apache and PHP to work on a new test environment can be infuriating. I figured out how to set them both up back in the day because PHPTraid sucked. Then once this LAMP and WAMP came out it was always download/install from that package. Soo much less of a headache.
  7. lol obviously, a 12 yearold can do this in about 2 hours I bet....at least I could when I was 12. http://www.google.com/search?hl=en&q=php+login+scripts&btnG=Google+Search&aq=f&oq= Your initial step, follow a tutorial for creating a normal username/password script. Once they login display the domains that they can choose from. Then use that. Pretty simple imo. Good luck!
  8. http://www.mamp.info/ Much easier than trying to install PHP/Apache on your own for development/testing reasons =)
  9. Rename the file to .phps If your apache/php.ini are setup right that will show the syntax with highlights.
  10. Varcha to varchar
  11. <?php $month = date("m/d/Y", time()-(60*60*24*180)); $date = $row_news['news_date']; //date in database ?> Should produce 6 months ago from today. Note the 60 times 60 gets us minutes the 60*60*24 gets us 1 day. The 60*60*24*180 will give us 180 days ago.
  12. Show some code and we will be more apt to help you.
  13. str_replace Should do the trick.
  14. lol, well at least this is the php section and not javascript or else I might be embarrassed.
  15. Are you still getting the same error? Or is this resolved?
  16. Not a php issue. Look into the onChange event in HTML/Javascript. You will have to use an ajax call to make it purely dynamic. I would look into jQuery for the Ajax call. The other option is when onchange is activated (meaning they selected a city in the list) it automatically submits the form and re-generates the page. I think that is what you are after. onChange myfriend =) <FORM action="dropdown.php" name="dropdown" method="get"> <select name=myselect onChange="this.dropdown.submit()"> Should submit the form onchange.
  17. Well you are doing mysql_connect twice. I would remove the second one as that is not needed once a connection is established.
  18. It is running and yet you get that error? In my opinion, something is screwed up on your server. I would uninstall WAMP and reinstall it and see if that fixes it. Before you do that besure to backup the webserver files and the database.
  19. http://us2.php.net/manual/en/mysqli-result.fetch-assoc.php You need to put it in a while loop like seen at the example above to get all the rows back properly.
  20. I highly doubt this is possible but one possible solution is: $entryTitle = $_POST['entryTitle']; $message = ""; Make sure the message is defaulted to "". What may be happening, is possibly session or cookie or get or post is populating the message (if register_globals) is on. So it may not contain the error it just carried it over on accident. Without seeing the full code, that is my best guess.
  21. Wow, do not use nl2br to save buddy. You only use that to display data. If you use it to save you come across the problem that it is much harder to reverse that. Which is why you always save data in it's raw format. Not the displayed format. Fix that problem and you will not have this issue later on. Then use nl2br when you need it on displaying the data.
  22. Are you using nl2br anywhere? If you are remove that. As for converting it back...str_replace should do it. $string = "string with <br />"; $string = str_replace("<br />", "\n", $string); echo $string; Should get you what you want.
  23. explode $users = explode("/", $_GET['users']); $users = $users[1]; Should get you the result.
  24. <?php $foo = "lol"; require_once '2.php'; //prints "lol" ?> That is how you should do it.
  25. You need to post more code, but obviously the $inj_path. $file does not link to a file. Print it out and see what it contains and why it does not work. Without more code this would be impossible to debug.
×
×
  • 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.