User Profile

Collapse

Profile Sidebar

Collapse
dlite922
dlite922
Last Activity: Sep 29 '14, 07:24 PM
Joined: Dec 23 '07
Location: Denver, CO
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dlite922
    replied to How to create a deck of cards
    Here you go buddy, this is the easier way of doing it.

    I'll walk you through the thought process:

    1. First outline what you have: Card values, card suites:

    Code:
    card_values = ['2','3','4','5','6','7','8','9','10','Jack','Queen','King','Ace']
    card_suites = ['Hearts', 'Clubs', 'Diomands', 'Spades']
    2. Then you need to combine these lists (multiply them), but still leave them in a...
    See more | Go to post
    Last edited by dlite922; Sep 12 '14, 04:13 PM. Reason: Clarify

    Leave a comment:


  • We're PHP experts, not WordPress experts except maybe a few. Can you explain your problem better with exactly what you want PHP to do?

    Remember that PHP is a programming language that is executed on your server, not in your browser. You want to store the contents of a page (with a chart in it) and put that into a PHP function that returns that html when you call it? (assuming you want to insert this elsewhere)
    See more | Go to post

    Leave a comment:


  • You need to have a crontab or windows task prom that runs your stored procedure and checks the value and then triggers the email alert.
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to compare time for multiple cases
    in PHP
    if you have multiple goal times, put them into an array.
    See more | Go to post

    Leave a comment:


  • By the way, this solution also will prevent multiple logins from different computers. If you are just trying to prevent multiple browsers but enable them to login from multiple computers, then you also need to track IP address or user agent (which is also a good idea to store along with active/deactive status).

    what if someone try's to login from the same browser twice? i.e. from a second tab or uses login page in browser history to...
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to Send data type into textbox to addressbar
    in PHP
    We don't write code for people here, but since this is so short that explaining it will probably take longer, here's a simple code to do what you're asking

    Code:
    <?php
    
    if($_GET['submit']) header("location: http://www.mywebsite.com/".$_GET['page_name'])
    
    ?>
    <html>
     <body>
      <form action="" method="get">
       <input type="text"
    ...
    See more | Go to post

    Leave a comment:


  • You can use

    Code:
    $cleanXML = preg_replace('#<cardnum>.+</cardnum>#','',$xml_str);
    This could be an encoding issue. Try utf-8 and see if it's able to read it then.

    Dan
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to how while loop value prints outside loop
    in PHP
    You can't print a variable in the scope of the while loop outside it's scope, outside the while loop.

    Your code iterates through the while loop and prints the last value that was assigned to $sfname.
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to APACHE HTTP set up for PHP
    in PHP
    if it's a local server, it can be anything you want. If registered on the internet, it's your domain name: www.example.com
    See more | Go to post

    Leave a comment:


  • Because of smarty's default curly bracket ({}) tags, you need to use the smarty {literal} tag to echo out your variable value to a javascript one. Remember javaScript is client side, server does not execute it like smarty and php, the user's computer browser executes it.

    You can also print it out to a hidden field and read it using javascript. document.getEle mentById('hidde nFieldsID').val ue. or using jquery: $('#hiddenField ID').val()...
    See more | Go to post

    Leave a comment:


  • Are you searching for key-> value pairs? or search for a keyword no matter if it's a key or a value. If the former, you first take the key and search for keys in the array matching that, as soon as you have a match, you compare its value to your value, if it's a match you return it. (or continue if you want to find all instance of it)

    Tackle the code yourself and let us know where you get stuck,

    Dan
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to How to create a telnet session using php?
    in PHP
    Checkout php.net/fsockopen.

    Dan
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to XML file in PHP
    in PHP
    Yes it's possible. You need to connect to your database using combination of the following functions: mysql_connect() mysql_select_db (), mysql_query() and mysql_fetch_<ty pe>();

    Checkout the PHP manual at php.net if you don't know how to use any of these functions.

    Good luck,


    Dan
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to How does this piece of code work?
    in PHP
    Lesson to learn: Don't modify header AFTER you've already sent content (in your case you've sent the all the characters "<html> to ...title</h1" and then you modify it.

    $fileName is just a variable that contains the name of the attachment, whatever you want to call it. If you change that line to

    Code:
            header('Content-Disposition: attachment; filename="chicken.doc"');
    The file...
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to ComPort to Web Page. With PHP?
    in PHP
    All of it is possible using PHP. Make sure you have any PHP module that you need. One would be GD library. PHP is easy to compile on Linux and GD is so popular I'm it's just a .dll include for a Windows server.

    Good luck,

    Dan
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to Time estimates
    in PHP
    The answer...depend s on:

    1. Is it crucial that you meet the deadline?
    2. How complex is the issue?
    3. Have you done it before?

    If someone asks me if I could add a button to the dashboard of the application to show the about page. It would take me let's say 1 hour. I'd double it and say 2 Hours development, 1 hour testing. (I work for a corporate company)

    If they ask me to develop a site and...
    See more | Go to post

    Leave a comment:


  • You write you query as you normally would except you would prepend the name of the database to the table. i.e. db1.table1, db2.table2 etc.

    If you're looking to do this using CodeIgniter API, you need to refer to the CodeIgniter manual to see how to do this.

    Dan
    See more | Go to post

    Leave a comment:


  • see the serialize() and unserialize() methods. It converts objects to strings then back to objects again with some LIMITATIONS. Check the manual page http://php.net/serialize

    Dan
    See more | Go to post

    Leave a comment:


  • dlite922
    replied to throw giving error message
    in PHP
    I copy and pasted your code. It works as expected. A Fatal error occurs because the exception is thrown. I didn't see your T_STRING error. Check to make sure you're working with the latest code.

    Dan
    See more | Go to post

    Leave a comment:


  • Is your database in UTF-8 charset?

    Dan
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...