Jump to content

StathisG

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by StathisG

  1. You're welcome!
  2. The get_currentuserinfo function that you're using, places all the information in a global variable called $current_user. This is how you can retrieve the first name: $current_user->user_firstname If you read further down in the function's documentation, there is an example that you can use if you want to use different global values. The example is the following: <?php global $display_name , $user_email; get_currentuserinfo(); echo $display_name . "'s email address is: " . $user_email; ?> So, since you want the first name, I assume that you can get it if you replace "$user_identity" with "$user_firstname" in your code. I have not tested it, but it makes sense from what I've read in the documentation.
  3. Open the 2 links I gave you before and read them.
  4. They use Typekit A free alternative is Cufon. You'll just have to buy the font (if it's commercial).
  5. function timechange($sqltime) { if ($sqltime == '0000-00-00') { return 'whatever'; } else { return date ("d-m-Y", strtotime ($sqltime)); } }
  6. Um, Yes you can. AddType application/x-httpd-php .js Can you provide a link with some info on that because after I googled it I couldn't find anything useful? Thanks in advance.
  7. You cannot use php code in JavaScript. However, you can make a request to a php file using AJAX, get the response and use the data however you want.
  8. If you don't have to use Ajax, you'll have to reload the page and submit the value of the checkbox to it.
  9. You can e-mail the same e-mail to multiple users by calling the mail function once and add all the e-mails as bcc (Blind Carbon Copy).
  10. You can add a call to a JavaScript function using onclick="nameOfFunction()" within your checkbox (like you already do in a way). In that function you can make a request using Ajax to another php file and update the database there.
  11. If you try the following, you're not getting the name of the image? $image = basename($_FILES['image_file']['name']); Since you admit that you are not "the most proficient guy here" you should start reading and try to understand what you are doing and not just copying and pasting code without understanding why you are using it..
  12. The purpose is to think a little bit and alter the examples given to your code. Not copy-paste everything. Anyway, from a quick look I see that you're not passing the product_id. Inside your form you need to include the product_id. An example: echo '<input type="hidden" value="'.$row['product_id'].'" name="product_id" />; Then, you have to grab this value (you are using post and not get as I can see so you should pay attention to what you are copying..): if(isset($_POST['submit'])) { $productId = mysql_real_escape_string ($_POST['product_id']); } If you try a little bit you're going to figure it out
  13. Read this Example: mysql_connect('localhost','root','password'); mysql_select_db('bookstore'); Also you need to handle errors.
  14. I don't understand what do you want to print exactly. Also, post your code.
  15. You already have it in your script: $imagename = basename($_FILES['image_file']['name']);
  16. Somehow, you'll need to send the product_id to the page that will update the table. Let's assume that you'll send it using GET: $productId = mysql_real_escape_string ($_GET['product_id']); $newUserName = $_SESSION['uid']; $query = "UPDATE table_name SET user_name='$newUserName' WHERE product_id=$productId"; Also, you'll get more specific answers in the future if you include some of your code.
  17. Very strange.. I asked about the browsers because I encountered a similar error once and it had something to do with a firefox add-on. In your case it seems that it's a wamp's problem. Maybe something with a .htaccess file? I cannot think of anything else. Sorry. Also try restarting everything (in case you didn't do it already).
  18. If the header.php file is part of every page in your system then there is the place you should have the session_start() and the sessions should work. Are you sure you have a problem with the sessions and not a problem with your program's logic? Try to set a sample session variable to one page and echo it to another one to see if the sessions are working fine.
  19. for ($i=1; $i<5; $i++) { echo '<span>'.$i.'</span>; }
  20. It's not optional, it's necessary to place it in the start of every page (before any characters of any kind are sent to the browser like PFMaBiSmAd mentioned).
  21. This happens in every browser?
  22. Just a quick example I can think of now: $array1 = array(1,2,3); $array2 = array(1,2); $array3 = array(1,2,3,4); $allArrays = array($array1 , $array2, $array3); $count = 0; for ($i=0; $i<sizeof($allArrays); $i++) { $result = count($allArrays[$i]); if ($result>$count) { $count = $result; $largerArray = $allArrays[$i]; } } print_r($largerArray);
  23. Ask your host (godaddy) as well. Although 'localhost' is the most common option for the server, some hosts use different settings.
×
×
  • 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.