Jump to content

denno020

Members
  • Posts

    761
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by denno020

  1. I've done this a couple of times with websites that I've built. The way I did it is in my database, I had flags which were set if a menu item was a top level link. Then for each of the sub-menu links, I had a field that said which of the top level links was its parent. That way I could match both the current link, and the parent link, from one field in the database, hence being able to highlight both the submenu link and the top level link. I'm not sure how your data is stored, but you could try adapting that idea to your application. Denno
  2. When you're checking the value of $curr_type, you're actually assigning a new value. You need to put double equals. function save_details($uid, $amount, $curr_type) { beginlog(); syslog(LOG_NOTICE, "Withdrawing $amount $curr_type:"); if ($curr_type == 'BTC') { bitcoin_withdraw($uid, $amount, $curr_type); return true; } elseif ($curr_type == 'LTC') { litecoin_withdraw($uid, $amount, $curr_type); return true; } elseif ($curr_type == 'RUC') { rucoin_withdraw($uid, $amount, $curr_type); return true; } else { throw Error('Invalid currency', 'You cannot withdraw a currency that does not exist.'); } # should never happen! return false; } You could also use triple equals to make sure it's exactly the same
  3. For a great tutorial series on using php to resize images, check out a YouTube user (click the name for a link to the first video in a series of videos that cover image processing). If you're unable to learn it from the way he teaches, then basically you're not going to be able to learn it. To check the server time, you can use the php function date() (http://php.net/manua...nction.date.php). Giving it a string representing how you want the date to be formatted, as you'll see in the documentation. You can then check that each time your page loads, and then load up the image you want depending on the date/time. That should be able to get your started Denno
  4. Pretty sure you also need to make sure that session_start(); is the absolute first line in your php script. Plus, you've typed it wrong in your reply.. so maybe you did in your script too?
  5. Add this into your script //Outside of for loop $today = date("d"); //Today's date (number e.e. 17) $month = date("F"); //This month (full name e.g. February) $year = date("Y"); //This year (4 digits, e.g. 2013) //Inside for loop else if(($i-$startday+1) == $today && $thismonth['month'] == $month && $thismonth['year'] == $year) echo "<td align='center' class='today' valign='middle' height='20px'>". ($i - $startday + 1) . "</td>"; That will add a CSS class to the day that matches today. So in your style sheet, define a background colour for the class '.today'
  6. I'm pretty sure the only other way you could do it is to use POST.. But that's a little more difficult to actually make happen because POST generally only works when a form is submitted. You could probably create a POST using javascript, but it's much easier to do as you're done and just pass the id through the address bar and retrieve using the GET method.
  7. It looks like the ID that's being passed through the address bar (through the GET method) isn't working, or has been set as something else.. the link to use this script should be as follows: <a href="delete_record.php?id=1">Delete Record</a> That will pass the variable through to the script correctly, as I believe that's where you're having problems..
  8. I would suggest to check that your floats are cleared. Also if you want your container to be a specific height but the content within it can be longer, then you'd need to set overflow correctly to allow the content to be scrolled in the container. Denno
  9. You can count the number of results with mysql_num_rows(). However that's deprecated now so I'm not sure what the alternative is.. Anyway, that will count the results, and if there are none, it will return false, which you can use in an if statement, before your while loop. Denno
  10. If I were trying to create something like this, I would create a database table that would contain all of the pages of every user. There would be a field for ID, user (who created the page), page title, page content, parent page, sibling pages, child pages, is_start and is_end (enums to represent if a start/end page). As you will have a maximum number of child and sibling pages, you could have 4 child page entries, and 3 sibling page entries. Or you could just have one field and them put the ID's of parents/siblings in as comma separated or pipe separated values (which you will process in PHP later). So the rough mysql to create this table would look like this: create table pages( id, user, page_title, page_content, parent_page, sibling_page_1, sibling_page_2, sibling_page_3, child_page_1, child_page_2, child_page_3, child_page_4, is_start, is_end ) Obviously you'll need the data types etc, of which you'll be able to figure out. Using a structure like that, you can query the database with the users name, and searching for is_start (which is the first page in the story). From there, you can grab the child pages of the start page, and then use arrays and loops to loop through the hierarchy of each story option until is_end is found.. I'm not sure if I've quite grasped your problem, nor whether my suggestions will actually help, but thought I would give you something so you can better explain the problem you are having . Denno
  11. denno020

    Paypal API

    I wasn't aware of this. However I guess eBay do it don't they..
  12. denno020

    Paypal API

    You're going to need to look at PayPal IPN. But there is absolutely no way you'll be able to set up something that would automatically take money from someone's account. They will have to authorize it, so you'd need to send them an email or whatever letting them know that it's time to pay, then provide them a link to your website, in which they could initiate the PayPal IPN, log in and make the payment of whatever amount you've set as the amount they owe you. Denno
  13. If that's the only content that you want scrolling, then you could just give everything else a CSS position of fixed, so that it will stay put in the window, whilst everything that isn't fixed (the content) scrolls. Denno
  14. So what you want to do is separate your if conditions if(isset($_POST['id']) && $_POST['id'] == "admin"){} Denno
  15. I've not had any experience with this before, but one thing that I would have tried is to use another countdown that would represent the delay until the time that the real countdown happens. So for onComplete of the first countdown (acting as a timer), start the second countdown.. Denno
  16. Not sure if it's just typo when wriging it here, but your html should look like this: <body> <div id = "table"> </div> </body> Notice the quotes around the id and the ending '>' after the closing div and closing body tags That's something I noticed right away so maybe that's causing drama's. Denno
  17. You can do it by calling a javascript function using the onsubmit event in the form tag. The function then adds a class to the button which hides it (display:none;). Very much like this: HTML <form action="#" method ="POST" onsubmit="return hideButton()"> <!-- other form stuff--> <input type="submit" name="sumit" id="submit" value="submit"/> </form> Javascript function hideButton(){ document.getElementById("submit").className="hide"; return false; } CSS .hide{ display:none; } I've got the return false in the javascript function because I didn't want my browser to be trying to submit a page when I was testing. This will need to return true, otherwise the form will never submit . Hope that helps. Denno
  18. #PageContent will also need to be given a float:left. When using float, you're taking an element out of the 'flow' of the page. So what you say with it seeming like the PageContent is using the left of the page and not the div, that's exactly what's happening . So give #PageContent a float:left also, and make sure you clear the floats straight after the #PageContent div so as to not mess up your footer or anything you have below it. Denno
  19. I think this is what kicken suggested with the multi-row insert query: if you concatenate each new IMPORT to the end of the old one, in a big string with the appropriate seperators, then pass that to the mysql_query function. Could limit it to say 50 imports at a time or 100.. So have a counter that keeps track of how many IMPORTS you've added, then fire off the mysql_query function which the counter reaches 50, reset the string to nothing, and loop again. $importString = ''; //empty string $count = 0; while(($data = fgetcsv($handle, 1000000, ";")) !== FALSE){ $importString .= "IMPORT etc"; $importString .= ","; //comma to separate between IMPORT lines $count++; if($count == 50){ mysql_query($importString, $databaseConnection) or die(); $importString = ''; //empty string again $count = 0; //reset counter } } I probably have the separator wrong, I always seem to mess that kinda thing up, but you get the general idea of what I thought you could do, and also what I think kicken is getting at, hopefully.. Hope that helps Denno
  20. You would have to use AJAX. So with your onclick, call a method that fires off an AJAX request, running the PHP script on the server that would initiate a session variable. Denno
  21. Cool thanks mate, I'll look into that. Denno
  22. Must admit, responses like that make me want to leave this forum. I already said that my logic was flawed in the case of the file copy failing.
  23. PayPal IPN, that is what you want. I'll be honest, it can be quite painful to set up. I never had a tutorial when I did it myself, but I've since seen this which seems like something that would be able to help you, the guy creating the video is very good at tutorials. Good luck! You're going to need it lol. Denno
  24. Have you tried putting just the email after From: in your 4th parameter to the mail function? It looks like you're trying to achieve something like this: From: Joe < joe@email.com Maybe, yahoo doesn't like that? I would remove $name and and "<" sign, leave just email after From:, and see what happens.
  25. I reckon that boston_smiley.jpg is still on the end of $target_path. Just echo $target_path, so you can see what it actually is. Denno
×
×
  • 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.