Jump to content

jwwceo

Members
  • Posts

    212
  • Joined

  • Last visited

Posts posted by jwwceo

  1. Hello!

     

    I am trying to make a little widget type script for a sidebar in WordPress. I would like to include a DIV from one server onto another server

     

    the source code is in php however.

     

    Is there anyway to include php code as the source for a snippet of javascript??

     

    James

  2. Hello,

     

    I am trying to use an include function to display a DIV from one server on another on wordpress blogs.

     

    it works great..except that some of the people trying to use the include use widgetized sidebars. The text inside the widgets do not read php, just text and html.

     

    I am wondering of there is another way to include the php file using just html, perhaps javascript.

     

    Thanks in advance!!!

     

    James

  3. Hello,

     

    I am trying to make a widget that bloggers can put in their sidebar with one line of code:

     

    the code is this:

     

    <?php include 'http://www.mysite.com/widget.php'; ?>

     

    I am testing this on my server, and I get the following error:

     

    Any ideas???

     

    Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/liquid/public_html/blog/wp-content/themes/so-simple-100/sidebar.php on line 67
    
    Warning: include(http://www.liquidcotton.com/widget.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/liquid/public_html/blog/wp-content/themes/so-simple-100/sidebar.php on line 67
    
    Warning: include() [function.include]: Failed opening 'http://www.liquidcotton.com/widget.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/liquid/public_html/blog/wp-content/themes/so-simple-100/sidebar.php on line 67

  4. Hello,

     

    I have a query that organizes shirts by a set of criteria which changes based on what the customer clicks, either by score, alphabetical, date, etc.

     

    This works great. But if I have the shirts organized by score and lots of shirts have the same score, then it just seems to pull from the database in the order they were inserted, or by shirt_id. I would like to have some randomness insterted, so any shirt with the highest score, 1 can show up first. So basically, order first by my criteria, and then within that, by randomness. Here is my query so far:

     

     

     

    $data = mysql_query("SELECT * FROM shirts WHERE active='true' AND approved='1' ORDER BY $field $direction LIMIT $from, $max_results") or die(mysql_error());

     

  5. I have two places where valign is not working in IE, within TD's. Once I am trying to align a nested table to the top of a cell, and once I am trying to align an image to bottom of a cell. This seems so basic..it  works great in FF. Any hacks for IE???

     

    James

  6. hmm....I'm not sure I'm 100% clear....my apologies.

     

     

    The votes are just thumbs up (1) or thumbs down(0) and there is a table which stores every vote, with a user id, product_id and the vote.

     

    So I can use something like mysql_fetch_array(SELECT * FROM votes WHERE user_id ='123');

     

    which will give me a big array of data of all that users votes....

     

    but then how do I check each shirt against that...to determine whether to allow his to vote again...that is, how do I use a in_array on a multi-dimension array??

     

    James

     

     

  7. Which function would I use to create the array??

     

    The fields in the Vote table will be vote_id, user_id, product_id, and vote ( either 1 or 0) for yes or no????

     

    This is where I am a little confused...as I need basically a big list of all the items they have already voted on to then use the in-array function on.

     

     

  8. I have a site where I am building a thumbs up/thumbs down voting system. I want users to only be allowed to vote once. So I am requiring that users be logged in to vote. I will then store their votes in the DB and retrieve this data when they return. If they have voted for an item, they will not be allowed to vote for it ever again.

     

    I am just wondering what the best way to approach this is.

     

    I will have their votes stored in the DB. How would I pull all of their votes out, (maybe in an array??) and then compare all the items with this list of "already voted on" items to see if they can vote, or to display their last votes.

     

    I guess I am uncertain which PHP functions to use...both to turn their votes into an array and also to see if a particular item ID is in that array or not.

     

    James

  9. I know header errors are usually caused by outputting before the header command....but I don't have any output...no includes....before the header command. I get an error saying headers already sent on line 6. Any ideas???

     

    <?php
    error_reporting(E_ALL);
    mysql_connect ('localhost','xxxx', 'xx') or die("my sql error");
    mysql_select_db ('lxxxxx');
    
    if(isset($_GET[id])){
    
    $shirtid = $_GET[id];
    $sql="Select * from shirts Where shirt_id='$shirtid'";
    $res=mysql_query($sql);
    $rs=mysql_fetch_assoc($res);
    $link=$rs[link];
    $site_id=$rs[site_id];
    
    if ($site_id == 6){
    $newlink = "http://www.tshirthell.com/store/clicks.php?partner=jwwceo&page=".$link;
    }
    header("Location: $newlink");
    
    }
    
    else {
    header("Location: index.php");
    
    }
    ?>

  10. I have a database with country names in it. This populates a drop down.

     

    I would like the US to show up at the top of this list.

     

    How would I structure a query to ORDER BY "specific country id" AND THEN "alphabetic after that".

     

    Is this possible???

     

    James

  11. Hello,

     

    the following table is driving me nuts...U get a i pixel gap between the rows in ALL browsers and I can't see why. I need the images to line up exactly.  Have never seen this problem before. Any tips??

     

    <table cellspacing='0' cellpadding='0' border='0' width='128' height='55'>
    <tr><td width='95' height='30'><img src='images/connector2.gif'></td>
    <td width='1' height='30'><img src='images/connector3.jpg' width='1' height='30'></td>
    <td width='32'height='30'><img src='images/blackdot.gif' width='32'></td>
    </tr>
    <tr><td width='95' height='25'><img src='images/blackdot.gif' width='25' width='95'></td>
    <td width='1' height='25'><img src='images/connector4.gif' height='25' width='1'></td>
    <td width='32'height='25'><img src='images/blackdot.gif' width='32'  height='25'></td></tr>
    
    </table>

  12. I have a question which Im sure has an easy answer..at least I am thinking it does..

     

    IS it possible to pass a variable upward??

     

    For example, if I have a page with a header template, a content section, and then a footer; how would I use a variable that's in a content page, in the header. My specific problem is that I want to use custom title pages for my site. But the header is always the same. So I was thinking I can just put a title variable ( $title ) in my content section for each page. But how would I pass this info into the header.

     

    I realize I could also write if statements in the header, but how wold the header know which page is being used in the content?? Is there a function to grab the current URL? and then what if that URL is full of Get values??

     

    Any tips would be awesome!!

     

    James

  13. Thanks btherl,

     

    that looks like exactly what I'm trying for... cant seem to get this silly onUnload function to work:

     

    <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF" background="/images/background.gif" onUnload="Open4('/stitching.php')">

     

    ... i hate onunload

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