Jump to content

castis

Members
  • Posts

    23
  • Joined

  • Last visited

About castis

  • Birthday 04/16/1990

Profile Information

  • Gender
    Male
  • Age
    28

castis's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I cant really make too much sense of whats going on in there. What did you want to happen? Also, you don't have to specify byref on objects passed as arguments. Objects in PHP are always passed by reference. You've got a lot of stuff commented out... What were you attempting to do?
  2. btherl, you're the man. the code that works is as follows if you have ?apples=oranges at the end of your page, this will filterGet() will return 'oranges' ZEND_FUNCTION(filterGet) { zval **data; HashTable *arr_hash; HashPosition pointer; int array_count; zval *arr = PG(http_globals)[TRACK_VARS_GET]; arr_hash = Z_ARRVAL_P(arr); array_count = zend_hash_num_elements(arr_hash); for( zend_hash_internal_pointer_reset_ex(arr_hash, &pointer); zend_hash_get_current_data_ex(arr_hash, (void**) &data, &pointer) == SUCCESS; zend_hash_move_forward_ex(arr_hash, &pointer)) { if (Z_TYPE_PP(data) == IS_STRING) { PHPWRITE(Z_STRVAL_PP(data), Z_STRLEN_PP(data)); } return; } RETURN_NULL(); return; }
  3. I'm looking for anything documenting such php_strlcat(), PHPWRITE() and such. Im trying to find out what all the supplied functions do but I have yet to find anything. thanks!
  4. use $_POST['a'.$counterx.$counter] you only want to quote the literal string, not the variables
  5. if you're manually refreshing the page (via F5 and/or the refresh button) its going to keep doing that. thats how browsers work.
  6. put unset($_POST) after the point you no longer need the variable. edit: unless you're manually refreshing the page, in which case... thats kinda the way it works...
  7. you can render an iframe if you want the users browser to access the website but cookies arent transferrable across domains.
  8. what are the contents of your index.php file? also, users dont really like the waiting periods. if you use the header relocation, they're automatically sent to where you want them to go. public function verifyuser() { $this->user = mysql_num_rows($this->query); if ($this->user == 1) { $username = $_SESSION['username']; $_SESSION['user_agent'] = 1; header('location:index.php'); } else { display_denied_login(); } }
  9. move the connection piece above where you get your username and password from $_POST edit: when using mysql_real_escape_string, the mysql extension automatically checks for an open connection, since procedural code goes top to bottom, you're trying to use the function and THEN connect. You need to be connected and THEN use the function. elseif(isset($_POST['submit'])) { $connection = new mysql(); $connection->connect('localhost', 'root', ''); $connection->select('cms'); $username = mysql_real_escape_string($_POST['username']); $password = md5($_POST['password']); $query = "SELECT Username, Password FROM admin WHERE Username = '".mysql_real_escape_string($username)."' AND Password = '".md5($password)."'"; $connection->query($query); $connection->verifyuser(); }
  10. if you have them, check your error logs. Im not sure where they're located on a godaddy setup but your error should definitely be in there. the code you posted doesnt seem to have anything that would cause a server error. what about your other two pages?
  11. I'm doing this in c the code I currently am fiddling with is ZEND_FUNCTION(autopage){ long threadCount = 0; int perPage = 0; int currentPage = 0; /* get and assign arguments */ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lii", &threadCount, &perPage, &currentPage) == FAILURE){ RETURN_STRING("Bad parameters!", true); } long totalPagesDecimal = threadCount/perPage; double totalPages = ceil(totalPagesDecimal); RETURN_DOUBLE(totalPages); } i want to know how to get $_GET directly from the engine while inside an extension.
  12. you want automated? $page = 'Home'; $menu['Home'] = 'index'; $menu['Login'] = 'login'; $menu['Register'] = 'register'; echo "<ul>\n"; foreach ($menu as $key => $value) { echo ($page == $key) ? "\t".'<li><a href="'. $value .'.php" title="'. $key .'" class="current">'. $key .'</a></li>'."\n" : "\t".'<li><a href="'. $value .'.php" title="'. $key .'">'. $key .'</a></li>'."\n"; } echo "</ul>\n";
  13. I have posted my question in the forum you linked to. Thank you. http://www.phpfreaks.com/forums/index.php/topic,232726.0.html
  14. I have an extension that gives you filterGet(), it's being called via filterGet($_GET, [arg, ...]); and i'd like to eliminate the first argument and grab $_GET straight from the engine. How would I go about doing that? Thanks!
×
×
  • 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.