-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
So adjust your query and do something like you did at the top of your code using a where statement. Are you trying to get us to do it all for you?
-
[SOLVED] Printing a HyperLink including variables?
CroNiX replied to Mike088's topic in PHP Coding Help
you left off the ending escaped quote: print ("<a href=\"http://mysite.com/place/".$page."/blahblah".$text."\">Click Me</a>"); -
Best php method for inserting/updating FORM post
CroNiX replied to acctman's topic in PHP Coding Help
By using UPDATE instead of INSERT of course -
<?php foreach($errors as $message) { echo "$message<br />"; } @lamez - hes not using an associative array...
-
Adding Edit and Delete buttons to table rows
CroNiX replied to jason.watkins's topic in PHP Coding Help
Well, on each row you could have a form with a hidden field containing the ID of the row from the database. Then just have your icons or whatever submit the form. -
Well, you forgot your break statement at the end of each case statement.
-
Well, your select isn't in a form (that I can see from the code you posted) and you need a submit button. Then the person selects the username and clicks submit to send it somewhere for processing. During that processing you select the user info from the db. <form name="myform" action="<?php echo $_SERVER['php_self']; ?>" method="post"> <?php // Connect database mysql_connect("localhost","techker_","o"); mysql_select_db("o_test"); $username = isset($_POST['categoryID']) ? mysql_real_escape_string($_POST['categoryID']) : ""; ?> <select name="categoryID"> <?php $sql = "SELECT name FROM authuser ". "ORDER BY name"; $rs = mysql_query($sql); while($row = mysql_fetch_array($rs)) { echo "<option value=\"".$row['name']."\">".$row['name']."\n "; } ?> </select> <input type="submit" /> </form> <?php if(!empty($username)) { $q = mysql_query("SELECT * FROM `users` WHERE `username`='".$username."'") $r = mysql_fetch_array($q); echo $r['username']; //rest of your user data.... } ?> Didn't test it but hopefully you can see whats going on... Also, if you are selecting the username, Im not sure why you are calling it categoryID in this line: <select name="categoryID">
-
Looks good...this was my favorite part: http://www.webx.nu/video3-2-muppet_show_swedish_chef_making_donut.htm
-
Users cost YouTube $1Million per day in bandwidth
CroNiX replied to dreamwest's topic in Miscellaneous
Naw...google isn't the only search engine out there...if it disappeared people would just use msn, yahoo, askjeeves, or any of the other hundred search engines. The internet functioned just fine before google. Sure, people are just used to the name so thats what most use. It would be great for my business if google died as I would have to redo some clients work that relies on google APIs. Google is just the best at what they do...but I wouldn't say they own the net, no more than I would say Microsoft owns computers. -
Users cost YouTube $1Million per day in bandwidth
CroNiX replied to dreamwest's topic in Miscellaneous
They still have to purchase their bandwidth, just like ISPs, from somewhere. Unless they own their own pipes too... not likely... -
I suppose this is a better question to the w3c then?
-
Inserting an array in javascript? Is this possible?
CroNiX replied to CBR's topic in PHP Coding Help
After you run it, look at the source code via your browser (view source)...what does the code look like in there? -
Inserting an array in javascript? Is this possible?
CroNiX replied to CBR's topic in PHP Coding Help
you need to use php tags to set javascript variables derived from php...you can't just mix them. <?php $myid = 85; ?> <script type="text/javascript"> Event.observe(window, 'load', function() { manualPB2 = new JS_BRAMUS.jsProgressBar( $('element6'), <?php echo $myid; ?>, { barImage : Array( 'images/bramus/percentImage_back4.png', 'images/bramus/percentImage_back3.png', 'images/bramus/percentImage_back2.png', 'images/bramus/percentImage_back1.png' ) } ); }, false); </script> -
How long does it take you to get a result from google? They probably have the largest database in existence. A split second...
-
I can only think of 2 possible problems: 1) if a lot of people are having files 'zipped' at the same time, that could really slow the server down. 2) if a lot of people are downloading their zip packages at the same time, that could really suck your bandwidth. Both really depend on your server and its net connection...But there probably isn't a better way to do it than you are.
-
Sorry, but according to what you wrote it appears that you don't/didn't know php. There are many tutorials that show you how to start step-by-step with easy things like a 'hello world' application. There are also many tutorials if you google for them. 'codeigniter tutorial'. You could have half written an application by now if you did some searching.
-
Normal? I'd say it should be as large as needed to get it to do what you need it to. I've seen larger...
-
if statement and URL passed variable problems
CroNiX replied to Darkmatter5's topic in PHP Coding Help
$field_id==$_GET['cabinet_id']; should be $field_id=$_GET['cabinet_id']; since you are assigning a value and not comparing them there. -
Best php method for inserting/updating FORM post
CroNiX replied to acctman's topic in PHP Coding Help
You mentioned that you are getting all of this data from a user-inputted form, yet I don't where you 1) validate the info or 2) escape the info for proper sql insertion. If you don't do these things, especially #2, people can do some serious damage or get unintended info from your database. Its really a bad idea to put user inputted data straight into the database. Also, if you don't validate the data, like making sure something that is being inserted into a INT column type is really an integer, then you can get errors. You should check if its an INT, and if not redirect back to the form with an error message that the value is the wrong type. -
You should post some more examples of what your variable would be holding... Like: http://www.myexample.com anotherexample.net etc. Are they all the same format?
-
I assumed that you knew the variable you were using...
-
In a word...'yes'. Its like reading a book. If you don't know what the words mean you will not understand what the book is saying. If you don't understand the basics of php, you will not be able to understand or use an API, which is all based on that language. Nothing personal, just the truth. If I sent you a user manual for using an application that was written in a foreign language, would you be able to use the manual to use the application? Its not ridiculous, or 'rediculas' as you say....its just common sense.
-
ajax_do(url_variable); or ajax_do('http://' + url_variable); depending on how your urls are stored...
-
I'm starting a new project soon which involves converting a government database of approx. 2 million records into MySQL for an application. This application will not be used by very many people concurrently and most likely just one person at a time. I understand MySQL can handle this amount of records, but am a little concerned about how it might affect system resources, if at all. I just haven't worked with any record set over 10k entries so I just want to check. The server has 2g ram on a dual xeon 3ghz and is not heavily utilized (the server load rarely goes over .3 according to top). Thanks, CroNiX
-
[SOLVED] stripslashes() vs mysql_real_escape_string()
CroNiX replied to alexweber15's topic in MySQL Help
You use stripslashes if your test for magic_quotes_gpc() is true to undo the magic quotes. Then use mysql_real_escape_string(). something like: <?php function escapeString($string, $dblink) { if(get_magic_quotes_gpc() == 1) { $string=stripslashes($string); } return mysql_real_escape_string($string, $dblink); }