Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. just download phpMyadmin 2.11.7.1, see if that does it http://sourceforge.net/project/showfiles.php?group_id=23067
  2. do you have a file you can attach, so i can see the input ?
  3. i think the logic your looking for is like so <?php if(strpos($final1, $gs) === true) { $final1 = $final_result; }elseif($pos = strpos($final2, $gs) === true){ $final2 = $final_result; }elseif($pos = strpos($final3, $gs) === true){ $final3 = $final_result; }elseif($pos = strpos($final4, $gs) === true){ $final4 = $final_result; }elseif($pos = strpos($final5, $gs) === true){ $final5 = $final_result; }else{ echo "File too Large!"; } ?> yet i'm sure theirs better ways of doing it using an array for one (depends how your getting the info)
  4. <?php $url = "http://www.towerdefence.net"; if (stristr($url , 'towerdefence.net')) { $check = "yes"; //Added $ and removed a = echo 'yesyesyyes'; }else { $check = "no";//Added $ and removed a = echo 'nonononon'; } //Removed a ; ?>
  5. heres a quick version, may be easier (untested) <?php $file = "test.txt"; $regex = '%\(/\* \$(.*?) : (.*?) \*/\)%si'; $lines = file($file); foreach ($lines as $line_num => $line) { if (preg_match($regex, $line)) { $result = preg_replace($regex, '(\1 : \2)', $line); echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($result) . "<br />\n"; } } ?> Another Version (without line numbers) <?php $file = "test.txt"; $regex = '%\(/\* \$(.*?) : (.*?) \*/\)%si'; $lines = file_get_contents($file); echo preg_replace($regex, '(\1 : \2)', $lines); ?>
  6. read file into a var then use some thing like strstr or preg_match, preg_match_all
  7. Did you restart apache ? (or even the PC)
  8. Change $LOGIN_INFORMATION = array(); while($row=mysql_fetch_assoc($result)){ $LOGIN_INFORMATION=$row['user'].'=>'.$row['pass'].','; } To $LOGIN_INFORMATION = array(); while($row=mysql_fetch_assoc($result)){ $LOGIN_INFORMATION[$row['user']] = $row['pass']; }
  9. Wrong Section.. this is a javascript problem not a PHP one!
  10. your welcome, can you click topic solved, also did you get the PM i sent?
  11. Oh yeah.. i should of said the reason for the problem is due to register globals have been turned off (thank god)
  12. Thats very weird, are you sure the print_r ($id) had the same problem?, is this page live ?
  13. update to <?php if ($username == NULL) { $username = $_COOKIE['usercook']; $password = $_COOKIE['passcook']; } setcookie("usercook", "$username"); setcookie("passcook", "$password"); ?>
  14. Also change this $username = $_POST['username']; $password = $_POST['password']; //@ $db = new mysqli( 'mysql.kdesigns.net', 'username', 'password', 'dbname' ); $link = mysql_connect('localhost', 'root', 'rn2846'); to //@ $db = new mysqli( 'mysql.kdesigns.net', 'username', 'password', 'dbname' ); $link = mysql_connect('localhost', 'root', 'rn2846'); $username = mysql_real_escape_string($_POST['username'], $link); $password = mysql_real_escape_string($_POST['password '], $link); note: i moved the connection above the setting on username and password using mysql_real_escape_string will protect you from SQL injections
  15. my bad change $num_rows = mysql_num_rows($result); to $num_rows = mysql_num_rows($results); missed the s EDIT: as a note, most people use MySQL instead of MySQLI, so any problems with after this one.. will be a useful leason (your need to learn it some time )
  16. Okay.. test 2 let see what we are getting back from the query <?php $count = 0; $query1 = "SELECT * FROM scheduled_events WHERE date != 'title' ORDER BY pos"; $result1= mysql_query($query1) or die("Could not perform query: ".mysql_error()); while ($row1 = mysql_fetch_array($result1)){ echo "#$count#"; //ADD (only to help find it) print_r($row1); //ADD $date[$count] = $row1['date']; $event[$count]= $row1['event']; $pos[$count] = $row1['pos']; $id[$count] = $row1['id']; $count++; $count_max = $count; } ?>
  17. can you try this test Also view source, to get the results (just the array part)
  18. does the link work ? manage_events_edit1.php?id=71 ? if so increase the width of the cells
  19. Your host doesn't have mysqli installed. your need to update it to mysql so <?php session_start( ); // if username and password are set and not empty then proceed with the rest of the process if( isset( $_POST[ 'username' ] ) && isset( $_POST[ 'password' ] ) && $_POST[ 'username' ] != '' && $_POST[ 'password' ] != '' ) { $username = $_POST['username']; $password = $_POST['password']; //@ $db = new mysqli( 'mysql.kdesigns.net', 'username', 'password', 'dbname' ); @ $db = new mysqli( 'localhost', 'root', 'rn2846', 'kdesignsOrion' ); //dbet.valueweb.net if( mysqli_connect_errno( ) ) { echo"Connection to the database failed. Please try again later." ; exit; } //checks for username and password in db table. $results = $db->query( "select * from users where username='" . $username . "' and password = '" . $password . "'" ); //greater than zero if( $results->num_rows > 0 ) { $_SESSION['username'] = $username; //redirect } else { echo 'You must be registered before you may log in.'; } } ?> will be converted to <?php session_start( ); // if username and password are set and not empty then proceed with the rest of the process if( isset( $_POST[ 'username' ] ) && isset( $_POST[ 'password' ] ) && $_POST[ 'username' ] != '' && $_POST[ 'password' ] != '' ) { $username = $_POST['username']; $password = $_POST['password']; //@ $db = new mysqli( 'mysql.kdesigns.net', 'username', 'password', 'dbname' ); $link = mysql_connect('localhost', 'root', 'rn2846'); //dbet.valueweb.net $db_selected = mysql_select_db('kdesignsOrion', $link); if (!$db_selected) { echo"Connection to the database failed. Please try again later." ; exit; } //checks for username and password in db table. $results = mysql_query("select * from users where username='" . $username . "' and password = '" . $password . "'" ,$link); $num_rows = mysql_num_rows($result); //greater than zero if( $num_rows > 0 ) { $_SESSION['username'] = $username; //redirect } else { echo 'You must be registered before you may log in.'; } } ?> **UNTESTED EDIT: also i would like to add is not very secure SQL injection being the first major problem but lets get it connecting first
  20. looks okay.. add this to the end. echo "<pre>"; print_r($id); echo "</pre>"; whats displayed ?
  21. try <?php $page_name = $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; ?> <a href='<? echo $page_name ?>&limit=25'>25 records per page</a> EDIT: i made a dumb mistake!
  22. mysqli connect to mysql, but the it must be enabled create a test page <?php phpinfo(); ?> open it and search for mysqli if you don't see it use mysql instead
  23. Yeah CV, I totally agree that its highly like it due to bad/lazy programming (Pre-OOP code) someone using the mysql to get the users details (whatever). I have see it done before. either way it may explain the logic the programmer guy was using
  24. Okay i used include to add functions to my PHP code but you can also just insert HTML.. for example <font size="2" face="Verdana"> <?php echo "Username: $UserName"; ?> </font> $UserName = "MadTechie"; I am lazy and have a table and want to add it here<?php include "userdetails.php"; ?> and here<?php include "userdetails.php"; ?> etc etc and here<?php include "userdetails.php"; ?> Thats a possible reason.. Just side tracking for a second.. in reply to Darklink post (below) i would like to point out the reason its better to include a CSS file is because when the page loads, it opens 1 connection for each file on the page (but no more than the browser will allow IE6 default is 4), ie CSS/JS/images etc, so if you had one large HTML file with CSS it will be downloaded via 1 connection but if you have HTML & CSS in different files the browser will open 2 connections, that makes downloading quicker but the main reason i find, is that once the files downloaded its cached.. (don't need to download again for awhile) so if you had a CSS file of 2k and 40 html files each using it.. it will only download it once (depending on the clients browser setup) thus saving you 78k (2k x 40)-2k) of downloads. PS this doesn't mean add all your CSS code to one file..
  25. Humm are the permission setting them selfs to nothing and are you using Vista/Longhorn by any chance ? you could try resetting the ACL (access control list) **WARNING** take note of the permissions first.. this may not work icacls c:\path\to\www /grant Users:(CI)(S,WD,AD,X) icacls c:\path\to\www /grant "CREATOR OWNER":(OI)(CI)(IO)(F) Note that CREATOR OWNER is granted ownership icacls info
×
×
  • 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.