GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Gurus, please help me. (https://gfy.com/showthread.php?t=190652)

Tala 10-27-2003 02:45 PM

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>");
?>


jwerd 10-27-2003 02:50 PM

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 :)

Butrflied 10-27-2003 02:51 PM

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

Tala 10-27-2003 02:52 PM

Quote:

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 :)

:eek7


Sorry, you just sounded like Greek to me.

Tala 10-27-2003 02:54 PM

DUH!

Thanks Butrified! I appreciate it. :)

Butrflied 10-27-2003 02:55 PM

Quote:

Originally posted by Tala
DUH!

Thanks Butrified! I appreciate it. :)

Anytime! :winkwink:

Tala 10-27-2003 02:58 PM

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. :helpme

jwerd 10-27-2003 03:04 PM

Quote:

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. :helpme

check ' and " and make sure that if they are inside of your output, they are \" :)

Jimbo 10-27-2003 03:09 PM

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>");
?>


Tala 10-27-2003 03:11 PM

Quote:

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. :(

Libertine 10-27-2003 03:13 PM

Quote:

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>"); 


Tala 10-27-2003 03:16 PM

Quote:

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. :helpme :1orglaugh

Libertine 10-27-2003 03:19 PM

http://www.captainevil.com/gfy/tala.php
http://www.captainevil.com/gfy/tala.phps

Tala 10-27-2003 03:19 PM

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

jwerd 10-27-2003 03:21 PM

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!

Tala 10-27-2003 03:22 PM

w00t!!!!!


Thank you!!!! :thumbsup :thumbsup

jwerd 10-27-2003 03:23 PM

hahaha, nevermind, I see what you are doing -- very nicely done... *early in the morning, yawn*

Jimbo 10-27-2003 03:30 PM

this is GFY day, WEEE

Tala 10-27-2003 03:35 PM

Quote:

Originally posted by Jimbo
this is GFY day, WEEE
Indeed. :)


All times are GMT -7. The time now is 12:48 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123