oni-kun
Members-
Posts
1,984 -
Joined
-
Last visited
-
Days Won
1
Everything posted by oni-kun
-
Yep. You're telling PHP to output an image, yet you're telling it to feed HTML. The browser sees type "image/jpeg" Not text/html!, hense the double error.
-
Yes. Unless you use other means to redirect the user to download from client 1, than you will be transfering the data from client 1 via client 2.
-
You can use regex to find the string "(x.xx seconds)". I'm not good enough with it to tell you the regex though. To open the web page as a string essentially.. you'd use this: $query = "php"; $result = file_get_contents("http://www.google.com/search?q=".urlencode($query)); preg_match(....) //Here
-
You could do something as simple as this with PHP: Name: <input type="text" name="name" value="<?php if (!isset($_POST['name'])){echo "Default";} ?>" /> So if the value of whatever, in my example a POST or SESSION variable.. then it'll echo default text. If this is what you want..
-
Do you literally mean modify the page after output? This is not possible unless you use something such as AJAX, which could fairly easily do what you wish to do.
-
Here is a nice example to show you how to upload a file using PHP: http://www.tizag.com/phpT/fileupload.php From there you should read about security practices involving files and learn how to create a template, specifically creating a database that stores the filenames etc. Some info here: http://www.phpfreaks.com/tutorial/php-basic-database-handling In your upload page you can create some code that creates an entry in your DB with the info and a few details, and it's as easy as calling it from there. And from then on you can use $_GET to allow one page to have different links, so your result will be download.php?id=302940 for example, whatever you create your database ID's as. This is sorta difficult just to warn you so there may be a lot you need to read on. php.net should help with alot!
-
It can be any format I believe, Java is a platform and therefor should provide a nice programming interface save you know how to write/compile it. Here's a sample I quickly found on google. I believe .au is what it saved by default, but it can be easily saved as .mp3. http://javasolution.blogspot.com/2007/04/record-and-save-audio-using-java.html
-
Headers already sent error, even with ob_start();?
oni-kun replied to oni-kun's topic in PHP Coding Help
Oh man I never thought of that! I used a hex editor and found the BOM, I never put two and two together. Safe to say after deleting it, it worked! I think people use headers alot because they're not sure how to redirect? I'm sure not sure how to redirect to another page with PHP.. if it really is possible without output buffering.. Does the job. -
Headers already sent error, even with ob_start();?
oni-kun replied to oni-kun's topic in PHP Coding Help
I double checked. <?php ob_start(); ... At absolute beginning doesn't change it. My site went down to PHP 4.3 for some stupid reason maybe that is why.. Any other thoughts? -
I a long time ago made a simple index for my site that includes the file via $_GET and a switch statement. This one script I have needs it to not be included for certain reasons but redirected. But it's not working.. Is having it nested, or having break; after it the problem?.. "Warning: Cannot modify header information - headers already sent by (output started at /xxxxx/public_html/index.php:1) in /xxxxx/public_html/index.php on line 54" ob_start is at the first position and my code is like this.. (the header() is near the bottom) <?php ob_start(); // Navi system. include('./logger.php'); //simple IP logging $server = $_SERVER['SERVER_NAME']; if (isset($_GET['page'])) { $page = $_GET['page']; if ($page == "") { require('http://'.$server.'/front.php'); } else { switch($page) { case 'home'; require('http://'.$server.'/front.php'); break; case 'contactus'; require('http://'.$server.'/contactus.php'); break; case 'games'; require('http://'.$server.'/games/games.php'); break; case 'downloadgames'; require('http://'.$server.'/games/downloadgames.php'); break; default; require('http://'.$server.'/404.php'); break; } } } else { if (isset($_GET['page']) && !isset($_GET['project'])) { include('http://'.$server.'/front.php'); } elseif (!isset($_GET['page']) && !isset($_GET['project'])) { //if neither are set include('http://'.$server.'/front.php'); } } //proj urls if (isset($_GET['project'])) { $page = $_GET['project']; if ($page == "") { require('http://'.$server.'/front.php'); } else { switch($page) { case 'translate'; require('http://'.$server.'/projects/translator.php'); break; case 'identify'; require('http://'.$server.'/projects/detection.php'); break; case 'trace'; header('Location: http://'.$server.'/projects/trace.php'); //The line with the error.. break; case 'whois'; require('http://'.$server.'/projects/whois_i.php'); break; default; require('http://'.$server.'/404.php'); break; } } } else { if (!isset($_GET['page']) && isset($_GET['project'])) { include('http://'.$server.'/front.php'); } else { //donothing, pass to proj. } } ?>
-
You can use Flash to upload the voice from the mic (Maybe Java be better suited) And manipulate it via php through it storing the file in a database, or Java/Flash directly playing it back. You won't get this done with that goal in mind..
-
If your server is configured to.. you CAN run any program via exec and output it's result, this may be a viable solution.
-
"save as" is the equivalent to viewing the page, except saving it for later. The server cannot divulge the PHP code unless there is a security issue in your code or server which you misconfigured.
-
I'd recommend using a more advanced option such as a Flash client or similar, It is extremely unlikely uploading that sheer amount will happen without error (timeout, etc.). Allow public FTP?..
-
Creating a 'comment' section and Generating Thumbnail from SWF?
oni-kun replied to corrupshun's topic in PHP Coding Help
The GD library can very easily create a thumbnail dynamically in PHP if that is what you want. And a comments system, yes, very simple with the use of a database but i'd recommend following a tutorial. This is because the comments need to be very sanitized to prevent injection into the database, as a lot of comment scripts are prone to.. -
I've been going forever trying to find and stress out about how to fix this, THANK YOU!
-
I do believe that is an IPv6 address. :: is a shortcut to skip blocks that aren't assigned, 1 being the first possible address. Is your server set up to use this, or did you change any settings? EDIT: You're running it from your PC, 127.0.0.1 is localhost AKA ::1 I assume.
-
Using the function stripslashes.
-
I have a very simple system to grab an IP outputted by a PHP file.. (for a project I have) but it outputs a 1 at the end!! <form method="post" action="<?php echo $_SERVER["PHP_SELF"]; ?>"> <font style="color:#333;">IP Address to Analyse:</font> <input type="text" value="<?php echo include('./disp_ip.php'); ?>" size="20" maxlength="20" name="IPaddr"><br /> <input style="color:#333;" type="submit" value="submit" name="submit"> Is the code, note NO 1. Disp_ip.php has this simple code: <?php echo $_SERVER['REMOTE_ADDR']; ?> Yet I get this insanely weird result? <input type="text" name="IPaddr" maxlength="20" size="20" value="64.180.2.2341"/> Where on earth is this 1 coming from? it appears EVERY time I echo disp_ip.php
-
Thanks, it displays the server IP again.. and for some reason the second use of the $ip variable says "1".. It makes absolutely no sense for the life of me, but this resolved what I meant. Thanks.
-
When I include a file the person's IP I echo is the servers, not theirs. So I came up with a solution..: file_get_contents('./disp_ip.php'); disp_ip.php has <?php $ip = $_SERVER['REMOTE_ADDR']; echo $ip; ?> When I view the page it comes up with the PHP code, I made sure the opening/closing tags were right everywhere.. it just makes no sense. Does file_get_contents() when you open a .php file parse PHP code? or just output the result of what it's supposed to show.. (the IP). I'm so confused. EDIT: I get this <font style="font-size: 10px;" face="Verdana">Your IP: <?php $ip = $_SERVER['REMOTE_ADDR']; echo "$ip"; ?></font> When I view my HTML, on my website. Why does it echo it? It echos the code not the result of the code!
-
[nevermind, found the problem]
-
Get the TYPED URL that triggered 404 error
oni-kun replied to pimpjohnson's topic in PHP Coding Help
A custom 404 page ( that you assign through .htaccess ) can use PHP to send the typed URL into a database or whatever you wish. Note that the Apache log will have ALL access, so you can use a parser or a log reading interface to view the pages that 404'd already. -
You can dynamically create iframes of some sort (such as an autosurf). If you have the url in the GET then it'll be somewhat simple to browse the site within a frame.
-
counting specific words in string (reliably)
oni-kun replied to gerkintrigg's topic in PHP Coding Help
Doesn't he mean just to match "[:space:]hear[:space:]" ? That basically is a reliable way, And you'd only need to define a few simple patterns such as (space)hear(?!) etc.