Jump to content

ohdang888

Members
  • Posts

    1,285
  • Joined

  • Last visited

    Never

Everything posted by ohdang888

  1. two things... 1) put tags around your php code in the code. it helps us. 2) do a print_r($_POST) to see if the post variables are set.
  2. no..... ya its a nice mysql searching feature...read about it here: http://devzone.zend.com/node/view/id/1304
  3. I have a table called "test_table" with a few columns.... id, name, description, author I made name and description FULLTEXT fields so i could use MATCH AGINST searching with them i inserted multiple rows with random content, and one row with a name of php.net and description of "has lots of php stuff" here's my query: $res = mysql_query("SELECT *, MATCH(description, name) AGAINST('php') AS score FROM test_table WHERE MATCH(description, name) AGAINST('php') ORDER BY SCORE DESC")or die(mysql_error()); echo mysql_num_rows($res); theres no errors. And its echoing a zero. Whats up? Any ideas? Thanks.
  4. When i get rid of the height attribute, the div does not show up at all. All the content in the div is still there, but the background/border disappear. It's weird. When i set height:100%, that does nothing either. The height or min-height has to be declared in a set number of px or else it won't show. I am explain good enough? Lol. <style> .main_body { margin-right: auto; margin-left: auto; background-color: #FFFFFF; border: 1px solid #BEBEBE; padding-top: 15px; height:900px; width:900px; } </style> <div class="main_body">the content of the div</div>
  5. i don't understand trying to learn php from a book. Especially the whole "Comeplete Database" stuff. Sure it might have some cool functions in it, but most of those are completely unneeded unless you build the next google or faceook. And anything you need to learn in order to create a functional site is ALL online and pretty easy to find. Not to mention, you can't copy and paste from a book like you can form tutorials.... .... some people might remember it better by typing it themselves, but i can learn it by reading it, so i like the copy and paste function
  6. You may want to look up how a text is actually sent. You can find a list of the carriers and what the address is like for att it is [10 digit number]@txt.att.net you can find this list on the internet by googling. Now, if you want to interact with text's, say have something that receives a text then charge a person for a service like Joke of the day, that is something different. But to simply send a text, you can do that with email. that seems pretty useful.
  7. a few minor revisions to you code: this should do it.. btw, $n looks pointless here, consider deleting it. <?php $n=1; // Start query one and get all the details from held stories $query_one = "SELECT story_id, headline from held_stories"; $result = mysql_query($query_one) OR die(mysql_error()); while ($row = mysql_fetch_array($result)) { $story_id = $row['story_id']; $headline = $row['headline']; //Start the second query to update the new stories with the held stories details $query_two = "UPDATE new_stories SET headline = '$headline' WHERE story_id = '$story_id' "; mysql_query($query_two) OR die(mysql_error()); $n++; } $number_of_results = mysql_num_rows($result); If (mysql_num_rows($result) > 0) { echo "We have updated <b>".$number_of_results."</b> stories in the new_stories database"; } else { echo "No stories have been updated"; } ?>
  8. seriously? WOW i did not know that.
  9. it can't be done with ONLY php. You can use php to interact with an API from a company that does this kind of stuff (like http://eztexting.com/), but other than that, nope. There might be some free API's but i wouldn't use them, as they most likely spam the number too.
  10. don't give up, its very easy once you learn it. i meant the "FROM" clause. You have to have "FROM table name" ater every SELECT, UPDATE or DELETE statement to tell mysql what table to look into.... Have you turned on all errors yet?
  11. you need to define action in the form tag. then you would do something similar to this: function go_there() { var where_to = confirm("Only click ok if you are sure its the item you want to bid on!"); if (where_to == true) { document.bid.submit(); } else { //do nothing } }
  12. You need to set error erporting to all...run this at the top of the script, and upload it... ini_set('display_errors',1); error_reporting(E_ALL); error reporting is obviously not on b/c you have a TON of syntax errors in there. Also, you CANNOT have spaces in variable names in php or mysql.... for instance... "$field name" isn't valid, it must be $field_name try: </h4>There are currently <?php include('connect.php'); mysql_query("UPDATE database name SET field_name=field_name+1"); $sql = mysql_query("SELECT * FROM database name LIMIT 1");//you forgot the FROM clause $row= mysql_fetch_array($sql); $field_name= $row['field_name']; echo $field_name; ?> <span class="c1"> JK's Registered and 54 Attendee's registered<br /> also, you don't use the Database name, you use the Table name...there;s quite a differnce there
  13. Well, mikesta already did it. <?php $sql = mysql_query("SELECT * FROM tablename");//tablename is the table that your data is entered in, in your database if (!$sql){//this simply checks if the mysql query was valid. if not then stop the scrpt echo mysql_error(); exit() } $num = mysql_num_rows($sql);//this is your counter ?> Sorry, but we're not here to write every line of code for you. Go to google, find some good tutorials on the subjects of "basic PHP and MYSQL", and get started from there. Then, once you get errors, post em here, and we'll spot them for ya.
  14. i tried the below code on my server and its working perfectly fine. post ALL your code that has anything to do with this project. Including where you call the function, etc. <script type="text/javascript"> function go_there() { var where_to= confirm("Do you really want to bid?"); if (where_to) { window.location="http://www.google.com/?auction=view&confirm=yes"; } else { window.location="http://www.google.com/?auctions=view&confirm=no"; } } </script> <a href="#" onClick="go_there()">test</a>
  15. Or not ^^ lol it loses the variables it gets when clicking bid when java changes the page i hate javascript ha Isnt there any way to do a confirmation box in just php oO no you're right. do this with javascript: window.location = 'http://www.yoursite.com/index.php?confirmed=yes' and on the index.php get the confirmed from this: $_GET['confirmed']
  16. its probably a setting in your conf file that "prettifies" urls
  17. change the date and see what happens. EPOCH was January 1, 1970. it might have meant -127 second value..which puts it dec 31 1969 in that value...so maybe the negative wasn't being stored. Just try today's date and see what happens...
  18. this mysql_query("INSERT INTO `promocodes` (`id`, `code`, 'info', 'createdby') VALUES ('', '$code', '$info', '$username')") or die (mysql_error()); should be this: mysql_query(" INSERT INTO `promocodes` (`id`, `code`, `info`, `createdby`) VALUES (' ', '$code', '$info', '$username') ") or die (mysql_error()); in other words, to declare something is a column, you put these type of quotes around it: ` to delcare something a value that you are inserting or updating, etc. you use this: '
  19. yes that solves it! thanks!
  20. this is sorta confusing to say, but i gotta try. I have a "brain.php" located in the "folder" include from the root directory. Every file on my server includes this file, and it sets COOKIES of hashed keys to recongize and automatically log in users. When i go to logout.php, located in the root directory, it destorys the cookies. Now they must log in again to be recongized as a logged in user. When i go to logout.php, it successfully destorys my session and cookies, and redirects me to index.php of the root directory. Any file in the root directory says i'm logged out. That's good, that's what i want. BUT, when i go to another directory, like "/testing" or "/beta", which includes the same brain.php file, all files in other directories automatically log me in....in other words, this is my question: It seems as though the cookies of the root directory are just being deleted, even though i am setting the same cookie anywhere. Are cookie's url sensitive? How would i destory all cookies for the entire domain? this is my cookie destorying code: $_SESSION = array(); setcookie("key1", NULL,time() + 1); setcookie("key2", NULL,time() + 1);
  21. In the forum, we pretty much build our own. Wrong site to ask.
  22. because its awesome, but easy to f*** up my page with it if apps use it. I'm trying to figure out how facebook and opensocial do their javascript and css, but its way beyond my level (they add "app_'app_id' " infront of all ids and classes in the html of the app, and add the similar thing to all javscript and css. Its quote confusing to figure out how they do it ) I think i might just use cURL...
  23. well i currently block apps from using javascript so i would perfer another way if possible blah
  24. but this isn't a form users fill out. its an object an a class that sends a request to my API file through get vars, which returns xml, which the apps parses. go its not a form, its more like this $api->updateHTML($code); any ideas? 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.