Jump to content

jack2119

New Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

jack2119's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, I'm writing the following data to a text file. "name|price|image|text". The following code does exactly that. $filename = 'test.txt'; // Read file in to array. Each element is a line. $lines = file($filename, FILE_IGNORE_NEW_LINES); $data_to_add = $somecontent; // If the new data does not exist in the array if(!in_array($data_to_add, $lines)) { unset($lines[11]); // delete the 10th line array_unshift($lines, $data_to_add); // Put new data at the front of the array // Write the new array to the file file_put_contents($filename, implode("\n", $lines)); } I'm not sure what I ahve to do to make sure that the arrray only searches the first part of the data which in this case is "name" to make sure only unique data is saved?
  2. Hi, I have used the following code on a .htaccess file and it seems to do the trick for me: RewriteEngine On RewriteRule ^index$ index.php [NC,L] Hope this helps, Jack
  3. Hi everyone, Please bear with me as I try my best to explain the following. I'm working on a shopping script, specifically the search page. Now on this page the user will have several options to refine the products by price, merchant, type, colours etc etc So for example a typical search page will look like domain.com/search/ipad and with additional filters I want it to look like domain.com/search/ipad/price/200-500/ I have managed to do it with one feature however the problem is that are bound to be several types of features a user can use so I need to work on a generic code of some sorts to cover everything. A live website which has something like what I want to do is: http://www.sparsam-kaufer.de/shopping/search/q/laptop/ I've no idea how to tackle this issue as I'm a sort of newbie. Thanks for your advice, Jack
  4. Hi, Thank you very much for your reply, How i want to redirect to different links for example: process.php?retailer=www.url.com Thanks,
  5. Hi, for sometime i have tried to create what this person is doing below with his script, when a user clicks the buy it now button he redirects them to another url. Is it possible to replicate what he has done? I plan using the body onload to redirect the user however im not sure how i can get the url from the url redirected from? If i have not made myself clear please let me know as I'm totally new to PHP. 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.