الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

php function !

مغلق
بدأه Mohammad Hussein في 19 فبراير 2006 · 2 رد · 459 مشاهدة · في منتدى تطوير المواقع بـ PHP
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

Hi Ya Shabab..

i make print page for many files

.

What this do, $SCRIPT_URL

i have this Script, i need the path, so what $SCRIPT_URL do?

this is the code........


$mypath = substr($mypath, strlen($mypath));

$mypage = $mypage == "" ? $p : $mypage;
(i understand this line)

windowprops = "top="+height+",left="+width+",resizable=no,width=600,height=500";
window.open("/print.php?pagetoprint=<?=$mypage?>&from=<?=$mypath?>", "Print", windowprops);
$mypath = str_replace("index.php","",$SCRIPT_URL);

-------------------------------------------------------------------------

about the ( print.php ) page:


str_replace("..","",$pagetoprint);
str_replace("..","",$from);

 $file_to_print = $from."/inc/".$pagetoprint.".inc";

if (file_exists($file_to_print))
 include $file_to_print;
 
else
 echo "Error openning files.";
?>
<?

------------------------------------------

i need to have the right path for, $myPage which =

pagetoprint , and $myPath which = $form .

-------------------------------

thanx alot

تم تعديل هذه المشاركة بواسطة shreef في 20 فبراير 2006 في 02:41

#2

الكود دة كوكتيل php على js :D

انا مش فاهم حاجة :lol: هو عموما لو انت عايز الـ relative path

( /test/test1.php )

يبقى استخدم

 $_SERVER['PHP_SELF']

او لو عايز absolute file-system path

c:/www/test/test1.php او home/user/public_http/test/test1.php

يبقى استخدم

__FILE__

معلش جاوبت على قد مفهمت بس لو مش هو دة الى انت عايزه فانا فى انتظار التوضيح إن شاء الله :)

Web Citizen

ShrefInLife.gif

__________

General blog : Shref In Life

#3

hi

what i need to know, is about the $SCRIPT_URL,

and put the quick code, just to see where i used the function.

how ever my thanx,, i solved the problem,

it should $SCRIPT_NAME, function,

the server config support $SCRIPT_NAME, function,

and no $SCRIPT_URL, function.

i got these info from ini file..

thanx alot...

but it's good if u tell us about the paths , relative and base.

thanx again my brother

هذا الموضوع مغلق.

مواضيع مشابهة