Jump to content

lockdownd7

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

lockdownd7's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That's perfect. Exactly what I needed.
  2. Sorry for the confusion. I should have mentioned earlier that the main point is that I want to mask the link. I've got so much crap I'm working on right now I can't keep it all straight. I'm sorry. *Slams head against wall* Anyway, yes, the html output is being generated with php. But if I just straight link then the destination url will be visible. I'd like to redirect with meta refresh so I can rel nofollow the redirect page and keep serp. However what I'm trying to avoid is having a separate file on the server for each link. Yet in order to make sure the link ultimately goes to the right place I need a way to track where it came from. Also, http_referer won't really work in this case because there are many links on each page. This is a bitch, I know.
  3. Yes, and I know javascript is what would be best for this task but I didn't think it would be a good idea to rely on JS because users can disable it. I guess I worded it very poorly before. I'm trying to make a redirection script that dynamically selects the destination based on the source. In other words, if the link meets certain parameters, it links to one place, if it meets other parameters, it link somewhere else, etc. Preferrably using php because: a) I want it to work for all users b) I have other php scripts I would like it to work with
  4. Hi, I want to use php to do something similar to javascripts onclick function. Basically I don't want to generate the link until a user clicks on it, and depending on what they clicked is what the url will be. My first thought was to have all links go to something like redirect.php, and use a session variable to track which link they had clicked then use metarefresh.... but that won't work unless there's a way to uniquely identify each link.... and I couldn't come up with anything. So if anyone has any suggestions, I'd be very grateful.
  5. I need the scandir() function to return an array that includes actual directory names, instead of something like '.' or '..' . What would be the best way to do that?
  6. You may could use output buffering...
  7. Yep, that was it. Just shows how little I know about SQL.
  8. My apologies. Here is the full error: Fatal error: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't you always thought about hitting upon a hot page about [Keyword]? Are you into' at line 1 in C:\xampp\htdocs\test2.php on line 32
  9. Here's what the relevant section of code looks like: mysql_connect($hostname,$username,$password) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $file = date("m.d.y") . ".txt"; if (file_exists($file)) { $fh = fopen($file, 'r'); $string = fread($fh, filesize($file)); fclose($fh); mysql_query("INSERT INTO table (field1) VALUES('$string') ") or die(mysql_error()); } James, I tried your code and still got the following error: Fatal error: Query failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
  10. Yes, I initially used single quotes, but either way I still get an error. I should probably mention that these strings are unrelated to the database... i.e., I didn't use any mysql query to retrieve them.
  11. I'm trying to write string variables into a table. Something like this: $string = "random string"; $anotherstring = "random string"; mysql_query("INSERT INTO table (field1, field2) VALUES("$string", "$anotherstring") ") or die(mysql_error()); What am I missing? When I run the code, I get an error about MySQL syntax being incorrect.
  12. Exactly what I needed! Thank you very much!
  13. I've got an array of file names like: $array[0] = blah.html $array[1] = blah.jpg $array[2] = blah.txt $array[3] = blah2.txt How would I count the number of times a particular file type appears; i.e. in the above example if I counted the number of .txt files, I'd get two.
  14. Thanks, works great!
  15. The string I'm replacing is a variable itself... how would I represent that with a regex?
×
×
  • 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.