HighDots Forums  

how to reformat to get proper info into table

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss how to reformat to get proper info into table in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
melissa
 
Posts: n/a

Default how to reformat to get proper info into table - 08-02-2004 , 05:19 PM






I have the following code on my page:

$page = $_SERVER['SCRIPT_FILENAME']; // gets current url

this is part of a INSERT INTO mysql/php script.

when the table gets populated, the entire url string is there:
/home/com/sitename/html/secure/sales2.php

I would like it to read: sales2.php

How would I change the syntax to eliminate all the other information?

thanks!!!!



Reply With Quote
  #2  
Old   
gareth
 
Posts: n/a

Default Re: how to reformat to get proper info into table - 08-02-2004 , 06:45 PM






Use

$_PAGE = $_SERVER['SCRIPT_URL'];

This should give you just the pagename not the full path


--
Gareth
http://www.garethdp.com/
Buzz inet - http://www.buzzinet.co.uk/

Team Macromedia Volunteer for Dreamweaver MX
Dreamweaver MX Support: http://www.dreamweavermxsupport.com/index.php

PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
http://www.dreamweavermxsupport.com/extensions/

Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
Co-Author: Practical Intranet Development - Apress
Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
Co-Author: Dreamweaver MX: PHP Web Development - Wrox



Reply With Quote
  #3  
Old   
melissa
 
Posts: n/a

Default Re: how to reformat to get proper info into table - 08-03-2004 , 09:29 AM



thansk!! that worked to get rid of everything except what comes after the
www.mysite.com.....

so i still get.../secure/sales.php i have been looking for something to
just be that page name....

php.net is mostly down, looking there, but can't see anything that fits.

thanks!!


"gareth" <gareth (AT) buzzinet (DOT) co.uk> wrote

Quote:
Use

$_PAGE = $_SERVER['SCRIPT_URL'];

This should give you just the pagename not the full path


--
Gareth
http://www.garethdp.com/
Buzz inet - http://www.buzzinet.co.uk/

Team Macromedia Volunteer for Dreamweaver MX
Dreamweaver MX Support: http://www.dreamweavermxsupport.com/index.php

PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
http://www.dreamweavermxsupport.com/extensions/

Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
Co-Author: Practical Intranet Development - Apress
Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
Co-Author: Dreamweaver MX: PHP Web Development - Wrox





Reply With Quote
  #4  
Old   
Gary White
 
Posts: n/a

Default Re: how to reformat to get proper info into table - 08-03-2004 , 12:48 PM



"melissa" <melissa (AT) maddesignusa (DOT) com> wrote

Quote:
thansk!! that worked to get rid of everything except what comes after the
www.mysite.com.....

so i still get.../secure/sales.php i have been looking for something to
just be that page name....

If I understand what you're asking, you want it to show only "sales.php",
right? If so:

$_PAGE=basename($_SERVER['SCRIPT_URL']);


Gary




Reply With Quote
  #5  
Old   
gareth
 
Posts: n/a

Default Re: how to reformat to get proper info into table - 08-03-2004 , 02:40 PM



create a new page on your server, and add the following to the page body

<?php phpinfo(); ?>

Then open the page in the same directory as your other page. At the bottom
the server variables are displayed, which can vary between servers, and you
can then pick the appropriate one that does what you want.


--
Gareth
http://www.garethdp.com/
Buzz inet - http://www.buzzinet.co.uk/

Team Macromedia Volunteer for Dreamweaver MX
Dreamweaver MX Support: http://www.dreamweavermxsupport.com/index.php

PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
http://www.dreamweavermxsupport.com/extensions/

Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
Co-Author: Practical Intranet Development - Apress
Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
Co-Author: Dreamweaver MX: PHP Web Development - Wrox



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.