PHP problem..

Posted on 2004-08-31
Last Modified: 2008-03-06
ofcourse php..
well. I have the folowing page contruction.
index.php -> on first line it has 'require' for
 I'm trying to use this code:
if (isset($_GET['myNewSize'])){
$newSize = $_GET['myNewSize'];
} else {
where $newSize located on which is required from after this code
And to the problem : When i'm using this code in the index file $newSize get a value as I wish but has no effect in
and when using it in I alway get 'false'.
So what i'm asking for is something that will combine these two solution that I will get a real value from $newSize and it'll have effect where i need it.

If you like to get these files  - ftp site:    username  password :public  
Thanx .
Question by:orik7
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11948012
Seems like a global problem.
Before using any global variable call session_start()
use $_SESSION[] array instead to pass variables between php files.

Author Comment

ID: 11948045
should it look something like that:
if (isset($_GET['myNewSize'])){
$_SESSION['newSize'] = $_GET['myNewSize'];
} else {

LVL 55

Expert Comment

by:Jaime Olivares
ID: 11948067
Asumming that myNewSize comes from a <FORM> and you want to save this value for many pages to use it, I guess it is OK, don't forget to call session_start() before using $_SESSION[]
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.


Author Comment

ID: 11948082
thanx. will try it.
$myNewSize comes from link but i geuss it's just the same.. right?

Author Comment

ID: 11948135
Sorry. used session_start() on before anything else but I still get flase.
Is there any known limitation on using poseted vars in the required page? 'cause when i use it in index.php where actully it's still located logicly at the same place I get the right value.
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11948146
>Is there any known limitation on using poseted vars in the required page? 'cause when i use it in index.php where actully
> it's still located logicly at the same place I get the right value.
Then assign it to a $_POST variable where you know it has a valid value.

Author Comment

ID: 11951301
well the problem didn't go.
assigning $_post did not help.
as i see it the title of this Q should be now Where is the problem? and how i solve it?
i'm increasing points by 50 and if you like to go dipper you're very welcome and if not then it's o.k. too - i'll leave it open for sometime and see what happens.
thanx either way. (but hope to see you)

Accepted Solution

Computer101 earned 0 total points
ID: 11986715
PAQed, with points refunded (175)

E-E Admin

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question