Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. When you say "very complex and long php coding" - how long and complex are we talking?
  2. I would use a switch on the basename of the PHP_SELF server var: switch (basename($_SERVER['PHP_SELF'])) { case 'page1.php': $image = 'image1.png'; break; case 'page2.php': $image = 'image2.php'; break; // etc. } Ensure you include a "default:", or check the $image variable isset before trying to display the image. Edit You could use a method like AyKay47's suggestion - depends on your situation as to what would work best.
  3. As the error says, msg_data_array is undefined - where do you define it?
  4. Personally I would keep your old domains, but just alter the DNS record to have them point to the new server. That way Google / users won't see any change, but internally you'll be able to manage them on the same server.
  5. As said, you need to validate the data. If a user doesn't have permission to change pet x, then check within the handling PHP code if they can or not before changing it.
  6. 1) This is pretty standard. 2) Yup, cron jobs would be your best bet assuming you go for a Linux server (Windows has an equivalent). Not sure what automated material you could send recruiters, but candidates you could send them a weekly newsletter of jobs they've said they're interested in. I would say though, when I was last looking for a job, I registered on a few sites and they just spammed me with jobs located all over the country. 3) Quite a broad subject really. I would write down all the requirements of the data you would need, and go from there really. If you have a more specific question on this I would post it separately, as we can't list every table you would need at this stage. 4) Google Analytics is free and widely used, but there's some uncertainty in it's accuracy. If you just want a rough indication of traffic then it will do the job, but if you want 100% accurate you may be better using a tool like AWStats, which parses your server access logs for it's data. 5) The reporting logic would probably fall on yourself to implement, but the visual side of it there's plenty of free plug-ins you can use to generate graphs and charts and make it all look pretty. Then again that depends what you mean by reporting? 6) How long's a piece of string? You can make a search engine as basic or as complex as you like. You may get the project off the ground quicker just going with Google's site search, then implementing your own over time. Then again you might not be able to search a specific category for example. 7) Shared hosting would be fine at first (possibly depending on what server-side software you need), but if/as traffic increases you would need to move it to a dedicated server.
  7. You mean have a site ranking higher in the results than yours, removed? No - that's what SEO is for.
  8. Adam

    PHP & MSSQL

    Did you restart Apache after you removed the semi-colon?
  9. Well said!
  10. The SOAP extension provides a set of classes that make it easy to send SOAP requests, and then returns the response. In particular, take a look at SoapClient. There's a few examples posted by users that will probably help you. Try and read it to understand it, and not just cut and paste the code. Will be far more beneficial for you...
  11. Do you often browse Facebook without being logged in? I don't, I generally click logout and close the tab. I'm not exactly sure why this is so terrifying, you're tracked everywhere you go. Facebook tracking you on their own site certainly isn't the worst of it. P.S. if you really can't trust Facebook, perhaps you shouldn't upload virtually every bit of information about your life into it?
  12. Look into the "SOAP" extension - it makes handling requests easy. Using that and the XML tempalte soapUI will generate for you, it's just a case of putting it all together.
  13. soapUI has a feature built-in that will generate request XML templates for you.
  14. The data is in an array, so you would need to access them through the index: res.comments.data[0].id res.comments.data[1].id Or using the count property you have, you could loop through them: for (i = 0; i < res.comments.count; i++) { // res.comments.data[i].id }
  15. The database should automatically convert it, provided it's in a readable format. What's likely the problem is you don't have a space between the date and time. Should be: $datetime=$date . ' ' . $time; If that doesn't fix it, please post a var_dump() of the $datetime variable.
  16. It's quite possible there's an error with the query, but you're just not checking for it. Try this: mysql_query($query) or trigger_error('MySQL Error: ' . mysql_error(), E_USER_ERROR); if (mysql_affected_rows() > 0) { // add code to execute if successful }
  17. $array = array( 3 => 1, 2 => 2, 1 => 3 ); uksort($array, 'natsort'); print_r($array); /* Result: Array ( [1] => 3 [2] => 2 [3] => 1 ) */ Works as expected for me. Can you show the way you're using it?
  18. Could you show the PHP that actually updates the data?
  19. You could just use uksort in combination with natsort: uksort($array, 'natsort'); Just to explain the use of "&" though, it means pass the array by reference. Normally when you use the sorting functions, you don't assign the return value back, you just call it and the array passed in the parameters is updated. If the "&" wasn't included you would need to return the array within the function and call it like: $returned_array = knatsort($passed_array); You don't need to go to these lengths though. Just use the snippet I provided above.
  20. That's a very broad question. I'm guessing you mean the server hardware, not the actual web server software? Also are you talking about purchasing an actual server, or shared/dedicated/virtual servers? What are your requirements? Do you prefer Windows or Linux?
  21. Yeah sorry for the confusion, I missed out E_USER_ERROR for the second parameter. If you didn't see the MySQL error though it's likely you have warning messages hidden.
  22. I can't actually see a fault with the ORDER BY, assuming the column names are correct. Check the error as I mentioned before...
  23. You know what they say about assumption being the mother of all f**k ups? Always check for errors when you execute a query: $results = mysql_query($sql) or trigger_error('MySQL error: ' . mysql_error());
  24. Yes, but not for each row. You would have a table containing a single row for each currency and its corresponding exchange rate, which would all need to be based on the same currency. For example, say this is your currencies table that is all based on GBP: mysql> select * from currencies; +---------------+---------------+ | currency_code | exchange_rate | +---------------+---------------+ | GBP | 1.0000 | | USD | 1.5678 | | EUR | 1.1476 | +---------------+---------------+ You would then use a sub-query to select the exchange rate based on the currency code, retrieving the feedprice/exchange_rate: [...] mr.currency AS currency, case when f.product_sale_price != '0' then f.product_sale_price else f.product_price end feedprice, (select feedprice/exchange_rate from currencies where currency_code = currency) AS international_price [...] Edit Make the exchange rates more precise than 4 decimal places by the way.
×
×
  • 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.