/    Sign up×
Community /Pin to ProfileBookmark

Issue with echo command

Hi tehre
I am new to PHP and learning as I go but I just can’t figure out this problem I am having.

I have a site that calls on a template
ie:

[CODE]http://www.yoursite/4image/index.php?template=glitt-gen[/CODE]

Which leads you to this when an image is clicked on

[CODE]http://www.yoursite.com/4image/index.php?template=glitt-gen2?type=hot-pink[/CODE]

The “type” is a hot pink letter

It is supposed to lead you to this

[CODE]http://www.yoursite/4image/index.php?template=glitt-gencode?type=[/CODE]

But it is not pulling in the type

I was wondering if there is a conflict somewhere that someone can possibly give me any hints on what to look for.

This is a three part script meaning three different files that call on one each after the other. Hope that makes sense.

Here is how the hot-pink code is shown in the first file

[CODE]<a href=”/4image/index.php?template=glitt-gen2?type=hot-pink”><img src=”images/hot-pinka.gif” border=”0″></a>[/CODE]

Here is the second snippet of code from file 2

[CODE]<?
$type = $_REQUEST[“type”];
?>[/CODE]

And the third snippet from the third file which is the final result

[CODE]‘A’ => ‘<a href=”‘.$refer_url.'” target=”_blank”><img src=”‘.$img_base.$type.’a.gif” border=”0″ alt=”‘.$refer_name.'”></a>’,[/CODE]

I hope this makes sense to someone, lol

Thanks so much

to post a comment
PHP

10 Comments(s)

Copy linkTweet thisAlerts:
@Paul_JrFeb 23.2007 — I haven't a clue as to whether this will solve your problem, or if there is some other underlying issue, but after the initial '?' in the URL, name=value pairs should be separated by an ampersand (&): http://www.someurl.com/index.php?name1=value1&name2=value2&name3=value3
Copy linkTweet thisAlerts:
@sexytinkauthorFeb 23.2007 — How would I add the & sign to the code

'A' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'a.gif" border="0" alt="'.$refer_name.'"></a>',

so it calls it automatically?

Thanks or your help
Copy linkTweet thisAlerts:
@Paul_JrFeb 23.2007 — Where does the value of [font=courier]$refer_url[/font] come from?
Copy linkTweet thisAlerts:
@sexytinkauthorFeb 23.2007 — Here is the entire code

[CODE]<?php $title = "Word Generator";
$refer_name = 'code by YourCompany';
$refer_url = 'http://'.$_SERVER['HTTP_HOST'].'/';
$img_base = 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER[PHP_SELF]).'/images/';
echo $url_base."<br><br>";

?>
<div id="content">
<div id="titlebox">
<h1>Word Generator</h1>
</div>
<div id="pagebox">

<table border="0" cellspacing="0" cellpadding="4" width="100%" align="center">
<tr>
<td colspan="2" align="right" bgcolor="#eeeeee" style="border-bottom: 1px solid #cccccc"><strong>Glitter Preview</strong></td>
</tr>
<td style="border-bottom: 1px dashed #cccccc">
<?
$type = $_REQUEST["type"];
$text = strtoupper($_POST["text"]);
echo "$text<br><br>";
$convert = array(
' ' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.'spacer.gif" border="0" alt="'.$refer_name.'"></a>',
'A' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'a.gif" border="0" alt="'.$refer_name.'"></a>',
'B' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'b.gif" border="0" alt="'.$refer_name.'"></a>',
'C' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'c.gif" border="0" alt="'.$refer_name.'"></a>',
'D' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'d.gif" border="0" alt="'.$refer_name.'"></a>',
'E' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'e.gif" border="0" alt="'.$refer_name.'"></a>',
'F' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'f.gif" border="0" alt="'.$refer_name.'"></a>',
'G' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'g.gif" border="0" alt="'.$refer_name.'"></a>',
'H' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'h.gif" border="0" alt="'.$refer_name.'"></a>',
'I' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'i.gif" border="0" alt="'.$refer_name.'"></a>',
'J' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'j.gif" border="0" alt="'.$refer_name.'"></a>',
'K' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'k.gif" border="0" alt="'.$refer_name.'"></a>',
'L' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'l.gif" border="0" alt="'.$refer_name.'"></a>',
'M' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'m.gif" border="0" alt="'.$refer_name.'"></a>',
'N' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'n.gif" border="0" alt="'.$refer_name.'"></a>',
'O' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'o.gif" border="0" alt="'.$refer_name.'"></a>',
'P' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'p.gif" border="0" alt="'.$refer_name.'"></a>',
'Q' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'q.gif" border="0" alt="'.$refer_name.'"></a>',
'R' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'r.gif" border="0" alt="'.$refer_name.'"></a>',
'S' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'s.gif" border="0" alt="'.$refer_name.'"></a>',
'T' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'t.gif" border="0" alt="'.$refer_name.'"></a>',
'U' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'u.gif" border="0" alt="'.$refer_name.'"></a>',
'V' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'v.gif" border="0" alt="'.$refer_name.'"></a>',
'W' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'w.gif" border="0" alt="'.$refer_name.'"></a>',
'X' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'x.gif" border="0" alt="'.$refer_name.'"></a>',
'Y' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'y.gif" border="0" alt="'.$refer_name.'"></a>',
'Z' => '<a href="'.$refer_url.'" target="_blank"><img src="'.$img_base.$type.'z.gif" border="0" alt="'.$refer_name.'"></a>',

);

$new_code = '';
for ($i=0; $i<strlen($text); $i++) {
$new_code .= $convert[substr($text,$i,1)];
}

?>
<?
echo $new_code;
?>
</td>
</tr>
<tr>
<td colspan="2" height="50" align="right"></td>
</tr>

<tr>
<td colspan="2" align="right" bgcolor="#eeeeee" style="border-bottom: 1px solid #cccccc"><strong>Copy and paste the following code anywhere you want!</strong></td>
</tr>
<tr>
<td style="border-bottom: 1px dashed #cccccc">
<textarea name="textarea" cols=50 rows=10 class="bginput" onClick="this.focus();this.select()">
<?
echo $new_code;
?>
</textarea>
</td>
</tr>

</table>

</div>
</div>
<div id="footer"></div>
</div>

[/CODE]
Copy linkTweet thisAlerts:
@sexytinkauthorMar 01.2007 — I just cant figure out what the problem is.

I have tried using <? and <?php commands and nothing works. I can't figure out why it is not pulling in the echo command like it should be.

If someone could take a look at these codes and maybe you see something I am missing.

[CODE]http://www.hellonturf.com/glitter-word.rar[/CODE]

Here is the site I am having a problem on. IF you go throu step 1 and two, they work just fine calling on the echo command, but it's step three relying on step 2, if that makes sense, that is having an issue.
[CODE]http://www.hellonturf.com/4image/index.php?template=glitter-word-generator[/CODE]

Here is what the final result should look like
[CODE]http://www.hellonturf.com/4image/glitter/glitter-word-generator.php[/CODE]

Thanks

ps. Is it the way it is using the template? If so, then why don't the glitter-word-generator have an issue or the glitter-word-generator-2 have an issue. All are using the same template here
[CODE]{header}
<table width="740" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<table width="640" border="0" cellspacing="0" cellpadding="0" class="tablehead">
<tr>
<td colspan="4"><img src="{template_url}/images/header_top.gif" width="740" height="6" alt="" /></td>
</tr>
<tr>
<td width="6"><img src="{template_url}/images/header_left.gif" width="6" height="60" alt="" /></td>
<td width="405"><img src="{template_url}/images/header_logo.gif" width="405" height="60" alt="" /></td>
<td width="225" align="right">
<form method="post" action="{url_search}">
<table border="0" cellspacing="0" cellpadding="1">
<tr>
<td>
<input type="text" name="search_keywords" size="15" class="searchinput" />
</td>
<td>
<input type="submit" value="{lang_search}" class="button" name="submit" />
</td>
</tr>
<tr valign="top">
<td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
</tr>
</table>
</form>
</td>
<td align="right" width="6"><img src="{template_url}/images/header_right.gif" width="6" height="60" alt="" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td class="bordercolor">
<table width="740" border="0" cellspacing="1" cellpadding="0">
<tr>
<td class="tablebgcolor">
<table width="638" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="23" class="navbar">
<table width="736" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
<td align="right">
<a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;
<a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
</td>
</tr>
</table>
</td>
</tr>
</table>
<table width="638" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" valign="top" class="row2">
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_registered_user}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">{user_box} </td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{if random_image}
<table width="150" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_random_image}</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
<tr>
<td align="center" class="row1">
<br />
{random_image}
<br />
<br />
</td>
</tr>
<tr>
<td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
</table>
{endif random_image}
</td>
<td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt="" /></td>
<td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt="" /></td>
<td width="450" valign="top">
<?
include($_SERVER['DOCUMENT_ROOT']."/4image/gen/glitter-word-code.php");
?>
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>{category_dropdown_form}</td>
<td align="right">{setperpage_dropdown_form}</td>
</tr>
</table>
<p>&nbsp;</p>
</td>
<td width="20" valign="top"><img src="{template_url}/images/spacer.gif" width="19" height="19" alt="" /></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="740" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
<tr>
<td width="6"><img src="{template_url}/images/footer_left.gif" width="6" height="19" alt="" /></td>
<td width="405">&nbsp;</td>
<td width="225">&nbsp;</td>
<td width="6"><img src="{template_url}/images/footer_right.gif" width="6" height="19" alt="" /></td>
</tr>
</table>
</td>
</tr>
</table>
{footer}[/CODE]
Copy linkTweet thisAlerts:
@Paul_JrMar 01.2007 — Either the URL pointing to the images is incorrect, or the images aren't on the server. If you try to load one of the images, ( http://www.hellonturf.com/4image/images/b.gif, for example), it brings up a 404 page. So, is that the correct URL? Are the images even there?

On the page where you select the glitter style you want (http://www.hellonturf.com/4image/index.php?template=glitter-word-generator), what is the PHP code for that page? Like, if you choose the first style -- where is that URL coming from?
Copy linkTweet thisAlerts:
@sexytinkauthorMar 01.2007 — The images are there or else you would not get the images to show on the first step.

Here is the code for the generator itself (http://www.hellonturf.com/4image/index.php?template=glitter-word-generator)

[CODE]<?php $title = "Myspace Glitter Word Generator";
?>

<div id="content">
<div id="titlebox">
<h1>Myspace Glitter Word Generator</h1>
</div>
<div id="pagebox">

<table border="0" cellspacing="0" cellpadding="4" width="100%" align="center">
<tr>
<td colspan="2" align="right" bgcolor="#eeeeee" style="border-bottom: 1px solid #cccccc"><strong>Click On The Glitter Style You Want!</strong></td>
</tr>
<tr>
<td style="border-bottom: 1px dashed #cccccc" colspan="2">
<a href="index.php?template=glitter-word-generator-2?type=hot-pink"><img src="images/hot-pinka.gif" border="0"></a>
<a href="glitter-word-generator-2.php?type=baby-blue"><img src="images/baby-bluea.gif" border="0"></a>
<a href="glitter-word-generator-2.php?type=baby-pink"><img src="images/baby-pinka.gif" border="0"></a>
<a href="glitter-word-generator-2.php?type=gri-pink"><img src="images/gri-pinka.gif" border="0"></a>
<a href="glitter-word-generator-2.php?type=gri-purple"><img src="images/gri-purplea.gif" border="0"></a>
<a href="glitter-word-generator-2.php?type=star-purple"><img src="images/star-purplea.gif" border="0"></a>
</td>
</tr>
</table>

</div>
</div>
<div id="footer"></div>
</div>
[/CODE]
Copy linkTweet thisAlerts:
@Paul_JrMar 01.2007 — Haha, okay, I get why the images aren't showing up. Sorry, I've had about an hour's worth of sleep in the past 24 hours. The issue is with this piece of code:
&lt;a href="index.php?template=glitter-word-generator-2?type=hot-pink"&gt;&lt;img src="images/hot-pinka.gif" border="0"&gt;&lt;/a&gt;
You wanna change that to...
&lt;a href="index.php?template=glitter-word-generator-2[b][u]&amp;[/u][/b]type=hot-pink"&gt;&lt;img src="images/hot-pinka.gif" border="0"&gt;&lt;/a&gt;
I changed the second question mark to an '&' sign.
Copy linkTweet thisAlerts:
@sexytinkauthorMar 01.2007 — OH my gosh. Thank you so much! I thought I changed them when you told me about the & sign to begin with. Silly me. Thanks again. I really do appreciate it. It's nice to have a fresh set of eyes. ?
Copy linkTweet thisAlerts:
@Paul_JrMar 03.2007 — OH my gosh. Thank you so much! I thought I changed them when you told me about the & sign to begin with. Silly me. Thanks again. I really do appreciate it. It's nice to have a fresh set of eyes. ?[/QUOTE]
Heheh, when you've been staring at code long enough, it's always those miniscule details you think you covered that are screwing everything up. ?
×

Success!

Help @sexytink spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...