Jump to content

Portwolf

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Portwolf's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok so I am writing a CMS to wrap around a company script I wrote a while back. I am having trouble requesting dynamic form names. Heres the code to generate the input fields: $fields = mysql_result($result,$i,"fields"); $exFields = explode(",", $fields); for($i = 0; $i < count($exFields); $i++){ echo "$exFields[$i] : <input type=\"text\" name=\"$exFields[$i]\"> <br>"; } Ok so it generates the fields the way I want. (design crap will be done later) But I am having issues on processing the form, for example: Fields get generated -> Client Fills them in -> Submitted into our already built function. The function takes those form values and creates an XDF file with the correct requested values. But like I said I am having issues requesting the form values because they wont be static they will differ depending on each PDF. Can anyone point me in the direction on how to get the form values?
  2. Ok to start things off, I am doing a revamp on a custom PHP CMS and the client wants the search function to do the following: Lets say a user searches for "WIX 24061" the current search function will mark that as not found and forward to the notfound page but when i search for "24061" it pulls it up. So what I decided i would do is an explode to a var and use a LIKE SQL query. But it is not working. Heres a snippet of the code that will should be working but its not. $whereExtra = ''; if(!empty($_SESSION['search'])) { if(strpos($_SESSION['search'], ',') !== false) { $parts1 = explode(',', $_SESSION['search']); for($i = 0; $i < count($parts1); $i++){ $whereExtra .= " AND (cp.sku LIKE '%" . $parts1[$i] . "%' OR cp.description LIKE '%" . $parts1[$i] . "%') "; } } else { $whereExtra = " AND (cp.sku LIKE '%" . $_SESSION['search'] . "%' OR cp.description LIKE '%" . $_SESSION['search'] . "%') "; } I have also tried the following: $whereExtra = ''; if(!empty($_SESSION['search'])) { if(strpos($_SESSION['search'], ',') !== false) { $parts1 = explode(',', $_SESSION['search']); foreach($parts1 as $p) $whereExtra .= " AND (cp.sku LIKE '%" . $p . "%' OR cp.description LIKE '%" . $p . "%') "; } else { $whereExtra = " AND (cp.sku LIKE '%" . $_SESSION['search'] . "%' OR cp.description LIKE '%" . $_SESSION['search'] . "%') "; } } Any Ideas?
×
×
  • 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.