What do i do wrong?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

What do i do wrong?

Post by GK »

Code: Select all

<?
include "config.php";

$get_rows = mysql_db_query ($dbname,"Select url from top_user Where sid='$site'",$db) or die 

(mysql_error());
$rows = mysql_fetch_array($get_rows);
$site_url = $rows[url];
$site_naam = $rows[naam];
$site_nokiatempo = $rows[nokiatempo];
$site_nokia = $rows[nokia];
$site_siemens = $rows[siemens];
$site_ericsson = $rows[ericsson];
$site_rtttl = $rows[rtttl];

	mysql_db_query ($dbname,"update top_user set thout=thout+1 Where sid='$site'",$db) or die 

(mysql_error());

	mysql_close($db);
header("location: $site_url?$site&,$site_naam&,$site_nokiatempo&,$site_nokia&,$site_siemens&,$site_ericsson&,$site_rtttl");
// echo "<script language="JavaScript">{                                                                   

                      
//    

location.href="$site_url?$site&,$site_naam&,$site_nokiatempo&,$site_nokia&,$site_siemens&,$site_ericsson&,$

site_rtttl";                                                                                           
//    self.focus();                                                                                          

                         
//    }</script>";

   ?>
mod_edit: added

Code: Select all

tags[/size]

i get this output:
http://www.ringtone-zone.nl/gratis/jenn ... amp;,&,
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

try:

Code: Select all

header("location:" . $site_url . "?" . $site . "&" . $site_naam . "&" . enz..enz..
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

ok that works
now ho do i show does variables on that page?
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

Put this in the next page:

Code: Select all

Website: <?php  if (isset($_GET&#1111;site_url])) &#123;print $site_url;&#125; ?>
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

And the rest ofcourse ;-)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

On a side note, you really should read:
Array do's and don'ts -> Why is $foo[bar] wrong?

Mac
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

thanks i will read that
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

Can anyone of you contact me on icq 130291971 or msn g.koetje@home.nl


I need a little bit help and i'm done
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

SOLVED
Last edited by GK on Sun Jun 08, 2003 1:05 pm, edited 2 times in total.
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

There is something wrong in this section:

Code: Select all

$get_rows = mysql_db_query ($dbname,"Select url, naam, nokiatempo, nokia, siemens, ericsson, rtttl from top_user Where sid='$site'",$db) or die
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

Great i got all running!
http://www.ringtone-zone.nl/gratis/temp ... 1054463264

i got 1 more problem (here we go again)

on the mainpage i can only view a sertain amounth of links

i would like 50 a page always and page numbers for 50/100 100/150 and on

this is the index code:

<html>
<head>
<title>Ringtone-zone.nl!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../ring.css" type="text/css">
I REMOVED SOME JAVA
<link rel=stylesheet type=text/css href=http://www.mobilemoney.biz/mmskins/classic/classic.css>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000">
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div align="center"><img src="http://www.ringtone-zone.nl/top.gif" width="740" height="100"></div>
</td>
</tr>
</table>
<table width="668" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="../menu/back2.gif">
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="144" background="../menu/top2.gif" class="tekst4t"> <b><span class="tekst3"><font color="#000000">-</font></span></b><font color="#FF0000"><b><span class="tekst3">
</span></b></font><b><span class="tekst3"></span></b>Welkom!<br>
</td>
<td>
<div align="right"><img src="http://www.ringtone-zone.nl/menu/balkboven.gif"></div>
</td>
</tr>
<tr>
<td bgcolor="#000000" valign="top" class="teksttw"> <span class="teksttw">
<?php include("../menu.php"); php?>
</span></td>
<td valign="top" class="tekst">
<div align="center">
<h5><span class="tekst">De </span><span class="tekst2"><font color="#FF0000">gratis
ringtones</font></span><span class="tekst"> van <font color="#000000">ringtone-zone.nl</font>!<br>
(</span><span class="tekst3">klik op de naam voor de gratis
ringtone die je zelf kunt invoeren</span><span class="tekst">)</span></h5>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<?
include "../top/config.php";

$reset_file = file($reset_log_file);

// checks reset time and resets if it's time
//###########

// makes sure the file isn't empty, if so writes time
if(empty($reset_file[0])){
reset_update_time($reset_log_file,$days_to_reset);
}

if($reset_file[0] <= time()){
reset_list($site_log_file,$total,$file);
reset_update_time($reset_log_file,$days_to_reset);
}
//###########

$reset_file = file($reset_log_file);

if (!$cid) {$cid = 0;}
if (!$from) {$from = 0;}

if ($cid == 0) {
$squery = mysql_query ("select *,if (rank/votes, rank/votes,0) as ranks,if (stars, stars,0) as star from top_user where status='Y' AND thin>=$min_hits order by thin DESC,ranks DESC,star DESC,thout DESC limit $from,$t_step") or die (mysql_error());
$tquery = mysql_db_query ($dbname,"select count(sid) as total from top_user where status='Y'",$db) or die (mysql_error());
}
else {
$squery = mysql_db_query ($dbname,"select *,if (rank/votes, rank/votes,0) as ranks,if (stars, stars,0) as star from top_user where status='Y' AND thin>=$min_hits and category=$cid order by thin DESC,ranks DESC,star DESC,thout DESC limit $from,$t_step",$db) or die (mysql_error());
$tquery = mysql_db_query ($dbname,"select count(sid) as total from top_user where status='Y' and category=$cid",$db) or die (mysql_error());
}

?>
<div align="center">
<script language="JavaScript">
<!--
if (window != top) { top.location.href = location.href; }
-->
</script>
<script language=JavaScript><!--
function changecat(newcat) {
exit=false;
site = "index.php?cid="+(newcat);
if (newcat!=0) {
top.location.href=site;
} else {
top.location.href="index.php";
}
}
-->
</script>
<font color="<? echo $font_color;?>" face="<? echo $font_face;?>" size="<? echo $font_size-1;?>"><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt="">=Leuk
<img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt="">=Interessant
<img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt="">=Moet
je horen<img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt="">=Wauw!
<img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt=""><img src="http://www.ringtone-zone.nl/top/images/star.gif" width="10" height="9" border="0" alt="">=SUPERTIP!</font><br>
<font color="<? echo $font_color;?>" face="<? echo $font_face;?>" size="<? echo $font_size-1;?>">
Er zijn al
<? include "../top/counter.php";?>
bezoekers geweest!<br>
<br>
<font color="#FF0000"><b>MENU OPTIES</b></font>: <b>V</b>=Vote
<b>M</b>=Mail naar een vriend <b>R</b>=Review (<font color="#FF0000"><b>N</b></font>=Nieuw
<font color="#FF0000"><b>H</b></font>=Hot <b> <font color="#FF0000">C</font></b>=Cool)<br>
<br>
</font>
<table bgcolor="black" align="center" width="100%" border="0" cellspacing=0 cellpadding=3>
<tr>
<td align="center" bgcolor="white" width="5%"><b><font face="Arial, Helvetica, sans-serif" size="2">NR</font></b></td>
<td bgcolor="white" width="10%">
<div align="center"><font face="Arial, Helvetica, sans-serif"><font face="Arial, Helvetica, sans-serif"><font size="2"><font size="2"><b>Menu</b></font></font></font></font></div>
</td>
<td bgcolor="white" width="80%"><b><font face="Arial, Helvetica, sans-serif" size="2">Naam</font></b></td>
<td bgcolor="white" width="5%"><font face="Arial, Helvetica, sans-serif" size="2"><b>Uit</b></font></td>
</tr>
<?

if (!$from) $cc=1;
else $cc = $from+1;

while ($rows = mysql_fetch_array($squery)) {
$jscript_imgs[$img_num] = $rows[banner];
if ($rows[ranks] > 0) {
$rating = $rows[ranks];
}
else { $rating = 0;}
?>
<tr valign="middle">
<td align="center" bgcolor="white" width="5%"> <font color="<? echo $font_color;?>" face="<? echo $font_face;?>" size="<? echo $font_size-1;?>">
<? echo $cc;?>
</font> </td>
<td bgcolor="white" width="10%">
<div align="center"><font color="<? echo $font_color;?>" face="<? echo $font_face;?>" size="<? echo $font_size-1;?>">
<?
if ($use_rating == 1) {
echo "<B><font size=\"-2\"><A HREF=\"../top/rate.php?site=$rows[sid]\">V</A></font></B>&nbsp;&nbsp;&nbsp;&nbsp;";
}

if ($use_taf == 1) {
echo "<B><font size=\"-2\"><A HREF=\"../top/recommend.php?site=$rows[sid]&cid=$rows[category]\">M</A></font></B>&nbsp;&nbsp;&nbsp;&nbsp;";
}
if ($use_review == 1) {
$reviews = get_site_reviews($rows[sid]);
echo "<B><font size=\"-2\"><A HREF=\"../top/review.php?site=$rows[sid]\">R</A></font></B>&nbsp;&nbsp;&nbsp;&nbsp;";
}
?>
</font></div>
</td>
<td bgcolor="white" width="80%"><font color="<? echo $font_color;?>" face="<? echo $font_face;?>" size="2"><a href="../top/out.php?<? echo "site=".$rows[sid];?>" onMouseOver="window.status='<? echo $rows[url]?>'; return true;" onMouseOut="window.status=''; return true;">
<? echo $rows[title];?>
</a> -
<? echo $rows[description];?>
<?
if ($new_site_days > 0) {
if (time() - $rows[sid] - 86400*$new_site_days < 0) echo $new_site_image;
}

$htc = hot_status_check ($rows[stars],$hot_site_image);
echo $htc;

if ($use_rating == 1 && $use_cool == 1) {
$ci = get_cool_icon ($rows[rank],$rows[votes],$cool_site_image);
echo $ci;
}
if ($use_rating == 1) {
$ssr = stars_site_rating ($rows[rank],$rows[votes]);
echo $ssr;
}
?>
</font></td>
<td bgcolor="white" width="5%"><font color="<? echo $font_color;?>" face="<? echo $font_face;?>" size="<? echo $font_size-1;?>">
<? echo $rows[thout];?>
</font></td>
</tr>
<?
$cc++;
}

$query = mysql_db_query ($dbname,"select count(sid) as stotal from top_user where status='Y'",$db) or die (mysql_error());
$rows = mysql_fetch_array($query);
$stotal = $rows[stotal];

?>
</table>
</div>
</td>
</tr>
</table>
<br>
<div align="center"><br>
<font color="<? echo $font_color;?>" face="<? echo $font_face;?>" size="<? echo $font_size-1;?>">
</font></div>
<p><br>
</p>
</div>
</td>
</tr>
</table>
</div>
</td>
</tr>
<tr>
<td bgcolor="#000000"><font face="Arial, Helvetica, sans-serif" size="1">-</font></td>
</tr>
</table>
<p class="tekst"><span class="teksttw">
<?php include("../footer.php"); php?>
</span></p>
</div>
</body>
</html>
GK
Forum Commoner
Posts: 51
Joined: Sat Jun 07, 2003 2:58 pm
Contact:

Post by GK »

ALL DONE

THANKS ALL FOR YOUR GREAT HELP!

:D :D
Post Reply