Jump to content

jesushax

Members
  • Posts

    498
  • Joined

  • Last visited

    Never

Everything posted by jesushax

  1. how would you do it? thanks
  2. what im trying to do is get the current url and split the url into what i call lvl1 & 2 for example domain.com/business/aboutus.php would return $lvl1 = business $lvl2 = aboutus.php then date level 1 and add the title to all the level 1 pages "domain.com | business" so the page title indicates the users is in the business section then on about us id have in the page title "domain.com | business | about us" you see where im going with it? so im stripping the url and creating a page title depending on which folder, subfolder or page the user is on
  3. ok i did both $url = $_SERVER['REQUEST_URI']; echo $url; list($root, $lvl1, $lvl2) = split('/', $url); the $url; gave me /index.php and the error is still there, what you think it is? i cant think of any other way to debug it :S
  4. ah right i see thanks for taking the time to explain that to me how would i correct the error if the split is less than 2? an if statement?
  5. Hi all, just wondering what this error means and how i can solve it the full error is here and heres the code from titles.php <?php $url = $_SERVER['REQUEST_URI']; list($root, $lvl1, $lvl2) = split('[/]', $url); //front pages if ($lvl1 == "about.php") { $title = 'Domain | About Us';} elseif ($lvl1 == "business_directory.php") { $title = 'Domain | Business Directory';} elseif ($lvl1 == "new_directory") { $title = 'Domain | Business Directory';} elseif ($lvl1 == "business_support.php") { $title = 'Domain | Business Support';} elseif ($lvl1 == "case_studies.php") { $title = 'Domain | Case Studies';} elseif ($lvl1 == "contact.php") { $title = 'Domain | Contact Us';} elseif ($lvl1 == "email_page.php") { $title = 'Domain | Email Page To A Friend';} elseif ($lvl1 == "meet_the_buyer.php") { $title = 'Domain | Meet The Buyer';} elseif ($lvl1 == "work_vine.php") { $title = 'Domain | Work Vine Newsletter';} elseif ($lvl1 == "working_with_developers.php") { $title = 'Domain | Working With Developers';} //sub pages elseif ($lvl1 == "links.php") { $title = 'Domain | Useful Links';} elseif ($lvl1 == "news") { $title = 'Domain | News';} elseif ($lvl1 == "admin") { $title = 'Domain | Staff';} //default else { $title = 'Domain | Business Directory | Business Support';} ?> Thanks for any help
  6. how so i do this? if the database isnt already in UTF-8? what will happen when i transfer it over? also is it the header that outputs the current page on UTF-8? THanks
  7. hi all i have a form, with just a basic text area that when the form is submitted it goes to a mysql database in the form if a user types - (dash) in the mysql db it comes out as — how can i sort this out? i dont mind it being a — but for viewing (meaning echoing the data onto a webpage) how can i turn the — back to a -(dash) thanks
  8. i all what im trying to do is i have a sql query that shows records ordered by their location but what i want to do is when the location changes to have a gap in the table so insert a new row, cant think of how to do it though maybe using a for each statement?
  9. ah right thanks for that info i wanted it to run client side, so i guess thats out the window i think ill just drop the idea and type in the IP for RDP or VNC then, just thought i could save myself 0.5 seconds by not typing lol Thanks though
  10. how would i do it this way? and for the running RDP on click is that likey to work at all?
  11. os would be vista or xp is that a problem that it might be either?
  12. can you show me an example of opening a command prompt via php and ive never created a batch file before so wouldnt know where to start with that :| any hints? Thanks
  13. hi all what i want to do is to be able to launch command prompt from a php link and use data from the link to ping an address so example i click ping(url ping.php?IP=1.1.1.1) this computer command prompt is launched and it pings the the ip cotained in the link, is this possible? i want to launch VNC and RDP from links to if that is possible? THanks
  14. hi all here is my code My UserLevel is Admin yet i cant see those extra li's! anyone know why? <?php echo $_SESSION["UserLevel"]; if ($_SESSION["UserLevel"] == "Admin" || $_SESSION["UserLevel"] == "Editor") { ?> <li><a href="/staff/news/default.php">News / Articles</a></li> <li><a href="/staff/directory/default.php">Business Directory</a></li> <?php } ?> THanks
  15. heres the code $posts = $_POST; unset($posts['ID']); $SQL = "UPDATE cwi_computers SET"; foreach($posts as $key => $value){ $SQL .= " `$key`='$value',"; } $SQL .= rtrim($SQL,","); $SQL .= " WHERE ID='".$_POST["ID"]."'"; echo "<p>".$SQL."</p>"; mysql_query($SQL) or die(mysql_error()); Heres the Output UPDATE cwi_computers SET `ComputerID`='CWR001', `Location`='On & Off All Sites', `ComputerName`='Alex-Laptop', `CurrentIP`='192.168.10.19', `CurrentUser`='Steve Craker', `OperatingSystem`='Windows Vista Business', `Motherboard`='', `Motherboard_URL`='', `CPU`='Inter Centrino Core 2', `CPU_Speed`='2.26', `Core`='x2', `RAM`='3GB', `RAM_URL`='', `HDD`='320GB', `OpticalDrives`='DVD-RW',UPDATE cwi_computers SET `ComputerID`='CWR001', `Location`='On & Off All Sites', `ComputerName`='Alex-Laptop', `CurrentIP`='192.168.10.19', `CurrentUser`='Steve Craker', `OperatingSystem`='Windows Vista Business', `Motherboard`='', `Motherboard_URL`='', `CPU`='Inter Centrino Core 2', `CPU_Speed`='2.26', `Core`='x2', `RAM`='3GB', `RAM_URL`='', `HDD`='320GB', `OpticalDrives`='DVD-RW' WHERE ID='1' You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE cwi_computers SET `ComputerID`='CWR001', `Location`='On & Off All Sites',' at line 1 ive just noticed that the echo of the statement shows that its posting the results twice anyone know why? Cheers
  16. oh right... so i create ahyperlink to the force download page and that will open the file i want it too what do i edit to make it choose the right file, i can see something commented out but i don tknow what that means <?php // force to download a file // ex, ( [url=http://localhost/php/download.php?file=C:/Apache]http://localhost/php/download.php?file=C:/Apache[/url] Group/Apache2/hongkong.php ) // hope this can save your time :-) $file = $_REQUEST['file']; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header( "Content-Disposition: attachment; filename=".basename($file)); header( "Content-Description: File Transfer"); @readfile($file); ?>
  17. getting what? i just want to know where i can get the script to reference a file outside of the root? i dont understand what you mean... :S
  18. what script shall i google for? Thanks
  19. the force downloads script? http://www.phpfreaks.com/forums/index.php/topic,95433.0.html i dont want to force a download i need to know how to reference a folder out of the root directory Cheers
  20. no no not the login script i wrote my own for that, i fairly proficent with php i mean the script call a file from the folder outside of my root cheers
  21. ive emailed my host, hopeully theyll get a folder set up for me regards to the script for logged in users what would this look like? Cheers
  22. i dont think i can do that, im not in control of our web host :|
  23. no i dont want to force them to download i want to stop anonymous users from typing in a file path and being able to download a file if they are a registered users they can click downloads then it will work so if someone typed in the url www.site.com/downloads/videos/thisvideo.mpg it would say not allowed your not a member but if you went to www.site.com logged into members area then clicked downloads > videos > thisvideo.mpg they would e allowed Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.