help with Get_


Posted on 16th Feb 2014 07:03 pm by admin

ok some how this is not working i am not sure what i am doing wrong here but what this does is when the user goes to Secret-Codes.php they get a menu and when they pick the phone they want to view it then displays it as expl www.bhawap.com/Secret-Codes?phone=Nokia but i some how am doing something wrong here is my code
Code: <?php


$ShowBookmark = "False";
include 'Include/Header.php';

if($_GET['phone'] == True) {
GetCodes();
}else {
Show_Form();
}

function Show_Form() {
$thedate = date('l dS F Y');
echo '<div class="hd2"><font color=#666666><strong><center>Mobile Secret Codes</center></strong></font></div>
';
echo '<center><font face="Verdana" size="2" color="#3366ff"><u>' .$thedate. '</center></u></font>';
echo '<table id="" border="0" style="font-size:9pt;width:100%;">';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=BenQ">BenQ</b></font></a>
';
echo '</td></tr>';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=Nokia">Nokia</b></font></a>
';
echo '</td></tr>';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=Lg">Lg</b></font></a>
';
echo '</td></tr>';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=Sharp">Sharp</b></font></a>
';
echo '</td></tr>';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=Motorola">Motorola</b></font></a>

';
echo '</td></tr>';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=Samsung">Samsung</b></font></a>
';
echo '</td></tr>';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=Sony-erricson">Sony-erricson</b></font></a>
';
echo '</td></tr>';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/tools.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="Secret-Codes.php?phone=Sagem">Sagem</b></font></a>

';
echo '</td></tr>';
echo '</table>';
echo '<center><font face="Verdana" size="2"><?php echo $GLOBALS["Advert03"]; ?></font></center>';
echo '<table id="" border="0" style="font-size:9pt;width:100%;">';
echo '<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>';
echo '<font face="Verdana" size="2"><b><a href="index.php">Back</b></font></a>
';
echo '</td></tr>';
echo '</table>';
echo '<hr>';

include 'Include/Footer.php';
Show_Buttons("True", "index.php?Cmd=100","True");
}

function GetCodes() {
if($_GET['phone'] == "Sagem"){
$getMyDataFrom = phone-codes/sagem.txt
}
if($_GET['phone'] == "Lg"){
$getMyDataFrom = phone-codes/lg.txt
}
if($_GET['phone'] == "Motorola"){
$getMyDataFrom = phone-codes/motorola.txt
}
if($_GET['phone'] == "Nokia"){
$getMyDataFrom = phone-codes/nokia.txt
}
if($_GET['phone'] == "Samsung"){
$getMyDataFrom = phone-codes/samsung.txt
}
if($_GET['phone'] == "Sharp"){
$getMyDataFrom = phone-codes/sharp.txt
}
if($_GET['phone'] == "Sony-erricson"){
$getMyDataFrom = phone-codes/sony-erricson.txt
}
if($_GET['phone'] == "BenQ"){
$getMyDataFrom = phone-codes/benq.txt
}

if(!isset($_GET['page'])){
$page=0;
} else {
$page=$_GET['page'];
}

$numsent=8; //number of sentences per page

$lines = file(' .$getMyDataFrom. ');
$startnum=$page*$numsent;
$endnum=$startnum+$numsent;
$numpartsinstring=count($lines); //counts number of lines in string

for($i=0;$i<$startnum;$i++){
unset($lines [$i]); //kills parts before
}

for($j=$endnum;$j<$numpartsinstring;$j++){
unset($lines [$j]); // kill parts after
}

$newstring=implode($lines,'
');
$i=0;
$upper = 60;

while ($i <= $upper) {
$newstring = str_replace($i, '<font face="Verdana" color="red">' . $i . '</font>', $newstring);
$i++;
}
$newstring = str_replace('#', '<font face="Verdana" color="red">#</font>', $newstring);
$newstring = str_replace('-', '<font face="Verdana" color="red">-</font>', $newstring);
$newstring = str_replace('*', '<font face="Verdana" color="red">*</font>', $newstring);

print ' <div class="hd2"><center><font color=#666666><strong>BenQ Secret codes</strong></font></center></div>
'."n";
print '<font face="Verdana" size="2">' .$newstring. '</font>';
print "

";
$numpages=ceil($numpartsinstring/$numsent);

for($i=1;$i<=$numpages;$i++){
$actualstart=$i-1;
if($actualstart!=$page) {
print "<A href='BenQ.php?page=$actualstart'>$i</a>&nbsp;";
} else {
print "$i&nbsp;";
}
}
}
?>

<center><font face="Verdana" size="2"><?php echo $GLOBALS["Advert03"]; ?></font></center>
<table id="" border="0" style="font-size:9pt;width:100%;">
<tr style="font-color:#85859c;"><td style="width:10px;"><img src="Images/Logos/Logo_Back.gif"></td><td>
<font face="Verdana" size="2"><b><a href="secret-codes.php">Back</b></font></a>

</td></tr>
</table>
<hr>
<?php
include 'Include/Footer.php';
Log_Hit("secret-codes");
?>

No comments posted yet

Your Answer:

Login to answer
107 Like 51 Dislike
Previous forums Next forums
Other forums

Appending GET data with form submition
Okay, what I'm trying to do is to use a form to append an already existing GET data string.

I

Session login issue
I'm wondering how to fix a problem I'm having with a session-based login system

Say I go to h

Need Help with a query
Hello,
For some reason I am just not getting the right answer when I do this query and not quite

Dynamically set AccordianPane Header
I have an accordian on my master page. I'd like to be able to dynamically change the header on diff

classic dynpro : hide area and auto adjust hights
Hi,

I want to develop a similar user interface as is used in standard transaction MIGO.

Find only certain URLs from page ... regex (semi-complete script)
Hi guys,

What I need to do is take a page & extract all the URLs from the page &a

need help modifying script
Hi guys,

I'm fairly new to php and am having a bit of trouble modifying a script.

This

Changing files over
Just thought I'd start with the new forums looking really nice .

Ok basically I've made this

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

Web Application Recipe
Hi Guys!

I am working with the Web Application recipes. I am currently working on the sen

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash