I am creating an Ajax/PHP based console-type-thing, where basically the user enters a command at the prompt, it gets sent to a PHP script to get chewed up and processed, and a string of crap comes back out to be displayed.
I would like to know if anyone knows a nifty way in Javascript that I can check if certain flags are present in the return from the server, known as the variable req.responseTex t.
Some examples:...
User Profile
Collapse
Profile Sidebar
Collapse
eragon
Last Activity: Jun 21 '10, 11:15 PM
Joined: Mar 27 '07
Location: US
-
Quite simple. Concentrating strings is easy as smushing them together. As far as splitting them, you can use many options. Here's some examples:
[code=php]
<?php
// First off, we smush $foo and $bar together using a . between them:
$foo = "Hello";
$bar = "World!";
$foobar = $foo.$bar; // Returns: HelloWorld;
$spacebar = $foo.' '.$bar; // Returns: Hello... -
It appears here that functions.php is being included within header.php which is being included after you call your function clean();. Therefore, the function clean(); doesn't actually exist until the body of your page, where you include header.php.
If you want your file to be included regardless of what page you are on, consider instead of a path relative to the document, a path relative to the site's URL, eg:
[code=php]include_once...Leave a comment:
-
Two years it took.
But alas, i have returned.
And by the way, i have a better code.
[CODE=html/javascript]<html>
<head>
<title>Loadin g Screen</title>
<script type="text/javascript">
//Hide the body. See, if you have javascript, it would hide, otherwise, it's visible.
elem3 = document.getEle mentById("bodyd iv");...Leave a comment:
-
thanks for the pointer. i know that, besides, i dont put my finished work up here cause its worse than my handwriting. and thats bad. if i had all my codes given to me i would never be as skilled as i was now.
--------------------------------- Now the how-to: -------------------------------
- Include a text file (named atv.txt for simplicity) this stores the online users.
- check if the array_key_exist s and we use the key
Leave a comment:
-
check into Sajax. i have a script for the frame once you install sajax, so contact me afterwards.
Sajax can be found by google.Leave a comment:
-
Is there an error your getting? And may i suggest, if it works fine for other files, then check your permissions. If theres any more info send it.Leave a comment:
-
not a problem. i use sajax for my most up to date (and most bandwidth stealing) active users monitior. A js in the head of every page calls the php every second and if the php was not called for 3 seconds the user is removed from the list.
I like absolute control over my computer.
And website.
Just wait till i get more than 20 members... my head will break.
and bandwidth limit.Leave a comment:
-
this *could* be implemented into ajax using sajax. If your not sure, look up sajax on google, it is an ajax implementation that calls any php function, and with a little modification to the code, will alllow uploading files without even reloading the page! How did my php work?Leave a comment:
-
the 403 is as i expected. your server is treating the user1.example.c om as an actual subdomain, and anything before your server is handled as part of an actual subdomain, not passed to the page, so im stuck there. and yes, i know, the code is sloppy, all my codes are, but it all works just the same.
have the people in the htaccess forum help you out, tihs goes beyond my knowledge
thank you anyway.Leave a comment:
-
here is the link to the installation page.
maybe this will clairify things
http://player-killer-clan.110mb.com/dsd.php?home.php...Leave a comment:
-
did you get an error from the browser... if so, post it. i'm going to put a seperate page on my website with this script in it to test it. ill post my results and instructions.Leave a comment:
-
Welcome to TSDN. May i suggest changing your line
[PHP]if(!$_POST['send'])[/PHP]
to
[PHP]if(empty($_POST['send']))[/PHP]
The empty command is a more effective command that determines if a string is missing or does not exist.Leave a comment:
-
PHP can not make an alert box, but it can print an error to the page.
are your boxes submitting to an input page, if so i would suggest looking at the php function strlen(). pass both inputs through this, and it its less than what is expected die() your error.
example:
[PHP]$str1 = "Apple";
$str2 = "Banana";
$len1 = strlen($str1);
$len2 = strlen($str2);
...Leave a comment:
-
certainly! This script took a while to get working, so i will help you get it working if some things are different. Here is the first part, the image upload form:
[HTML]<form action="?a=uplo ad" method="post" enctype="multip art/form-data" name="imgForm" id="imgForm">
Choose an Image to upload: <input type="file" name="image" />
<input type="submit"...Leave a comment:
-
i am extremely sorry. i forgot to finish the post
place these codes in the index.php page that you get when you first load your website. Place them at the top of your very first page, and adjust the URLs accordingly.
this way, when the page loads, it checks the URL, and when it sees the subdomain, it will re-direct to the folder with that domain as it's name. if there is no sub domain it keeps you on your home page. ...Leave a comment:
-
nevrer took a code from a website im not supposed to, though i must admit i used some 'other' websites to obtain JS during my learning years, but now i write it myself.
i try to avoid every chance of copyright violation....Leave a comment:
-
i have an insanely long solution, and when i say insanely long i mean it'll take 2 posts to get the whole code in, but most of it is just copy/paste into an include, and the rest is pure genuis.
People can't see server side html, right?
Nor can they see the source for data added AFTEER the page has loaded (Eg: document.getEle mentById.innerH TML="DSFSD";)
So i compiled my brains with ajax and sajax and...Leave a comment:
-
if your using a free server or a basic server the company may heve a permanant upload size that applies to all files goung onto the server. Can you upload this zip through ftp without php or using a file manager from your server company?Leave a comment:
-
[PHP]<? function selfURL() { $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : ""; $protocol = strleft(strtolo wer($_SERVER["SERVER_PROTOCO L"]), "/").$s; $port = ($_SERVER["SERVER_POR T"] == "80") ? "" : (":".$_SERVE R["SERVER_POR T"]); return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];...Leave a comment:
No activity results to display
Show More
Leave a comment: