Jump to content

roopurt18

Staff Alumni
  • Posts

    3,746
  • Joined

  • Last visited

    Never

Everything posted by roopurt18

  1. What if they buy two products?
  2. You need to purchase a domain and space with a hosting company. Then you just upload them via FTP or SFTP.
  3. I see that I made a typo and spelled activities wrong here: //$acitivities[ $k ] = mysql_real_escape_string( $v ); // TODO Uncomment this line
  4. header("Location: http://www.icameradb.com"); exit();
  5. <?php $_POST['activities'] = 'foo,bar, ,world'; // TODO Remove this line $user_id = 1; // Assume you have this elsewhere in your code or can set it here $activities = array_key_exists( 'activities', $_POST ) ? explode( ',', $_POST['activities'] ) : false; if( $activities ) { foreach( $activities as $k => $v ) { // We want to clean up each activity $v = trim( $v ); if( ! strlen( $v ) ) { // Remove empty activities unset( $activities[ $k ] ); }else{ //$acitivities[ $k ] = mysql_real_escape_string( $v ); // TODO Uncomment this line } } // $activities array is now clean and void of empty values, but if the array // itself is empty we do nothing if( count( $activities ) > 0 ) { $sql = "insert into `my_table` ( `user_id`, `activity` ) values" . PHP_EOL; $sql .= "( {$user_id}, '" . implode( "' )" . PHP_EOL . "( {$user_id}, '", $activities ) . "' )" . PHP_EOL; echo $sql; // TODO Execute query instead of echo }else{ echo 'Nothing to insert.'; // TODO Print better message? } }else{ echo 'Activities not in POST.'; // TODO Print better message? } ?>
  6. Estimate how many hours you expect the project to take. Multiply by 3. Multiply by the amount you want to make per hour. That's your project estimate. Make sure it's understood that your estimate is for what's in the spec. If, after you deliver, they want to make modifications, then they need to create a new spec and you start all over.
  7. Funny how utensils from the Middle East resemble Japanese sex toys.
  8. You might have to install pecl_http in order for HttpRequest to be available.
  9. http://php.he.net/manual/en/class.httprequest.php
  10. It doesn't really matter. Whichever of the two you choose you won't be able to remember what you did 6 months from now when you need to maintain it and as you customize and add they'll both become just as unreadable. If you're using a debugger it shouldn't matter where the functions are located when you want to step through the program logic anyways.
  11. Since your error included an exception message, you must be on PHP5. Therefore you can use exceptions to determine if the method exists or not. <?php try { $exists = true; $c->call('doesThisMethodExist', array('symbol' => 'ABC')); } catch( Exception $ex ) { $exists = strpos( $ex->getMessage(), 'Function ("doesThisMethodExist") is not a valid method for this service' ) === false; } ?> I whipped that up on the fly so while the concept should be sound, the code may not be right. That method is a little out of the way; this might be easier: http://www.php.net/manual/en/soapclient.getfunctions.php Or poke around in the SOAP documentation: http://www.php.net/manual/en/book.soap.php
  12. Proper indenting will help you with these problems. Here is your code, poorly indented: <?php if ($ad_two == $case1 || $ad_two == $case2) { echo $ad_one; } else { if ($random>= $ratio) { echo $ad_one; } else { echo $ad_two; } ?> Here is your code, indented in some manner: <?php if ($ad_two == $case1 || $ad_two == $case2) { echo $ad_one; } else { if ($random>= $ratio) { echo $ad_one; } else { echo $ad_two; } // <- With proper indenting, we see clearly that you're missing a closing bracket ?> Fixed. <?php if ($ad_two == $case1 || $ad_two == $case2) { echo $ad_one; } else { if ($random>= $ratio) { echo $ad_one; } else { echo $ad_two; } } ?> You should invest in an IDE that highlights matching brackets.
  13. Why do you have the @ character in your if-statements? That operator is used when you want to suppress errors from calling a function, which you are not doing where you are using it. Also, stop using $_REQUEST. Use $_POST or $_GET depending on where your input is coming from.
  14. You only have two for loops in that entire code, one inside the other, and both use the variable $i. Essentially this is what you've done: <?php for( $i = 0; $i < 5; $i += 1 ) { echo "before inner, i is {$i}" . PHP_EOL; for( $i = 0; $i < 10; $i += 1 ) { echo "inner loop, i is {$i}" . PHP_EOL; } echo "after inner, i is {$i}" . PHP_EOL; } ?> Run that program and see if it doesn't make more sense as to why the outer loop isn't looping.
  15. An array would probably work better, but you can do: ${$puppy . $iplace} ="$place"."$puppy$i";
  16. "date_format(BirthDate,"%m/%d/%Y")" ^- start string ^- end string ^- start string ^- end string What you have is a MySQL string enclosed in a PHP string. When you start doing these types of things you have to be careful of how you nest strings. Either of these might work: "date_format(BirthDate,\"%m/%d/%Y\")" 'date_format(BirthDate,"%m/%d/%Y")' Taking it further, your original code is exactly the same, syntactically, as if you had typed: "string1" %m/%d/%Y "string2" Which is not valid PHP code.
  17. You're using relative paths which means "language/english.php" probably does not exist from the point you're asking for it.
  18. $query is local to the function and thus not visible outside of it. Change: property_query($mls); echo $query; To: echo property_query( $mls ); And if you're going to use global variables you might as well not use functions.
  19. roopurt18

    Invoices

    That's the correct way to do it, yes.
  20. You may need to set RewriteLogLevel too. Or your host may be forbidding it.
  21. I'm not really sure why the forum.MYSITE.net redirect wouldn't be working. My RewriteCond lines essentially say if the host is "MYSITE.net" or "forum.MYSITE.net" then redirect to "_forum" You might try some logging. http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritelog
  22. Sounds to me like you're doing something wrong. How about showing us the offending code?
  23. Unless they advertised that they were experts at database conversion or specifically outline what they would convert from and convert to, I wouldn't expect any web hosting company to perform database conversions. I've performed a number of data migrations in my life time and I'll tell you right now it's not an easy task.
×
×
  • 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.