Help! :)

R

Rederovski

Guest
ROFL ive wasted about 2 hours trying to sort this for my A level computing project. I eventually decided to try it on some other webspace i have (host.sk) and it works! can you please help! heres a watered down part of it ...

Code:
<?php



if ($submit) {

echo"$as_a";

} else{

  ?>

  <form method="post" action="<?php echo $PHP_SELF?>">

  A:<input type="text" name="as_a">


  <input type="Submit" name="submit" value="Calculate">

  </form>

  <?php

} 

?>

can you please tell me if barrysworld supports $php_self as when i click the "Calculate" button it redirects me to the default barrysworld error 404 page, or if i can change this code so that it will work.

ty in advance.

Originally posted by wyrd_fish
PS in future use "code" tags in stead of "php" tags, those of us with the BW theme can't read functions as hey are green
- your the boss
 
F

FatBusinessman

Guest
Don't you need to enclose $PHP_SELF in an echo() command? Sorry if this isn't the case, my PHP is rather rusty...
 
S

Seyrcim

Guest
Just look at the html source and see what it says $PHP_SELF is pointing to. You don't need any () for echo but you might want to att a space between $PHP_SELF and ?>
 
R

Rederovski

Guest
ill try that but it shouldnt make a difference as the same code works on my host.sk webspace, and the reason i cant use the host.sk webspace for my project is because i need a mysql table.
 
E

evilmonkeh

Guest
maybe is a register_globalsprob?

try $_POST['name'] etcinstead of $name
 
W

wyrd_fish

Guest
<?php echo($PHP_SELF); ?>

try that

edit: alot of servers disable this function for security... sorry


you may just have to create it somehow...
 
R

Rederovski

Guest
how would $php_self be a security risk?

anyway maybe a diff way i can do it..

anyone know the maxlength of a string you can store in a cookie?
 
J

Jonty

Guest
Originally posted by Rederovski
anyone know the maxlength of a string you can store in a cookie?
Hi Rederovski

Just a flying visit :( According to the Netscape Cookie Specification, the maximum size of a cookie is 4Kb (very big, considering).

Netscape Cookie Specification
There are limitations on the number of cookies that a client can store at any one time. This is a specification of the minimum number of cookies that a client should be prepared to receive and store.

  • 300 total cookies
  • 4 kilobytes per cookie, where the name and the OPAQUE_STRING combine to form the 4 kilobyte limit.
  • 20 cookies per server or domain. (note that completely specified hosts and domains are treated as separate entities and have a 20 cookie limitation for each, not combined)
Servers should not expect clients to be able to exceed these limits. When the 300 cookie limit or the 20 cookie per server limit is exceeded, clients should delete the least recently used cookie. When a cookie larger than 4 kilobytes is encountered the cookie should be trimmed to fit, but the name should remain intact as long as it is less than 4 kilobytes.
Kind Regards
 
W

wyrd_fish

Guest
Originally posted by Rederovski
how would $php_self be a security risk?

don't ask me, its just disabled by safe made, witch is default

PS in future use "code" tags in stead of "php" tags, those of us with the BW theme can't read functions as hey are green
 

Users who are viewing this thread

Similar threads

W
Replies
4
Views
872
evilmonkeh
E
P
Replies
3
Views
732
wyrd_fish
W
M
Replies
7
Views
599
Mr. 47
M
R
Replies
11
Views
780
[UKLans]Khan
U
S
Replies
1
Views
508
SilverHood
S
Top Bottom