473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

My PHP website

I built a website using php ... but there is a problem .. the post variable pg is always=='"".. can some one correct the problem(s)?

We do not want an extra load on the server, so I disabled the download link - moderator
Feb 24 '08 #1
10 1267
Markus
6,050 Expert 4TB
I built a website using php ... but there is a problem .. the post variable pg is always=='"".. can some one correct the problem(s)?
Download zip containing source files
It's easier if you post the relevant code, using the code tags in this forum.

Be more clear on your problem, also.
Feb 24 '08 #2
It's too huge to be posted here...
Feb 24 '08 #3
Markus
6,050 Expert 4TB
It's too huge to be posted here...
If so, why do you think people will take the time to look through such a huge zip when you give such a limited question?
Feb 24 '08 #4
ronverdonk
4,258 Expert 4TB
You should be able to show some code, i.e. the form (if there is one) with the 'pg' named field in it, or the url processing code, and the code processing the 'pg'.

And do not forget to show that code within the appropriate code tags!

Ronald
Feb 24 '08 #5
Extra server load ? That file was hosted on my own site ...
any way .. my website , the one which i'm having prolems with is at http://triway.x10hosting.com/ so you can ckeck it out if you want ...
"The Files"(Complete Listing)
---------
index.php
[PHP]<html>
<head>
<title>
<?php
if($_get[pg])
{
echo "Triway Software - " + $_get[pg];
}
else
{
echo "Triway Software - Homepage";
}
?>
</title>
<link rel="stylesheet" type="text/css" href="<?php require 'php/styleget.php'; ?>">
<script language="JavaScript" type="Text/JavaScript">
<!--
function info()
{
}
-->
</script>
</head>
<body>

<span class="head">
<h1>
<?php
if ($_get[pg]!=0)
{
echo "Triway Software - " + $_get[pg];
}
else
{
echo "Triway Software - Homepage";
}
?>
</h1>
</span>

<span class="bar">
<span class="subhead">NaviBar</span>
<hr />
<?php require "php/navgen.php"; ?>

</span>

<span class="main">
<?php
$errurl=substr_count($_get[pg],".");
$errurl=$errurl+substr_count($_get[pg],"/");
$errurl=$errurl+substr_count($_get[pg],"\\");
if ($errurl>0)
{
echo "Terminal error ! V[".errurl."]";
}
else
{
require "php/contentgen.php";
}
?>

</span>

<span class="foot">
&copy; Aviral Dasgupta 2007<?php require "php/infogen.php"; ?>

</span>

</body>
</html>[/PHP]

php/contentgen.php

[PHP]<?php
$path=$_GET["pg"];
if ($path==0)
{
$path="home";
}

if (file_exists("txt/".strtolower($path)))
{

################# File Content Retrieve ################

require "txt/".$path;

}
else
{
echo "Terminal error ! P[".$path."]";
}
?>[/PHP]

I don't think that the rest of the files deserve listing...
Now the problem that I'm having is that visiting http://triway.x10hosting.com/index.p...&style=default
still shows the homepage...and even if pg is set in the URL , the code doesn't have it ...
Feb 26 '08 #6
Markus
6,050 Expert 4TB
Wrap your array indeces in single quotes
and capitalise get
[php]
$_GET['something'];
[/php]
Feb 26 '08 #7
It's still not working... even with the $_get["pg"]s changed to $_GET['PG'].Please ... I really need help.
Feb 26 '08 #8
Markus
6,050 Expert 4TB
It's still not working... even with the $_get["pg"]s changed to $_GET['PG'].Please ... I really need help.
The 'PG' doesn't need to be capitalised.
Feb 26 '08 #9
harshmaul
490 Expert 256MB
Heres the problem what i found.

You are comparing the get value with a number, any string casted to a number returns 0.

So the path is getting set to home.

You need to do something like this......

[PHP]if (IsSet($_GET['pg'])){
//The rest of code goes here
}[/PHP]

Hode that helped!
Feb 26 '08 #10
Thanks ! That did it ! ( That was a hard-to-find-error and I didn't know that "XXX"!=0)
Mar 4 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ohaya | last post by:
Hi, I've been researching this, and I'm not sure if what I'm trying to do is possible, but I thought that I'd ask: I have two webservers/websites. The first webserver/website is running...
3
by: Newbie | last post by:
I have a C# asp.net webform with a Link Button to a website but it's not opening the website correctly. It's saying "The page cannot be found". But the website is loading when I use IE. Below is...
8
by: jacky kwok | last post by:
Dear All: In VS2005 WebSetup installer InstallAddress dialog, there is field to let user to select which website to install the webapp (if there are more than one WebSite in the IIS). I want...
17
by: stubbsie | last post by:
Hi, I have redesigned our official public government website in .net and it has taken me a few months to redo. I have been the sole designer of the website from its humble beginnning a few years...
2
by: crferguson | last post by:
I'm having a really odd issue. Recently my company has upgraded our data server. For a couple of months I'm having to host two versions of the same website on our webserver until the new data...
19
by: cpnet | last post by:
I'm using VS2005, C#, ASP.NET 2.0. I'm trying to create a report using SQL Reporting Services (to be used in local mode so I don't have to deal with SQL Server). When I create a new report in my...
7
by: Atul | last post by:
Hi Theres a website that books hotels . user enters the information and according to that results are displayed to the user.Let it be website A. Now I want to create a new project with...
3
by: Mintyman | last post by:
Hi, I have 2 fields in a database: 'email' and 'website'. In the majority of cases, the website field is not populated even though the email address is. In 90% of cases, the website will be...
5
by: daveh551 | last post by:
What, from a high level point of view, is the difference (in Visual Studio 2005) between Website (accessed with Open Website or Create Website from the StartPage) that is an ASP.NET Website, and a...
2
by: Wayne Smith | last post by:
Applies to: Visual Studio 2008 Professional Hi everyone, I'm in the middle of creating a website with VS2008 and I'm trying to integrate a user registration/login section on the website but I've...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.