?
Solved

PHP problem..

Posted on 2004-08-31
8
Medium Priority
?
220 Views
Last Modified: 2008-03-06
ofcourse php..
well. I have the folowing page contruction.
index.php -> on first line it has 'require' for start.inc.php
 I'm trying to use this code:
if (isset($_GET['myNewSize'])){
$newSize = $_GET['myNewSize'];
} else {
$newSize=125;
}
where $newSize located on config.inc.php which is required from start.inc.php 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 config.inc.php.
and when using it in start.inc.php 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: ftp.oris.ws    username :public@oris.ws  password :public  
Thanx .
Ori.
0
Comment
Question by:orik7
[X]
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
8 Comments
 
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.
0
 

Author Comment

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

--?
0
 
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[]
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

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

Author Comment

by:orik7
ID: 11948135
Sorry. used session_start() on start.inc.php 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.
thanx.
0
 
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.
0
 

Author Comment

by:orik7
ID: 11951301
hello.
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)
ori.
0
 
LVL 1

Accepted Solution

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

Computer101
E-E Admin
0

Featured Post

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

801 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