premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
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.
-
<?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.
-
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.
-
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.
-
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.
-
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.
-
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!
-
http://www.mamp.info/ Much easier than trying to install PHP/Apache on your own for development/testing reasons =)
-
[SOLVED] Displaying a PHP code on a browser.
premiso replied to paragkalra's topic in PHP Coding Help
Rename the file to .phps If your apache/php.ini are setup right that will show the syntax with highlights. -
Varcha to varchar
-
<?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.
-
Show some code and we will be more apt to help you.
-
str_replace Should do the trick.
-
lol, well at least this is the php section and not javascript or else I might be embarrassed.
-
[SOLVED] i keep getting redirected to another post
premiso replied to contra10's topic in PHP Coding Help
Are you still getting the same error? Or is this resolved? -
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.
-
[SOLVED] i keep getting redirected to another post
premiso replied to contra10's topic in PHP Coding Help
Well you are doing mysql_connect twice. I would remove the second one as that is not needed once a connection is established. -
[SOLVED] i keep getting redirected to another post
premiso replied to contra10's topic in PHP Coding Help
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. -
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.
-
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.
-
[SOLVED] displaying text problem unwanted break
premiso replied to shadiadiph's topic in PHP Coding Help
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. -
[SOLVED] displaying text problem unwanted break
premiso replied to shadiadiph's topic in PHP Coding Help
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. -
[SOLVED] Selecting a needle out of a haystack
premiso replied to pianoman993's topic in PHP Coding Help
explode $users = explode("/", $_GET['users']); $users = $users[1]; Should get you the result. -
<?php $foo = "lol"; require_once '2.php'; //prints "lol" ?> That is how you should do it.
-
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.