Jump to content

maxhugen

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

maxhugen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks! I don't know what I did wrong when I first tried it, but I got isset() to work OK now. I'll remember your method_exists() tip though, should be useful. Cheers,
  2. I have a php function that fills in a number of text boxes etc in a form. However, there are several forms and web pages involved, and some forms will NOT have all of the text boxes. Thus, I need my function to test if a control actually exists. Currently, I do something like: $Component->$grpatt->SetValue($db->f('attribute')); If the text box control ($grpatt) doesn't exist, I get PHP Fatal error: Call to a member function SetValue() on a non-object. I looked at isset() but that doesn't seem right... and I couldn't get it to work when I tried it anyway. I'm really stuck here, can't go any further till I fix this, so any suggestions would be most appreciated! MTIA
  3. I've set up a PHP page with some code that updates a database table. It runs once an hour using Cron, using the following command: wget http://www.myDomain.com/adm/SetRandomOrder.php The PHP script itself works fine; my problem is that cron (or the wget command?) is saving a copy of the php page every time it runs. How can I prevent the page being saved? Should I use some sort of quit or exit command in the PHP script at the end of the function I'm running? MTIA
  4. Each select in the union must return the same number of fields. The first select returns 2 fields, the next only 1.
  5. Thanks Scott, these date functions rather confuse me, but I got it eventually: // test example $paypal_date = "19:51:24 Jul 14, 2008 PDT"; echo "paypal_date: ".$paypal_date."<br>"; $timestamp = strtotime($paypal_date); echo "timestamp: ".$timestamp."<br>"; $mysql_formatted = date("Y-m-d H:i:s",$timestamp); echo "mysql_formatted: ".$mysql_formatted."<br>";
  6. I'm receiving a date from PayPal's IPN in the format '19:51:24 Jul 14, 2008 PDT': $payment_date = $_POST['payment_date']; I need to insert this into a MySQL date field, which is in the format 'yyyy-mm-dd HH:nn:ss'. Can anyone pls suggest how to change the format, as I'm a newbie at PHP? MTIA
  7. Sorry, unsure what you mean by conditionals... do you mean if ... elseif ... elseif ... etc?
  8. I've been searching unsuccessfully for any optional operators that can be used in the case of a switch statement. I need to return a message, according to the number of days left in a Trial subscription. For example: $days_left = $date_expiry - $date_today; switch ($days_left) { case >3: $msg = "You have ".$days_left." of your Trial."; break; case >0: $msg = "Warning: You only have ".$days_left." of your Trial."; break; case 0: $msg = "Warning: Today is the last day of your Trial."; break; case <0: $msg = "Your free Trial has expired. Please subscribe"; break; } This doesn't work (and nothing I've read suggests it should), so how could I accomplish something like this pls? MTIA
  9. I'm using PHP with html templates (CodeCharge Studio), and I have a form with some Listboxes. In another part of the Form, I need to show the Listbox 'display text' again - not the value. For example: <select id="ClientName"> <option value="1">Bruce</option> <option value="2" selected>Fred</option> <option value="3">Mary</option> </select> <select id="Job"> <option value="1">PHP</option> <option value="2">MySQL</option> <option value="3" selected>AJAX</option> </select> <p>You selected ClientName: [b]Fred[/b]</p> <p>You selected Job: [b]AJAX[/b]</p> I've worked out how to insert the Listbox value, but I don't know how I can insert the display text of the Listbox. Can anyone suggest how i should reference the Listbox display text in php please? MTIA
×
×
  • 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.