Jump to content

onemind

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Posts posted by onemind

  1. Hi,

    I have made a 20 page website that displays my companies online portfolio. It really is just a brochureware site. I have used php include files to include the header and other stuff in a php template system to generate my site layout.

    My question is, would i be better off running my site with php then clicking view source then copy and paste the generated html into html files and just host the html files rather than the php template script? Or is the call to include() so fast that i would hardly notice the difference and just keep the template system?

    Basically, for a small site like this, will the php overhead be worth it or not?

    Thanks for any opinions.
  2. Hi,

    I have used php 4 alot and haven't attempted php5 yet. From what i can tell, not alot of web servers have made the transition and all my clients ask for php unkowingly running a php 4 server so any php 5 stuff wont work for them.

    Is it too soon for php5? When will php5 become mainstream do you think?

    Any insights would be great.

    Thanks :)
  3. Hi,

    Someone asked me to include one of their php files in my code that is hosted on their server. I have done this like so:

    include("http://www.xxx.com/clients/provident/level2/includes.php");

    $info = return_user_info($_COOKIE["provident_email"]);

    echo $info['Last Name'];

    But i get this error: Fatal error: Call to undefined function return_user_info()

    Is this even possible? Or do i need to store that include.php file locally?

    Thanks
  4. Its for bank loan applications.

    They are long forms and need to be split into several forms.

    There are 12 forms for bank accounts and credit cards and they are huge and when split make over 100 seperate forms.

    That webformdesigner actually is quite good for the job and creates standards compliant forms with css and no tables.

    I dont see why people think some programming tools are the devil.

    Personally, i prefer productivity over performance - just makes better business sense.

    But feel free to hand code a job like this using note pad because you are masochistic :p
  5. Hi,

    Not really a php question but was hoping you guys could help me.

    I am looking for a program that lets me design html forms using a wysiwyg editor. Drag and drop kind of thing.

    I can make forms by hand but was hoping there was a program specifically for creating forms visually.

    I dont want a full blown web editor, just one for html forms.

    Any help finding something like this would be greatly appreciated.

    Thanks :)

  6. Hi,
    I have a site where users can upload a logo image for their profile. At the moment, i just upload them to my server and place them in a logos file with each image named the same as their id number.

    This works fine but am beginning to wonder if it would be faster to store all the logos in blob fields in a database. Or would that be slower?

    Any opinions would be greatly appreciated.

    Thanks :)

  7. Hi,

    I have a datetime field in a mysql database and i want to output how many days, hours and minutes are left between the current date and the future date.

    So far i just convert the datettime to a timestamp like so: $start = strtotime($began); 

    Where $began is the current time, basically i just need to know how to convert a timestamp to days, hours ect If i was to minus the current timestamp from the future timestamp.

    Any help would be greatly appreciated.

    Thanks :)
  8. What?

    How will that possibly help?

    Maybe i want clear enough, i have a field in a mysql table of the "text" datatype.

    When i select a text object from the database and output it with php, the whitespace is gone.

    I remember there was a solution to this a while back. A certain php function that adds whitespace back to the original text.

  9. thanks guys,

     

    I am having some trouble using the right sql command.

     

    This is what i have so far:

     

    I send the search string to my script

     

    $words = $_POST[words];

     

    Then i strip non letter and number characters, remove whitespace and seperate each word into an array.

     

    $letters = ereg_replace("[^A-Za-z0-9 ]", "", $words); //removes non letters and numbers

    $keywords = explode(" ", $letters); //seperates into words

     

    foreach($keywords as $key => $value) //removes blanks from array

    {

    if($value == "" || $value == " " || is_null($value))

    {

    unset($keywords[$key]);

    }

    }

     

    This generates a keyword string to use in sql

     

    for($i=0; $i<count($keywords); $i++)

    {

    if($i != (count($keywords)-1))

    $keywords_s .= "'%" . $keywords[$i] . "%'" . " || ";

    else

    $keywords_s .= "'%" . $keywords[$i] . "%'" ;

     

    }

     

    Which creates something like so: '%Search%' || '%for%' || '%this%'

     

    I then plug this into my query like so: $get_username = "SELECT id, dname FROM users WHERE dname LIKE $keywords_s";

     

    And it works fine.

     

    The trouble i am having now is, i cant use multiple WHERE clauses. What i would like to do is the following:

     

    $get_username = "SELECT id, dname FROM users WHERE dname || location || lname LIKE $keywords_s";

     

    But this is invalid sql.

     

    Does anyone know a way to compare my keywords with multiple columns?

     

    Thanks again

  10. Hi,

     

    I have just about finished my site and have many tables filled with users, articles ect and am now trying to implement a search feature.

     

    Basicaly, i have a text box that the user enters keywords they want to search for then they click search.

     

    Is it just a matter of parsing the keywords then performing several select queries on the database or is there a proper way to search mysql databases?

     

    Any tips would be great.

     

    Thanks

     

  11. Hi,

     

    I have what i thought was a simple problem but i cant figure it out.

    All i want to to, is add a value to an in field.

     

    eg

     

    If i had an int field called number and in it was the value 5, what i want to do is add three to it so number becomes 8.

     

    I use the UPDATE method in mysql like so

     

    $sql = mysql_query("UPDATE profiles SET positive=$positive, negative=$negative,neutral=$neutral WHERE id=$to")

     

    this is supposed to add the int value $positive ect to whats already in the positive column but the way i'm doing it now it just replaces whats in the column. So instead of adding 3 like my previous example to make 8, it replaces the 5 with 3.

     

    Hope that makes sense. :)

     

    Thanks for any help :)

×
×
  • 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.