Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. Use the php CLI ? C:\path\to\php> php -f c:\path\to\phpfile.php Word of warning, you may need to modify the file to run under the CLI (IE if you use $_SERVER['HOST'] or DOCUMENT_ROOT), but most of the time it will work. Another option is to look for a lynx type browser or wget for windows.
  2. You pay for the reseller account, a set fee. You can charge your customers whatever you want, and you take what you charged the customer(s) minus what you paid and that's how much you make off of it.
  3. As long as it is not against the Hosts TOS, it should be fine. You are a paying customer and you can generally use it how you want as long as you obey the hosts TOS / AUP.
  4. If you post some of your code it may help. I have never really seen the "0" output, but the context can help. If all else fails, is there a problem just echoing a blank space? <?php echo ""; // or echo " "; ?> Or another option is just check for "0" in your ajax script and handle it properly.
  5. Thanks: print "<td><a href='downloadFile.php?file=". $_FILES['file']['name'] . "'><img src='http://www.mysite.com/Images/icn_file_download.png' width='50' height='50' title='Download this file!' /></a></td>"; Is what you should be using. When you are echoing a variable inside of PHP code, you need to concatenate variables onto it (like I just showed you). If you are working out side of PHP, then you would use the echo like you had: ?> <some html here> <td><?php echo $var; ?></td> <?php // more php code ?> Hopefully that makes sense to you.
  6. If the link is doing that, then it generally means that PHP Is not enabled on the server or you are echoing php code inside of an echo. Show us 5-10 lines around where this code is at so we can get the context better.
  7. Along with WebStyles (IE doing a simple email) I would check to see if the IP you are using to send email from is blacklisted. http://www.mxtoolbox.com/blacklists.aspx
  8. $SM = unserialize(urldecode($_GET['SM'])); You had that kind of backwards fix it like above and see what happens. If you do have magic_quotes on, then you will want to stripslashes prior to unserialize, not after.
  9. If you do not own the first IP Board's content, and you want to scrape it, look into scraping. I really discourage this, unless you write the owner of the board requesting permission to do so, as it is a copyright violation and just not right. If you own both boards, well just do a database export of the posts table and import it on your other server.
  10. If you are messing with csv files, why not use fgetcsv. This should make working with the file much easier and not have the need to using explode etc.
  11. Or die is not a valid way to throw errors or "do something else". Errors should be handled properly, whether it be checking if it failed in an if statement and then displaying a nice error message or throwing an exception or triggering an error. I would suggest reading or die must die for a bit more information on it.
  12. Posting your database credentials is probably not the best idea. If you can still edit it, I would. If you cannot, well you may want to change them on your server.
  13. No. It would just pass true/flase to the function since isset returns true / false depending on if the variable has been set. $industry = isset($_GET['industry'])?$_GET['industry']:null; $companies = fetch_companies($industry); Then just make sure to check for null in the fetch_companies and handle it accordingly.
  14. Without seeing any code, neither do we. I would start with the page where you can view right before the session dies and the page where it dies at. You can also check your session variables (post them here) in your php.ini so we can see how that is setup.
  15. There is no better way, which is why I suggested sessions. Because the HTTP_REFERER can be changed by the user or turned off by the user, hence it is unreliable as it is controlled by the user. Unless you control the server or both servers, you cannot actively get the referring page.
  16. If they are on the same server you will want to use sessions to pass variables around from page to page. a.php <?php session_start(); $_SESSION['var1'] = 'Test'; c.php <?php session_start(); echo isset($_SESSION['var1'])?$_SESSION['var1']:'Nothing was passed through session'; unset($_SESSION['var1']); // clears the variable.
  17. $list = explode(',', $vars); foreach ($list as $key => $host) { $list[$key] = getHost($host); } var_dump($list); Should do what you want.
  18. rtfm? http://www.roadsend.com/p/manual/viewManual.php?doc=Working-With-Web-Applications.html&prIDX=2&doc=Command-Line-Use.html#Command-Line-Use
  19. rtfm? http://www.roadsend.com/p/manual/viewManual.php?doc=Installing-FastCGI.html&prIDX=2&doc=Building-and-Using-Compiled-Web-Applications.html#Building-and-Using-Compiled-Web-Applications
  20. I am having a real problem with reading shit today: <?php session_start(); // default the variable to avoid a notice error: $_SESSION['views'] = !empty($_SESSION['views'])?$_SESSION['views']++:0; if ($_SESSION['views'] > 4) { header("location: /landingpage.php"); exit; } ?> That should do what you want...hopefully.
  21. <?php session_start(); // default the variable to avoid a notice error: $_SESSION['views'] = !empty($_SESSION['views'])?$_SESSION['views']:0; if ($_SESSION['views'] < 5) { $_SESSION['views'] += 1; header("location: /landingpage.php"); exit; } ?> Should do it.
  22. You never write the generated thumb image to disk.
  23. Try this: SetEnvIf Referer dev.bizlab.us internal # <Files "\.(swf|mp3)$"> order Deny,allow Deny from all allow from env=internal </Files>
  24. Well if it is getting urgent, you better up and confess that you have no clue how to do it, higher someone, or take some math courses. The function above is very generic and yea, does not account for much. But it should be a good starting point for most programmers to go off of. You are going to need some if statements in there checking the hour time, how long it spans, if it spams a holiday or a weekend, and be able to add it up from there. It is a really complex situation, don't kid your self and will take a bit of brain power. But you are not really showing us that you are doing trial and error and you seem to just want us to code it up for you, sorry, that is why this has had so low of posts. Yea. Best of luck with your urgent need.
  25. One query will always be preferable to multiple. But running the query inside the loop causes a ton of overhead, I would even just do this instead of that: while($row = mysql_fetch_assoc($query)){ $update .= "UPDATE products SET price='$_POST['price'][$i] WHERE product='$_POST['checkbox_value']';\n"; $i++; } mysql_query($update) or trigger_error('Update Failed: ' . mysql_error()); As that way, only 1 function call is used and reduces the overhead on the php end of things. But if the CASE works, that would probably be even better than the multiple queries and 1 mysql_query call above.
×
×
  • 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.