PHP Gurus, please help me.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tala
    Fucked if I know
    • Dec 2002
    • 23368

    #1

    PHP Gurus, please help me.

    Yes, I'm VERY new at this. Someone please tell me what I'm doing wrong. This won't output what it's supposed to, and it's for an assignment. (READ: no flames, please, I'm honestly seeking help.)

    PHP Code:
    <?
    //set up the array first
    $url=array('http://www.freakmanor.com',
    'http://www.free-porn-spot.com','http://www.msnarcissa.com',
    'http://www.chainleather.com','http://www.php.net',
    'http://www.infidelguy.com','http://www.blowmeuptom.com',
    'http://www.rotten.com','http://www.google.com',
    'http://www.typeonegative.net','http://www.queensryche.com',
    'http://www.big-tits.com', 'http://www.kinkinc.net',
    'http://www.sex.com', 'http://www.boysrus.com',
     'http://www.gofuckyourself.com', 'http://www.hardcoredesigns.net', 
    'http://www.whoopsie.com', 'http://www.nurple.com',
     'http://www.leathercellar.com', 'http://www.bmezine.com',
     'http://www.yahoo.com', 'http://www.silkandsteel.com', 
    'http://www.porncity.net', 'http://www.gor.com', 
    'http://www.halloween.com', 'http://www.gfy.com', 
    'http://www.talawolf.com', 'http://www.naughtyfables.com',
     'http://www.dogfarts.com', 'http://www.homestarrunner.com');
    //What day is it?
    $day_of_month = (date("j")-1);
    //Output
    print("< a href=\"$url[$day]$url[$day]</A>");
    ?>
    Last edited by Tala; 10-27-2003, 12:48 PM.

    ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.
  • jwerd
    Confirmed User
    • Jun 2003
    • 1953

    #2
    What I see is you want it to display that many times, but go throug the array and for every entry show a new link, yes? Well first, you have to use a loop to tell php to keep executing that code until the condition returns false

    use a while loop or for loop
    Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com

    Comment

    • Butrflied
      Confirmed User
      • Aug 2002
      • 1344

      #3
      PHP Code:
      <?
      //set up the array first
      $url=array('http://www.freakmanor.com','http://www.free-porn-spot.com','http://www.msnarcissa.com','http://www.chainleather.com','http://www.php.net','http://www.infidelguy.com','http://www.blowmeuptom.com', 'http://www.rotten.com', 'http://www.google.com', 'http://www.typeonegative.net', 'http://www.queensryche.com', 'http://www.big-tits.com', 'http://www.kinkinc.net', 'http://www.sex.com', 'http://www.boysrus.com', 'http://www.gofuckyourself.com', 'http://www.hardcoredesigns.net', 'http://www.whoopsie.com', 'http://www.nurple.com', 'http://www.leathercellar.com', 'http://www.bmezine.com', 'http://www.yahoo.com', 'http://www.silkandsteel.com', 'http://www.porncity.net', 'http://www.gor.com', 'http://www.halloween.com', 'http://www.gfy.com', 'http://www.talawolf.com', 'http://www.naughtyfables.com', 'http://www.dogfarts.com', 'http://www.homestarrunner.com');
      //What day is it?
      $day_of_month = (date("j")-1);
      //Output
      print("<a href=\"$url[$day_of_month]\">$url[$day_of_month]</A>");
      ?>
      You forgot the closing quote on your html link and you had the wrong variable name there
      ~Butrflied~

      Comment

      • Tala
        Fucked if I know
        • Dec 2002
        • 23368

        #4
        Originally posted by lamerhooD
        What I see is you want it to display that many times, but go throug the array and for every entry show a new link, yes? Well first, you have to use a loop to tell php to keep executing that code until the condition returns false

        use a while loop or for loop



        Sorry, you just sounded like Greek to me.

        ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

        Comment

        • Tala
          Fucked if I know
          • Dec 2002
          • 23368

          #5
          DUH!

          Thanks Butrified! I appreciate it.

          ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

          Comment

          • Butrflied
            Confirmed User
            • Aug 2002
            • 1344

            #6
            Originally posted by Tala
            DUH!

            Thanks Butrified! I appreciate it.
            Anytime!
            ~Butrflied~

            Comment

            • Tala
              Fucked if I know
              • Dec 2002
              • 23368

              #7
              Dammit, now I'm getting this:

              Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site5/fst/var/www/html/talawolf/three.php on line 17


              *bangs head against wall*

              Oy, I'm a doofus.

              ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

              Comment

              • jwerd
                Confirmed User
                • Jun 2003
                • 1953

                #8
                Originally posted by Tala
                Dammit, now I'm getting this:

                Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site5/fst/var/www/html/talawolf/three.php on line 17


                *bangs head against wall*

                Oy, I'm a doofus.
                check ' and " and make sure that if they are inside of your output, they are \"
                Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com

                Comment

                • Jimbo
                  Confirmed User
                  • Oct 2001
                  • 3989

                  #9
                  use that:

                  PHP Code:
                  <?
                  //set up the array first
                  $url=array('http://www.freakmanor.com',
                  'http://www.free-porn-spot.com','http://www.msnarcissa.com',
                  'http://www.chainleather.com','http://www.php.net',
                  'http://www.infidelguy.com','http://www.blowmeuptom.com',
                  'http://www.rotten.com','http://www.google.com',
                  'http://www.typeonegative.net','http://www.queensryche.com',
                  'http://www.big-tits.com', 'http://www.kinkinc.net',
                  'http://www.sex.com', 'http://www.boysrus.com',
                   'http://www.gofuckyourself.com', 'http://www.hardcoredesigns.net', 
                  'http://www.whoopsie.com', 'http://www.nurple.com',
                   'http://www.leathercellar.com', 'http://www.bmezine.com',
                   'http://www.yahoo.com', 'http://www.silkandsteel.com', 
                  'http://www.porncity.net', 'http://www.gor.com', 
                  'http://www.halloween.com', 'http://www.gfy.com', 
                  'http://www.talawolf.com', 'http://www.naughtyfables.com',
                   'http://www.dogfarts.com', 'http://www.homestarrunner.com');
                  //What day is it?
                  $day_of_month = (date("j")-1);
                  //Output
                  print("<a href=\"".$url[$day].$url[$day_of_month]."\"></A>");
                  ?>
                  free sex videos

                  Comment

                  • Tala
                    Fucked if I know
                    • Dec 2002
                    • 23368

                    #10
                    Originally posted by Jimbo
                    use that:

                    PHP Code:
                    <?
                    //set up the array first
                    $url=array('http://www.freakmanor.com',
                    'http://www.free-porn-spot.com','http://www.msnarcissa.com',
                    'http://www.chainleather.com','http://www.php.net',
                    'http://www.infidelguy.com','http://www.blowmeuptom.com',
                    'http://www.rotten.com','http://www.google.com',
                    'http://www.typeonegative.net','http://www.queensryche.com',
                    'http://www.big-tits.com', 'http://www.kinkinc.net',
                    'http://www.sex.com', 'http://www.boysrus.com',
                     'http://www.gofuckyourself.com', 'http://www.hardcoredesigns.net', 
                    'http://www.whoopsie.com', 'http://www.nurple.com',
                     'http://www.leathercellar.com', 'http://www.bmezine.com',
                     'http://www.yahoo.com', 'http://www.silkandsteel.com', 
                    'http://www.porncity.net', 'http://www.gor.com', 
                    'http://www.halloween.com', 'http://www.gfy.com', 
                    'http://www.talawolf.com', 'http://www.naughtyfables.com',
                     'http://www.dogfarts.com', 'http://www.homestarrunner.com');
                    //What day is it?
                    $day_of_month = (date("j")-1);
                    //Output
                    print("<a href=\"".$url[$day].$url[$day_of_month]."\"></A>");
                    ?>
                    well, that took care of the message I was getting, but now I don't see anything at all.

                    ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

                    Comment

                    • Libertine
                      sex dwarf
                      • May 2002
                      • 17860

                      #11
                      Originally posted by Jimbo
                      use that:

                      PHP Code:
                      <?
                      //set up the array first
                      $url=array('http://www.freakmanor.com',
                      'http://www.free-porn-spot.com','http://www.msnarcissa.com',
                      'http://www.chainleather.com','http://www.php.net',
                      'http://www.infidelguy.com','http://www.blowmeuptom.com',
                      'http://www.rotten.com','http://www.google.com',
                      'http://www.typeonegative.net','http://www.queensryche.com',
                      'http://www.big-tits.com', 'http://www.kinkinc.net',
                      'http://www.sex.com', 'http://www.boysrus.com',
                       'http://www.gofuckyourself.com', 'http://www.hardcoredesigns.net', 
                      'http://www.whoopsie.com', 'http://www.nurple.com',
                       'http://www.leathercellar.com', 'http://www.bmezine.com',
                       'http://www.yahoo.com', 'http://www.silkandsteel.com', 
                      'http://www.porncity.net', 'http://www.gor.com', 
                      'http://www.halloween.com', 'http://www.gfy.com', 
                      'http://www.talawolf.com', 'http://www.naughtyfables.com',
                       'http://www.dogfarts.com', 'http://www.homestarrunner.com');
                      //What day is it?
                      $day_of_month = (date("j")-1);
                      //Output
                      print("<a href=\"".$url[$day].$url[$day_of_month]."\"></A>");
                      ?>
                      Better print, but your html skills are lacking ;)

                      PHP Code:
                      print("<a href=\"" . $url[$day_of_month] . "\">" . $url[$day_of_month] . "</a>"); 
                      
                      /(bb|[^b]{2})/

                      Comment

                      • Tala
                        Fucked if I know
                        • Dec 2002
                        • 23368

                        #12
                        Originally posted by punkworld


                        Better print, but your html skills are lacking ;)

                        PHP Code:
                        print("<a href=\"" . $url[$day_of_month] . "\">" . $url[$day_of_month] . "</a>"); 
                        
                        Hon, that garnered me this:

                        Parse error: parse error, unexpected $ in /home/virtual/site5/fst/var/www/html/talawolf/three.php on line 41



                        There IS no line 41.

                        ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

                        Comment

                        • Libertine
                          sex dwarf
                          • May 2002
                          • 17860

                          #13
                          http://www.captainevil.com/gfy/tala.php
                          http://www.captainevil.com/gfy/tala.phps
                          /(bb|[^b]{2})/

                          Comment

                          • Tala
                            Fucked if I know
                            • Dec 2002
                            • 23368

                            #14
                            This is ridiculous. Should be an easy fix and I'm confusing the hell out of my fuckin prof.! Time for a re-write.

                            ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

                            Comment

                            • jwerd
                              Confirmed User
                              • Jun 2003
                              • 1953

                              #15
                              PHP Code:
                              print("<a href=\"".$url[$day].$url[$day_of_month]."\"></A>"); 
                              
                              That gets rid of the parse error, but it still doesn't output. Remember html -- The out is after the a href = bla>[right here] </a>

                              Good luck!
                              Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com

                              Comment

                              • Tala
                                Fucked if I know
                                • Dec 2002
                                • 23368

                                #16
                                w00t!!!!!


                                Thank you!!!!

                                ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

                                Comment

                                • jwerd
                                  Confirmed User
                                  • Jun 2003
                                  • 1953

                                  #17
                                  hahaha, nevermind, I see what you are doing -- very nicely done... *early in the morning, yawn*
                                  Last edited by jwerd; 10-27-2003, 01:26 PM.
                                  Yii Framework Guru - Seasoned PHP vet - Partner @ XXXCoupon.com

                                  Comment

                                  • Jimbo
                                    Confirmed User
                                    • Oct 2001
                                    • 3989

                                    #18
                                    this is GFY day, WEEE
                                    free sex videos

                                    Comment

                                    • Tala
                                      Fucked if I know
                                      • Dec 2002
                                      • 23368

                                      #19
                                      Originally posted by Jimbo
                                      this is GFY day, WEEE
                                      Indeed.

                                      ICQ: 11120676 | Google: mindcrime | Skype: suitemindcrime|E-Mail: mindcrime AT gmail.com|PR girl with great writing skills for hire!!!! Contact me to work for YOU!|TECHIEMEDIA? 24/7 support from some of the best techs in the biz. Tell Jim that I sent you.

                                      Comment

                                      Working...