473,320 Members | 1,823 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,320 software developers and data experts.

VAriable not initialized in new version of PHP

Hello,
>From time to time I maintain simple page in PHP for my friend. After
three years I made upgrade to newest PHP on my local PC and links
stopped to work.
This is the only site I use PHP so I`m just casual user of this
language.

Worked before, not working now.
http://someUrl/index.php?content=kurzy

Whole navigation is made by different value of variable content.
Variable is not posted from form. It is just link.

<a href="index.php?content=kurzy">Kurzy</a>

print $content; prints nothing, so it seems that variable is not
initialized. Why? What have changed between versions 4 and 5 of PHP.

Thanks in advance.
Robert

Apr 8 '07 #1
2 1503
ga*****@post.sk wrote in news:1176042537.275827.15330
@y66g2000hsf.googlegroups.com:
>
Worked before, not working now.
http://someUrl/index.php?content=kurzy

Whole navigation is made by different value of variable content.
Variable is not posted from form. It is just link.

<a href="index.php?content=kurzy">Kurzy</a>

print $content; prints nothing, so it seems that variable is not
initialized. Why? What have changed between versions 4 and 5 of PHP.
Regsiter_globals used be enabled by default, it is now disabled. Please
read <http://www.php.net/register_globalsfor more information. This
setting in the php.ini file controls whether variables on the URL, from
POSTed forms, or in COOKIEs were preset. Now you have to retrieve the
values from the particular superglobal array yourself.

$_GET for forms with method="get" and from variables on the URL
$_POST for forms with method=post"
$_COOKIE
$_SERVER
$_SESSION
$_FILES

So in your case, you need to change the code to read

print $_GET['content'];

Ken
Apr 8 '07 #2
Thank you Ken, You helped me a lot. That was the case/

Robert

Apr 8 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Marcin Vorbrodt | last post by:
So I have a class Math that looks like this: Math { public: static Real PI(void); }; Real Math::PI(void) { return 4.0 * atan(1.0); }
6
by: Steve Jorgensen | last post by:
Many of the regulars here have explained that declaring variables using As New .... is a bad idea, and some have given some good explanations, but I wanted add one more demonstration to the mix. ...
3
by: paulw | last post by:
Hi I have a question: main() { static int i; printf("%d\n",i); // should I see see 0 or 5 ??? for (i=5;i<=15;i++) {...} // What's the meaning of static variable in
15
by: Thomas Scheiderich | last post by:
I thought I read that the case for the variable names is important. For example Dim Wheel As Integer Wheel here is a different variable from WHEEL. Is this correct?
23
by: Russ Chinoy | last post by:
Hi, This may be a totally newbie question, but I'm stumped. If I have a function such as: function DoSomething(strVarName) { ..... }
37
by: Joergen Bech | last post by:
(Slightly religious question): Suppose I have the following class: ---snip--- Public Class MyClass Private _MyVariable As Integer Public Property MyVariable() As Integer Get
5
by: chromis | last post by:
Hi there, I've recently been updating a site to use locking on application level variables, and I am trying to use a commonly used method which copies the application struct into the request...
2
by: Kevin | last post by:
I am having difficulty updating a variable page-time-stamp in the following snippit. The variable time-stamp is initialized from the attribute time-stamp from the log element. Some of the page...
2
by: sh.vipin | last post by:
Below is a piece of bit manipulation code. here in function "eval_output_out" there are some macros. Say we have to versions of the same code 1. variable "b" in "eval_output_out" is initialized...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.