NArc0t1c
-
Posts
299 -
Joined
-
Last visited
Never
Posts posted by NArc0t1c
-
-
So I have been searching for way's to make life easier for a while now.
I was exploring the smf javascript functions when it hit me, I could make javascript bookmarks to inject text into the posting form, using their javascript functions.
So I made a few bookmarks with the most frequently used things I use on forums, mainly phpfreaks.
Now my question is, what pieces of code do you mostly use on forums, or text?
So we don't have to type things over and over again..
See attachment and convert to html.
[attachment deleted by admin]
-
I beg to differ.
<?php $ip = $_GET['ip']; $file = 'nmap/nmap.exe -O ' . $ip; exec($file, $result); foreach ($result as $array){ echo $array . '<br />'; } ?>
Output:
Starting Nmap 4.11 ( http://www.insecure.org/nmap ) at 2007-08-20 17:29 South Africa Standard Time
Skipping SYN Stealth Scan against 127.0.0.1 because Windows does not support scanning your own machine (localhost) this way.
Skipping OS Scan against 127.0.0.1 because it doesn't work against your own machine (localhost)
All 0 scanned ports on 127.0.0.1 are
Nmap finished: 1 IP address (1 host up) scanned in 26.500 seconds
-
The onclick event handler.
Example:
<a href="javascript:void(0);" onclick="phpfunction()">Click here to execute</a>
-
well, basically what it tells you.
the return function will simply return nothing.
I rather suggest using false or 0.
-
Ok.., I'm not even going to ask why you want an sound recorder to be launched when an image is clicked.
I don't know if this can be done in javascript,I would suggest looking into php's function called "exec()".
-
How do you mean?
On the script where you want to use the user variable use the following,
<?php /* Check for the authenticated session. */ if(isset($_SESSION['authenticated'])){ /* make the user variable. */ $user = $_SESSION['myusername']; } else { /* Echo a 401 error, in this case, echo message */ echo 'You are not authenticated.'; exit; } /* The rest of the script would come here. */ ?>
Edit: Added Comments.
-
uhm, try this following, it has all those grouped as one.
<?php //Engage sesions. session_start(); /* Here we include the mysql connection script. */ include("connection.php"); // Connect to server and select databse. if (!$con) { die('Could not connect: ' . mysql_error()); } else { if (!mysql_select_db($db, $con)){ echo 'Could not connect to database.'; exit; } } if(isset($_POST['Submit'])){ $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; /* Select data from database. */ $sql="SELECT * FROM our_info WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); $count=mysql_num_rows($result); /* If only one occurrence is there. */ if($count==1){ /* Set the myusername sesion to 1 */ $_SESSION['myusername'] = $myusername; $_SESSION['mypassword'] = $mypassword; /* Make an sesion called authenticated to tell main.php that the user is logged in. */ $_SESSION['authenticated'] == 'true'; echo 'Login has succeeded.<br />Click <a href="main.php">here</a> to continue'; exit; } else { echo 'Failed to login.'; exit; } } else { ?> <form action="scripts/login.php" method="post" name="login"> <table width="500" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align="center" valign="middle" class="main"> </td> <td align="center" valign="middle"> </td> </tr> <tr> <td align="center" valign="middle" class="main"><div align="center">Username</div></td> <td align="center" valign="middle"> <div align="center"> <input name="myusername" type="text" class="main" id="myusername" /> </div></td> </tr> <tr> <td align="center" valign="middle" class="main"><div align="center">Password</div></td> <td align="center" valign="middle"><div align="center"> <p> <input name="mypassword" type="password" class="main" id="mypassword" /> </p> </div></td> </tr> <tr> <td align="center" valign="middle"><div align="center"></div></td> <td align="center" valign="middle"><div align="center"></div></td> </tr> <tr> <td colspan="2" align="center" valign="middle"> <div align="center"> <br /> <input type="submit" class="main" name="Submit" value="Log In" /> </div></td> </tr> </table> </form> <?php } ?>
Edit: Please note, I haven't tested this yet.
-
Well, Here's a tip; You will need javascript somewhere along the line, I suggest you learn it.
W3Schools has good tutorials to get you started.
-
You could also try the following,
<?php htmlentities($String, ENT_QUOTES); ?>
-
Why, the javascript example is much faster.
Isn't speed what it is all about at the end of the day?
-
Code Tags: [ code][/ code] or the # button.
Where are you including the sessions script?
-
Firstly, code tags.
If a session is changed it will stay changed on all pages.
-
How do you mean?
the could have a javascript function to log it.
-
On you're webpage, or should it redirect to that website?
if redirect to the other website, try the onclick event handler and javascript.
if you want to display that website on you're webpage, try using iframes or cURL.
-
Well, this won't be able to be done in HTML.
Feel free to check the phpfreaks main site for tutorials on how to make this.
You could also use google.
-
Well, Flash MX or much older than Flash 8.0.
It still has action script 1.0 and doesn't have new efect's such as blur, drop shadow or any special efects.
-
I use echo, except when there are single and double quotes, then I would consider heredoc.
-
-
Yes, usually when I get flash mx source code, it tends to be flash 4.0 or lower.
-
heh, pretty funny.
Luckily I currently run Single 1.0 which works perfectly.
-
I learned php the hard way, I was tossed into the deep side, I had two choices, either swim or sink.
You're question with my answers:
1. What were the most important functions to you in starting with PHP?The session super global.
2. What did your first script have to accomplish?Be able to work after modifications.
3. What would you want a newbie to know?String's, learn it, We all still get people who asks these basic things.
Read, http://php.net/string
-
uh..
$body .= 'From: UserName\n'; $body .= 'ReportedUser: UserName\n'; $body .= 'Message: wewew wewew wewe w wew ew wewe\n'; $body .= '\nLogs: ertert ret ert r et ert er ert er t';
-
Hello there,
I have an ajax login script, My problem is it is always returning the same variable even if the response is incorrect.
I have it posting to a php script that makes use of a php class in another script.
Here is my ajax login, it is two parts, Ajax.js and the actual login form, it is in a php class, i just removed it.
Ajax.php, I think this is fine.
function DoCallback(data) { // branch for native XMLHttpRequest object if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = processReqChange; req.open('POST', url, true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); req.send(data); // branch for IE/Windows ActiveX version } else if (window.ActiveXObject) { req = new ActiveXObject('Microsoft.XMLHTTP') if (req) { req.onreadystatechange = processReqChange; req.open('POST', url, true); req.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); req.send(data); } } } function processReqChange() { // only if req shows 'loaded' if (req.readyState == 4) { // only if 'OK' if (req.status == 200) { eval(what); } else { alert('There was a problem retrieving the XML data:\n' + req.responseText); } } }
And the login form with its javascript, ignore the php $Display variable.
<script> var url = "Login_auth.php"; var what = "LoginStatus(req.responseText)"; function CheckLogin() { document.getElementById("status").className = "login_form"; var username = document.getElementById("username").value; var password = document.getElementById("password").value; document.getElementById("status").innerHTML = "Checking.."; if (!username){ document.getElementById("status").innerHTML = "Username was left empty."; document.getElementById("status").className = "login_form_fail"; } else if (!password){ document.getElementById("status").innerHTML = "No password was given."; document.getElementById("status").className = "login_form_fail"; } else { DoCallback("username="+username+"&password="+password); document.getElementById("status").className = "login_form"; } } function LoginStatus(Status){ document.getElementById("password").value = ""; if(Status == "0") document.getElementById("status").innerHTML = "Invalid Username."; else if(Status == "1") document.getElementById("status").innerHTML = "Invalid Password."; else document.getElementById("status").innerHTML = "Correct."; } </script> <div class="' . $Display .'"> <div id="status" class="login_form"></div> <pre>Username: <input id="username" type="text"><br>Password <input id="password" type="password"><br><br><input type="button" value="Check Login" onClick="CheckLogin()"> </pre> </div>';
I have the script Ajax.js linked in the header script.
I'm also giving the php script Login_auth.php,
<?php include("Classes/Initialize.Class.php"); if (isset($_POST)){ $UserName = $Misc->CleanString($_POST['username']); $UserPassword = $Misc->CleanString($_POST['password']); } elseif (isset($_GET)){ $UserName = $Misc->CleanString($_GET['username']); $UserPassword = $Misc->CleanString($_GET['password']); } else { echo 'Hacking Attempt..'; exit; } $Login->Authenticate($UserName, $UserPassword); ?>
Thanks
Ferdi
-
phpMyAdmin doesn't give me the option of viewing the source code for this operation. The phpfreaks tutorial on this has been removed (http://www.phpfreaks.com/tutorials/114/0.php) and most Google searches eventually lead back too that. Can anyone offer any help?
What I mean is, Get phpmyadmin, and view it's source files(the .php ones)
Run an exe file--
in Javascript Help
Posted
Works on my website aswell, shows ports and operating system.
Still, He said it launches a sound recorder, he didnt say on who's system, now did they?