Jump to content

NArc0t1c

Members
  • Posts

    299
  • Joined

  • Last visited

    Never

About NArc0t1c

  • Birthday 04/30/1992

Contact Methods

  • Website URL
    http://www.myspace.com/narc0t1c

Profile Information

  • Gender
    Male
  • Location
    South-Africa

NArc0t1c's Achievements

Member

Member (2/5)

0

Reputation

  1. Bah.. $query = mysql_query($cmd,$c); while($qr = mysql_fetch_assoc($query)) { foreach($qr as $q => $r) { echo "[" . $q . "] => " . $r . "\n"; } echo "\n"; }
  2. You can use the ob_start function in the top of your script to fix header errors.
  3. Try: <?php $str = "from php"; ?> <script> abc = "<?=$str?>" alert(abc); </script> <?php //other code ?>
  4. Hello. I'm trying to make a script that will show all rows and columns in the specific table. It is actually sort of alike a tutorial, to test your mysql queries. I have different about of column's in each table, as well as rows. My question is, how can I Do this, phpMyAdmin has a perfect example of this, but how can I do this? My current scripting for this is the following: $c = mysql_pconnect('localhost','root',''); while($qr = mysql_fetch_assoc(mysql_query($cmd,$c))) { foreach($qr as $q => $r) { echo '[' . $q . '] => ' . $r . '<br>'; } echo "\n"; } The problem with that is, it shows the first row, but repeats in for an infinity. Also please note that it should not use any html elements, because I would like it to be run trough the php executable. The output should be similar to: [id] => 1 [name] => John [last] => Doe [id] => 2 [name] => Jane [last] => Doe Thanks!
  5. I'm currently busy with a project that involves the usage of a graph. I store timestamp in a database, and then work out the average of it, and then with a loop, show the correct amount. It's currently show all as zero, which is incorrect. Here is my script. <?php // create image $image = imagecreate(480,120); // allocate some solors $white = imagecolorallocate($image, 0xFB, 0xFB, 0xFB); $black = imagecolorallocate($image, 0x00, 0x00, 0x00); $gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0); $darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90); $navy = imagecolorallocate($image, 0x00, 0x66, 0xCC); $darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50); $red = imagecolorallocate($image, 0xFF, 0x00, 0x00); $darkred = imagecolorallocate($image, 0x90, 0x00, 0x00); $whites = imagecolorallocate($image, 0x20, 0x28, 0x3E); imagefill($image,0,0,$white); imageline($image,5,105,475,105,$black); $s = 0; $list = 0; $c = 0; $ps = 1; $chars = array(' 1', ' 2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23','24'); for($i=20;$i<=720;$i+=20){ imageline($image,$i,105,$i,115,$black); imagestring($image, 2, $i-15,105,$chars[$c],$black); $c++; $ps++;} function add($s,$num){ global $image, $whites; $num = (100-$num); for($a=$s;$a<$s+10;$a++) imageline($image, $a,104,$a,$num,$whites); } $mc = mysql_connect('127.0.0.1:3306','root',''); mysql_query('USE db'); $id = $_SESSION['login']; $x = 0; for($i=1;$i<=24;$i++) { $qy = mysql_query("SELECT AVG(hour) FROM activity WHERE empid='$id' AND hour='$i'"); add($x+5, mysql_result($qy,0)); $x += 20; } header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?> Thanks in advance. Ferdi
  6. Example: <?php echo 'Curl: ', function_exists('curl_version') ? 'Enabled' : 'Disabled' . '<br /> file_get_contents: ', file_get_contents(__FILE__) ? 'Enabled' : 'Disabled'; ?>
  7. Ahh, Orio beat me to it, here is mine anyway. Well so you want the array in two halves? Try this. <?php $sql = "SELECT * FROM table WHERE var = ".$string.""; $result = mysql_fetch_assoc($obj_db->select($sql)); $number = 0; $first = array(); $end = array(); foreach ($result as $r) { while ($number <= (count($result)/2)) { $number++; $first[] = $r; } while($number > (count($result)/)) { $number++; $end[] = $r; } } ?> I don't know if it will work, but theory is there. (:
  8. Thank you, if I am getting your theory correctly, it should work if I point it to the dll(python24.dll). But it still does not, here is my output for checking. C:\wamp\Apache2\bin>httpd -t httpd: Syntax error on line 117 of C:/wamp/Apache2/conf/httpd.conf: Can't locate API module structur e `python_module' in file C:/wamp/Apache2/bin/python24.dll: No error Thanks. Ferdi
  9. You can disable anyone from viewing the pictures but the server. And then whe nthey actually want to share it, copy the image to another location.
  10. Well, the contents within the file, is what I see when trying to access it. I know it won't work with it commented, I forgot to uncomment it when I uploaded it. Well, I tried the syntax checking with httpd, and here is what I get. C:\wamp\Apache2\bin>httpd -t httpd: Syntax error on line 117 of C:/wamp/Apache2/conf/httpd.conf: Cannot load C:/wamp/Apache2/modu les/mod_python.so into server: The specified procedure could not be found. C:\wamp\Apache2\bin> I read on modpython the website, in their FAQ they said to try and move pythonx.dll out of the windows dictionary, I tried that with no luck. Thanks so var. Ferdi
  11. Hello there, I have recently installed python, Did all the instructions as needed, step by step. I had to rewrite my old httpd.conf, or did I? Well, apache's error log isn't giving much about this, so I cannot get any information on what is causing this. I have tried the config file with the python mod commented, and still nothing. I have meanwhile re-installed apache2, it now works, but it's without the python module. I have tried to edit my httpd.conf file, but still nothing. Here is my config file(httpd.conf). Attachment. Thanks in advance. [attachment deleted by admin]
  12. Hello. Basically what I am trying to do is have a textbox that would have an image in it. I have that part done, but what can I use to move the starting point of the text? Example: ____________ Start Here | This is my current script: <html> <head> <style type="text/css"> body { background-color: #FFF; color: #00; font-family: Tahoma; font-size: 12px; } input { border: solid; border-color: #CCC; border-width: 1px; height: 20px; color: #ccc; } input:focus { border-color: #333; color: #333; } .input_name { background: url(input_name.jpg); background-repeat: no-repeat; } .input_key { background: url(input_key.jpg); background-repeat: no-repeat; }</style> </head> <body> <form> <input type="text" class="input_name"> <input type="text" class="input_key"> </form> </body> </html> Thankyou in advance. Ferdi
  13. Well, I have discovered a good webhost, for dedicated servers. http://www.theplanet.com , they look very good actually.
  14. Well, it depends if the server i'm uploading to supports multiple ftp sessions. if it does, I use 3D-FTP, very fast for uploading small scripts/things. if it does not, then I call upon SmartFtp.
×
×
  • 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.