trq
Staff Alumni-
Posts
30,999 -
Joined
-
Last visited
-
Days Won
26
Everything posted by trq
-
This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=340885.0
-
Need help switching from Physical to Virtual Set-up
trq replied to doubledee's topic in Apache HTTP Server
It'll probably become clearer once you have read a few mod-rewrite tutorials. if you have a working url now (even using an id) maybe you should read a few of those now. Once you understand how it all works you can then go and change your script to use title or some other friendlier way of being identified. -
Need help switching from Physical to Virtual Set-up
trq replied to doubledee's topic in Apache HTTP Server
You really are missing massive chunks here. You do. That is exactly what I said to do. I didn't say you would start with a url like that. I said you would start with a url like: /article.php?title=this-is-article-foo Why? Because all mod-rewrite does is matches a pattern in a string and if found, will pass that string to your underlying php page. This means if your script is expecting an id, then your url rule will need to pass that to the script. Meaning you will never be able to use urls such as /creating-tableless-page-layouts.php, you rould need to use something more like /245.php I'm really not sure where you get this stuff from. -
You use == to compare values, not =
-
This is easiest done via bash (which can be executed through php if need be). Something like.... tar zcvf - /www | ssh user@backupserver "cat > /backup/www-bkp.tar.gz" This tars the /www and sends the output directly to stdout which is then piped to ssh and cat'd into the new location.
-
Can you at least post the relevant code that you have tried?
-
Need help switching from Physical to Virtual Set-up
trq replied to doubledee's topic in Apache HTTP Server
The reason you can;t use an id is because there is no way of relating a url like /this-is-article-foo.php with and id. Instead of passing an id you would need to pass the title, making your underlying urls look something like: /article.php?title=this-is-article-foo You can then search the database by title, not id. And indeed, you no longer need your articles directory. You simply use mod-rewrite to make it look like it still exists. the first thing you need to do is get this all in place and working without mod_rewrite. You can then worry about adding your rules to make it look pretty. -
Need help switching from Physical to Virtual Set-up
trq replied to doubledee's topic in Apache HTTP Server
1) As I said earlier, you will need to pass the title of the article not the id. 2) Yes. Each row should have a unique primary key. 3) Yes. 4) Have you looked at any mod_rewrite tutorials. this is a pretty straight forward rule and would be covered in any beginner tutorial. -
word_wrap.
-
include("db.php"); $query = mysql_query("SELECT * FROM data_table"); $id = ""; $result = array(); while($row = mysql_fetch_assoc($query)){ $result[]['id'] = $row['id']; } $JSON_response = json_encode($result); header("Contents: type/json"); echo $JSON_response;
-
if( $r = mysql_query($query1) ) // LOTS AND LOTS OF ROWS RETURNED { $counter = 1; while( $row = mysql_fetch_assoc($r) ) // LOOP { print "Phone - {$row['jloc_phone']}<br/>"; print "This is record number ".$counter."<br/>"; //HOW TO REFENCE MY ROW NUMBER HERE? $counter++; } }
-
You use a simple if statement. example: if ($userismember) { // show this } else { // show that }
-
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=340820.0
-
Trouble parring single quote through post into table
trq replied to pioneerx01's topic in PHP Coding Help
Why? They are essentially the same. There is nothing wrong (syntax wise) with the original code. -
It is not recommended to do that. It actually makes the md5 less secure.
-
Your going to have to start debugging. I'd start by echoing $weapon_name_check and $weapon_name and see if they do indeed contain what you think. How do you even know it's not working? And again I ask, why aren't you doing these checks in a query?
-
Where is $weapon_name defined? Also, why aren't you simply querying the database for this?
-
You really should check your queries succeed of fail (in your code) before proceeding. Anyway, range is a reserved word in mysql. You should change the name of the field to something that isn't reserved, or you can (not recommended) souround the reserved word in `backticks`.
-
Have you done any debugging at all? Your not even checking to see if mysql_query fails or not.
-
Take a look at the rand function.
-
How hard would it be to do? That really depends. This is the kind of thing I could knock together in about 5 - 10 minutes, your time may obviously vary though. As for when I'll be on here, I'm on here quite allot. Though there are many people who could answer your questions.
-
No. As the manual says, it means the full path to the file. And the name of the file.
-
Once again I have had to move one of your threads because it is in the wrong board. Asking for help to search for something is not related to any PHP coding issue.