');
while ($yarnarray = mysql_fetch_array ($listyarns)) {
printf ('');
printf ('');
$counter++;
if ($counter % 2 == 0) {
printf ("");
$counter = 10;
}
}
And the processing code:
$yarns = "SELECT yarnid FROM yarns";
$yarnidquery = mysql_query ($yarns) or die ("Error at Yarns " . mysql_error() . "\nWhole Query: " . $yarns);
$yarnarraysetup = mysql_fetch_array ($yarnidquery);
$yarnarray = $yarnarraysetup['yarnid'];
while ($yarnidlist = mysql_fetch_array ($yarnidquery)) {
if ($yarnidlist['yarnid'] == $_POST['$yarnarray']) {
//$yarnprice = "INSERT INTO prices (yarnid, storeid, price) VALUES ('$storeidset', $yarnidlist['yarnid'], $_POST['$yarnarray'])";
//$yarnpriceinsert = mysql_query ($yarnprice) or die ("Error at YarnPrice: " . mysql_error() . "\nWhole Query: " . $yarnprice);
}
}
Question 2:
Is there any way to pass variables through an <a href= > tag? I want to set up the ability to browse through stores without having to use all dropdown menus.

Thanks in advance for all of the help.

Source: http://www.livejournal.com/community/php/335388.html

  • please help

    Date: 08/13/05 (PHP Community)    Keywords: php, html, sql

    I tried to add more games to my arcade on my PHPBB board which is a BBace

    I broke it.

    please help. I do not know much about PHP I am still learning.
    Powered by phpBB © 2001, 2002 phpBB Group
    BBaCE © 2004 created by Shariq Najam





    http://www.a-mommys-world.com/phpBB2/activity.php

    An Error Occurred

    DEBUG MODE

    SQL Error : 1054 Unknown column 'game_avail' in 'where clause'

    SELECT * FROM phpbb_ina_games WHERE game_id <> 0 AND game_avail = 1 ORDER BY played DESC LIMIT 0,10

    Line : 123
    File : /home/amommysw/public_html/phpBB2/includes/functions_arcade.php

    Source: http://www.livejournal.com/community/php/335343.html

  • Command Execution Vulnerability in WordPress Affecting all Versions

    Date: 08/13/05 (Java Web)    Keywords: php

    A command execution vulnerability has been found in WordPress's handling of incoming cookie information which allows remote attackers to cause the program to execute arbitrary code if the PHP settings of register_globals has been set to On. Already a perl and php exploit is available. It affects WordPress version 1.5.1.3 and before when register_globals is [...]

    Source: http://blog.taragana.com/index.php/archive/command-execution-vulnerability-in-wordpress-affecting-all-versions/

  • PHP4 OpenID Consumer

    Date: 08/15/05 (PHP Community)    Keywords: php, asp

    I recently saw that '[info]'g0thm0g posted a mention of xajax and its usefulness. Anyone know of a place that's written a PHP4 OpenID consumer using AJAX? I've been looking around and seen implementations in other languages, but no PHP with AJAX. Any aspiring persons want to try it out if it hasn't been done? I was planning on trying out xajax to do it but thought I would check the community to see if there was an existing implementation first.

    Source: http://www.livejournal.com/community/php/336199.html

  • Ressource id #8

    Date: 08/16/05 (PHP Community)    Keywords: php, mysql, database, sql, google

    $query = "SELECT * FROM users WHERE username = '$username' LIMIT 1;";
    $result = mysql_query($query);
    if ($result) { 
     # deny this user // already in
    }
    else { 
     # add new user
    }
    

    $result ouputs "Ressource id #8." I tried different set of variables in case it could be the problem but everything echo with the correct values. What I'm looking for is: check into the database, if there a equal username already registered. Both tries [with an existant and an unexistant username], it returns the same error. I've looked around either google.com and php.net, it turned on hopeless.

    Can you help me out?

    Source: http://www.livejournal.com/community/php/336854.html

  • Working with numbers

    Date: 08/17/05 (PHP Community)    Keywords: php, google

    I've got some code here:

    $number = array(1,1.5,1.75);
    for ($i = 0; $i <= 2; $i++) {
       echo "\$".$number[$i]." ";
    };
    ?>

    which returns "$1 $1.5 $1.75". However, I'd really like it to return "$1.00 $1.50 $1.75" instead. Is there some kind of PHP round function that has it return the trailing zeros in a decimal? I tried searching google, but I wasn't really so sure what to look for. Sorry if this question is way too basic.

    Source: http://www.livejournal.com/community/php/337119.html

  • detecting contents of address bar

    Date: 08/19/05 (PHP Community)    Keywords: php, java

    Is there a way to do that in PHP?

    Here's the situation-
    I have an index file with a php script #included, and I want the script to load files from the directory of the index file. is there a way to do that without passing variables and using GET?

    concisely:
    Is there any PHP equivalent of JavaScript's window.location?

    thank you very much!

    Damon

    Source: http://www.livejournal.com/community/php/337214.html

  • mod_rewrite problem

    Date: 08/20/05 (Apache)    Keywords: php

    Hi everybody! I'm new here and trying to write a mod_rewrite rule. I added the following to httpd.conf:

    RewriteEngine on
    RewriteRule ^/perfumes/([0-9]+)/([A-Zn])/([126])/([0-9]*)$ /items/perfumes.php?product=$1&selection=$2&category=$3&page=$4

    In loading modules above that is:

    LoadModule rewrite_module libexec/mod_rewrite.so

    But, when I try to go to

    http://www.perfumesandpampering.com/perfumes/322/A/2/1

    I get the error "The requested URL /perfumes/322/A/2/1 was not found on this server."

    Any idea what could be causing this problem or do I need to provide more information?

    Source: http://www.livejournal.com/community/apache/25019.html

  • help please!

    Date: 08/20/05 (PHP Community)    Keywords: php, web, hosting, apache

    This is the first time using actual home made php code. I usually would go and just download a script and use it as is. This time using mostly original components of course all source and reference acquired through php.net. Anyways I am having some trouble though. Let me first give you an idea of my directory setup. I have 'web' as my root directory. And I am working in my 'emu' folder. So it all add's up to 'c:/web/emu'. And I am hosting this using apache, and am using a dns redirect service. My url is http://corpsegristle.dynu.com, and I am working on http://corpsegristle.dynu.com/emulation.php. I cannot just put '/emu' as the directory, I have to include '/web/emu' for it to load up the script and find the roms. But the problem relies in it including the "web" in the url. Notice:

    http://corpsegristle.dynu.com/web/emu/a/gen/Aero%20Blasters%20Genesis.rar -bad
    http://corpsegristle.dynu.com/emu/a/gen/Aero%20Blasters%20Genesis.rar -good

    I need to somehow get this to only include "emu" oppose to including the "web" as well. Or maybe I am missing something all together here. I have tried to include the actual url to my site in the directory but that doesn't work. I appologize if this is a "noob" question. Still new to PHP.


    ";


    //lets split it up for the sake of filetype where $ftype[1] will be the filetype
    $ftype=explode(".",$files[$a]);




    // WE GOT A RAR FILE

    if ($ftype[1]=="rar")
    {

    //If its a rar file, the text file trails it, so make the link for it first
    echo "";

    //Increment to the next text file
    $a++;

    //Read it.
    $temp=readfile("$dir\\$files[$a]");


    //Dump it. end the link.
    echo "
    ";

    //Next please.
    $a++;
    }




    //WE GOT A TXT FILE (then a ZIP)

    if ($ftype[1]=="txt")
    {

    //Well obviously, due to the code before, if it wasnt a rar its a txt file preceeding the zip.

    //Increment to link the zip
    $a++;
    echo "
    ";

    //Go back for the text file
    $a--;

    //Read out the text file now
    $temp=readfile("$dir\\$files[$a]");

    //format it
    echo "

    ";


    //Next please.
    $a=$a+2;
    }



    }



    //End meat and potatoes


    ?>

    Source: http://www.livejournal.com/community/php/337883.html

  • Using JavaScript to post XML to PHP

    Date: 08/22/05 (PHP Community)    Keywords: php, xml, java, microsoft

    I've been trying to use JavaScript's XMLHttpRequest object to send XML to a PHP form. As far as sending the XML goes, I've got that worked out:

    try
      {
      var req = new XMLHttpRequest();
      }
    catch(e)
      {
      var req = new ActiveXObject("Microsoft.XMLHTTP");
      }
    
    someXML = "bar";
    
    req.open("POST", "example.php", false);
    req.setRequestHeader("Content-Type", "text/xml");
    req.send(someXML);
    response = req.responseXML;
    What I'm stuck on is how to get the PHP to receive anything in req.send(). The $_POST array only seems to store whatever I put into a query string in my URL, e.g.:
    req.open("POST", "example.php?foo=bar", false);
    req.send('');
    If I have to I guess I can just send my input that way, but I figure there must be some way PHP can recieve XML from a POST request.  Any thoughts?

    Source: http://www.livejournal.com/community/php/338326.html

  • embedding fonts

    Date: 08/22/05 (Web Development)    Keywords: php

    I've been told that it is somewhat tedious, but possible to embed fonts in a php page. So let's pretend that I know nothing about typography and for some god-awful reason I want the text of my page to be rendered in comic sans. None of my users have comic sans on their meachines, though. How would I go about embedding it - both for Mozilla and IE?

    Source: http://www.livejournal.com/community/webdev/237190.html

  • Upload File Code Problems ... Please help

    Date: 08/23/05 (PHP Community)    Keywords: php, web

    Hi, I been trying to write code that uploads files onto a server. I have a folder named "upload" in the same folder with the two files.

    The first file is test.php. Code: test.php
    The second file is getfile.php. Code: getfile.php

    I get this error when I try to upload the file: Parse error: parse error, unexpected '\"' in /Library/WebServer/Documents/wxrats/Website/getfile.php on line 9

    I got the information from: PHP Tutorial
    I also found similar code O'Reilly's PHP Cookbook.

    Ask many friends (online).

    I am desperate and annoyed. IT IS 8 LINES OF FREAKING CODE! =((

    I just need my webpage upload files to a server. if anyone has another solution ... PLEASE HELP!

    ~Kat

    ::EDIT:: I figured it out. There were some invisible characters before the "../upload! Yay for copy and paste evil funtime!

    Source: http://www.livejournal.com/community/php/338850.html

  • Files Changed from WordPress 1.5.1.3 to WordPress 1.5.2

    Date: 08/24/05 (Java Web)    Keywords: php, rss, xml

    After briefly scanning the eleven defects fixed in 1.5.2 (an interim release before WordPress 1.6) I identified the changed files. They are: xmlrpc.php comment-functions.php wp-admin/post.php pluggable-functions.php registration-functions.php wp-admin/categories.php wp-commentsrss2.php wp-includes/template-functions-category.php edit-page-form.php I am shortly planning to provide a patch update from 1.5.1.3 to 1.5.2. Hang on.

    Source: http://blog.taragana.com/index.php/archive/files-changed-from-wordpress-1513-to-wordpress-152/

    1. Frustrated with BBClone and other web trackers....

      Date: 08/09/05 (WebDesign)    Keywords: php, html, web, tracker

      I have tried to get BBClone to work with our (.shtml-page format based) website, and it's proving more and more frustrating than productive. It will be perfect once our redesign is complete and PHP is integrated...but for now, I can't seem to get it working properly.

      Our server has a full-on web tracker program already installed for most tracking needs, but I am in need of a simple program that can track and count hits for a "Top 10 visited stories" feature we need to run & update weekly.

      If anyone has experience in a newspaper/journalism website formats with a program/counter like I am needing...info or help would be much appreciated!

      Source: http://www.livejournal.com/community/webdesign/951346.html

    2. hola once more

      Date: 08/09/05 (PHP Community)    Keywords: php, database

      [Error: Irreparable invalid markup ('') in entry. Owner must fix manually. Raw contents below.]

      php rookie here...with a slight problem.

      Thanks to the tremendous help I received last night...i have mastered creating dynamic dropdown lists and describing database/table contents after they are selected...

      I also know how to delete the tables/databases once they are selected...but now I have another problem...

      once I delete a database using the dropdown menu and submit button, the database does get dropped...but the name of the database stays in the dropdown menu until i refresh the whole page...removing it. Here is my code...

      #connect to mysql

      $conn = mysql_connect( "localhost", "", "" )
      or die( "Am I using the right file?" );
      #define variables

      $result = mysql_list_dbs($conn);
      $self = $_SERVER['PHP_SELF'];
      $schools = $_POST['schools'];
      #list schools

      $form = "
      ";
      $form.="Select School:&nbsp; ";
      $form.="


      ";
      #delete schools

      $sql = "DROP DATABASE $schools";
      if( mysql_query( $sql, $conn ) )
      {
      echo( "$schools successfully deleted" );
      }
      $form.="
      ";
      echo( $form );
      ?>

      is there something that i'm doing wrong or forgetting?
      @xxxxx]::::::::::::::::::::::::::>*

      Source: http://www.livejournal.com/community/php/333205.html

    3. php style switcher tutorial...

      Date: 08/09/05 (WebDesign)    Keywords: php, web

      Someone said they might like to see how to do the PHP Style Switcher, so I finally got around to writing a tutorial. It's here. It was written in a hurry, if anyone has questions, just let me know. To date I've seen 3 website besides my own that use this technique.

      Source: http://www.livejournal.com/community/webdesign/951718.html

    4. The Holy Grail of PHP

      Date: 08/09/05 (PHP Community)    Keywords: php, database, sql, web

      Thought I'd share this with the community. I'll be writing a real walkthrough soon, as this combo is too good to keep to myself.
      Would love to hear any comments, criticisms, or alternatives. If anyone is interested in helping write a few pages on the topic, send me an email or something too.


      What do you get when you combine an automated database object abstraction layer, an embedded templating engine, and an AJAX library?

      Unparalled rapid modular development fusing the web's hottest technologies.
      And it's easy.

      PEAR DB_DataObject
      PHP Smarty
      xajax

      What's it look like? Here's a teenie example.

      index.php

      
      
      
      
      	
      		printJavascript(); ?>
      		Test
      	
      	
      		
      ID:



      ajax.php
      addAssign("content","innerHTML", $v->getNote($id));
      
      	return $objResponse->getXML();
      }
      
      $xajax = new xajax();
      
      $xajax->registerFunction("getNote");
      $xajax->processRequests();
      ?>



      template.php
      template_dir = 'tpl/';
      		$this->compile_dir = 'tpl/comp';
      		$this->config_dir = 'tpl/conf';
      		$this->cache_dir = 'tpl/cache';
      	}
      
      	function getNote($id = null) {
      		$note = DB_DataObject::Factory('notes');
      		$note->get($id);
      		$this->assign('note', $note);
      		return $this->fetch('note.tpl');
      	}
      }
      ?>



      tpl/note.tpl
      {$note->name}
      {$note->body}



      data.php



      schema.sql
      CREATE DATABASE organizer;
      USE organizer;
      
      CREATE TABLE notes (
      	id INT UNSIGNED NOT NULL AUTO_INCREMENT,
      	name VARCHAR(32),
      	body TEXT,
      	PRIMARY KEY(id)
      );




      Source: http://www.livejournal.com/community/php/333380.html

    5. loading descriptions under a full-size image run by JS?

      Date: 08/11/05 (Web Development)    Keywords: php, mysql, sql

      I posted in '[info]'php but no one has given me help yet. I'm x-posting here in hopes there is someone in here that isn't in '[info]'php that can help me. Here's my question.

      Uh... Is it possible to insert some sort of php echo to display descriptions under a picture?

      It's not the same as exif_read_data, because these pictures are my scanned artwork images, not photographs. I have been searching for some sort of script or explanation on how to do this, but can't find it so I'm asking here.

      This is the page in question:
      http://www.luckycatstudio.com/galleries/World/index.php

      The six thumbnails at the top, are scripted in JS for onClick action, on a php page (for php includes and date functions), to load the full sized image below the row of thumbnails. I want to add an area under each full-sized picture that will display a description of what the picture is about each time a picture is clicked on. I'm thinking something in php's echo function. But how would it get the description of the image if not an exif? Save the description in separate individual files? Embed the description in the image in my Photoshop 7's File Info option? Or iPhoto? Use MySql?

      Anyway, I'm fairly sure that there are better PHP codes for onClick loading and displaying full-size images with their descriptions.

      If anyone can help me, I'd greatly appreciate it.

      Thanks.

      Source: http://www.livejournal.com/community/webdev/233503.html

    6. Lockable Login Script

      Date: 08/11/05 (Web Development)    Keywords: php

      I am using the directions here http://www.evolt.org/article/comment/17/60265/ to create a php log in for this survey I am doing. What I need is for at the end of the survey, the last question will be a privacy agreement and something stating that the log in they used will become invalid once they submit. So when they submit the answers, I need to have their username locked. Any ideas?

      Source: http://www.livejournal.com/community/webdev/233461.html

    7. PHP Question

      Date: 08/11/05 (PHP Community)    Keywords: php, mysql, sql

      Uh... Is it possible to insert some sort of php echo to display descriptions under a picture?

      It's not the same as exif_read_data, because these pictures are my scanned artwork images, not photographs. I have been searching for some sort of script or explanation on how to do this, but can't find it so I'm asking here.

      This is the page in question:
      http://www.luckycatstudio.com/galleries/World/index.php

      The six thumbnails at the top, are scripted in JS for onClick action, on a php page (for php includes and date functions), to load the full sized image below the row of thumbnails. I want to add an area under each full-sized picture that will display a description of what the picture is about each time a picture is clicked on. I'm thinking something in php's echo function. But how would it get the description of the image if not an exif? Save the description in separate individual files? Embed the description in the image in my Photoshop 7's File Info option? Or iPhoto? Use MySql?

      Anyway, I'm fairly sure that there are better PHP codes for onClick loading and displaying full-size images with their descriptions.

      If anyone can help me, I'd greatly appreciate it.

      Thanks.

      Source: http://www.livejournal.com/community/php/334132.html

    8. Two Questions

      Date: 08/13/05 (PHP Community)    Keywords: php, mysql, database, sql, web

      [Error: Irreparable invalid markup ('') in entry. Owner must fix manually. Raw contents below.]

      Hi everyone. I am new to the group, and also relatively new to PHP. I have two questions relating to a website that I am setting up. Brief description:
      This is a website that lists reviews of yarn stores. Included in the information that it captures is the price of certain yarns.
      Question 1:
      If I am using an array to call the &lt;input name = xyz&gt;, how do I write my insert statement to use it?
      This is what I have so far, but I am very skeptical that it would work:

      The form code:
      $dbh=mysql_connect ("host", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());
      mysql_select_db ("knittin1_yarnstore");
      $getyarns = "SELECT yarnid, yarnco, yarnname FROM yarns";
      $listyarns = mysql_query ($getyarns) or die ("Error at ListYarns: " . mysql_error() . "\n Whole Query: " . $getyarns);
      $counter = 10;
      printf ('
    ' . $yarnarray['yarnco'] . " " . $yarnarray['yarnname'] . '$
    Previous page  ||  Next page


    antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home