Jump to content

zq29

Staff Alumni
  • Posts

    2,752
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by zq29

  1. You could use ereg() in your processing script, maybe something like:
    [code]if(ereg("[0-9]*\.[0-9]{2}",$amtpaid)) echo "Everything is OK";[/code]
    If you want to do this prior to your processing, you'd need to use a client side language, such as JavaScript.
  2. I don't fully understand what you mean by 'embed' a file into a page. You can use include() to insert another scripted/plain text file within your page...

    With regards to your URL structures, you can do that with an Apache module called mod_rewrite, searching the forums or checking out the documentation over at apache.org should help you out with that.
  3. How are you setting the variables? Somehow you are creating them as arrays. You can view the structure of your arrays with something like...
    [code]<?php
    echo "<pre>";
    print_r($array);
    echo "</pre>";
    ?>[/code]
  4. Here's an example from the manual, using the function imagettftext() :
    [code=php:0]<?php
    // Set the content-type
    header("Content-type: image/png");

    // Create the image
    $im = imagecreatetruecolor(400, 30);

    // Create some colors
    $white = imagecolorallocate($im, 255, 255, 255);
    $grey = imagecolorallocate($im, 128, 128, 128);
    $black = imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, 399, 29, $white);

    // The text to draw
    $text = 'Testing...';
    // Replace path by your own font path
    $font = 'arial.ttf';

    // Add some shadow to the text
    imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);

    // Add the text
    imagettftext($im, 20, 0, 10, 20, $black, $font, $text);

    // Using imagepng() results in clearer text compared with imagejpeg()
    imagepng($im);
    imagedestroy($im);
    ?>[/code]
  5. An SMTP server is your outgoing mail server, you normally get a mailserver along with your web hosting package and domain name, it is usually something like mail.your-domain.com or smtp.your-domain.com. If you don't currently have any hosting and just want to send mail from your local machine, you can normally use your ISPs outgoing mail server. You'd have to ask your ISP what this is, either give them a call, look on their site or in any documentation you got when you signed up for your internet subscription.
  6. I've actually brought this up in our admin forum! I didn't know you can use PHP tags though! Also, if you put the <?php and  ?> between code tags you get colour coding... But yeah, it is too small!
    [code]<?php
    function count_to_one_hundred() {
        for($i=1; $i<=100; $i++)
            echo $i."<br/>";
    }

    count_to_one_hundred();
    ?>[/code]
  7. It's perfectly fine to use echo, although you must be careful with your quotes, you must escape double quotes if your text is enclosed in double quotes, or replace them with single quotes.
    [code]<?php
    //This is correct
    echo "Hello, my name is 'Kris', pleased to meet you.";

    //This is also correct
    echo "Hello, my name is \"Kris\", pleased to meet you.";

    //This is incorrect
    echo "Hello, my name is "Kris", pleased to meet you.";
    ?>[/code]
    An alternative would be to use the HEREDOC syntax, you can see how to use it [url=http://uk.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc]here in the manual[/url].
  8. [quote author=wildteen88 link=topic=98971.msg389553#msg389553 date=1151658529]
    Hi SA. To chnage you signatur you need to got your Profile then goto Account Related Settings and you find a box that says member group. Change that to Global Moderator, then at the bottom theres a password box. Fill in your password then click The Change button. You'll now get an extend list of options on the left hand panel.
    [/quote]Thanks wildteen88  :)
  9. [!--quoteo(post=388343:date=Jun 27 2006, 04:48 AM:name=dan182skater)--][div class=\'quotetop\']QUOTE(dan182skater @ Jun 27 2006, 04:48 AM) [snapback]388343[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    thanks for the reply, but that made no sense to me.
    [/quote]
    I meant you could write a script with the PHP functions I listed to search your files. Something like this...
    [code]<?php
    foreach(glob("dir/to/files/*.php") as $f) {
        $lines = file($f);
        foreach($lines as $l) {
            if(strpos($l,"I am looking for this in my code") !== FALSE) echo "<p>WE HAVE A MATCH IN $f</p>";
        }
    }
    ?>[/code]
    This is untested, so I'm not sure if it would work. Failingthis, doesn't Windows "find" search within files?
  10. Look at the properties of an image on both addresses, the second one is different to the first - There is a directory named 'index.php' half way in the location of the file...

    Also, please only post PHP questions in the PHP Help forum. Moved.
  11. There is some good example code in [a href=\"http://uk.php.net/manual/en/function.xml-parse-into-struct.php\" target=\"_blank\"]the manual pages for xml_parse_into_struct()[/a]
  12. [code]if (is_resource($rsData)) {
        echo "<meta http-equiv='refresh' content='0;url=password2.php'>";
    } else {
        echo "<meta http-equiv='refresh' content='0;url=incorrect.html'>";
    }[/code]
    [b]EDIT:[/b] Beaten to it!
  13. You don't have more than one array there, you have a single array. But to get the result you require, you could probably go about it like so...

    [code]<?php
    $array = array("2  A1 B1 C1 X","2  A2 B2 C3 Y","2  A3 B3 C3 Z",
    "3  D1 E1 F1 A","3  D2 E2 F2 B","3  D3 E3 F3 C",
    "4  G1 H1 I1 J","4  G2 H2 I2 K","4  G3 H3 I3 L");

    $i = 0;
    $new = array();
    $tmp = "";
    foreach($array as $a) {
        $tmp .= "$a\t";
        $i++;

        if($i%3==0) {
            $new[] = $tmp;
            $tmp = "";
        }
    }
    echo "<pre>"; print_r($new); echo "</pre>";
    ?>[/code]
    Might need a little tweaking, but it's along the right path.
×
×
  • 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.