Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Populating An Auto_increament Attribute


I have just designed a BD. there are companies with auto increament which are integer. When I try to populate it after i tool value from another form and try to insert it into a table i recieve an error! I don't ask the companyID value from user as it is auto increament. Don't tell me to put NULL for that entry as it didn't work as well! Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Getting URL Attribute
Ass you have already guessed by my questions im not a PHP expert. Basically my two questions are. im linking to a page

talk.php?id=12

How can i get the attribute from the URL in my PHP page? and also im getting a date string from the database which look like this 1147517086 Is there any method that can format this datestamp into English?

View Replies !
Get Attribute Value From An XML Tag
how do i get the attribute "href" value using the following script ? Code:

View Replies !
XML - Sorting By Attribute
I'm not sure whether this is a question about php or xml or what to be honest - a poke in the right direction would be much appreciated...

I'm storing news articles in XML format.

newsitems.php which contains the XML looks like this; ....

View Replies !
Attribute Is Bool, Int, Etc.
I am trying to document a class attribute in this format:

Attribute: Description (data type : default value)

Example:

$displayTableHeader = TRUE;

So I want to know if this is int, bool, etc.:

$displayTableHeader = Creates table heading for display function tables (int: TRUE)
OR
$displayTableHeader = Creates table heading for display function tables (bool: TRUE)


View Replies !
Checkbox Name Attribute
I have a question. I have 3 checkboxes, but if I check checkbox1, and checkbox2 together, it saves only checkbox2 to the mysql database. Those checkboxes' name attribute are the same. Is there a way to prevent this? because one of my field names in the table is the same as the name attribute.

View Replies !
Soap Xml Attribute
why it's so really difficult to set xml attributes in a soap request using php? I'm troubled with this: I'm searching and trying but I'm able to generate a request like the following with Nusoap only:

<auth><user id="id" password="password" /></auth>

View Replies !
Domxml_new_doc - Can I Add Encoding Attribute?
I've got a question about adding encoding attribute to my DOM XML Document?

I'm from Poland and we use extended latin alphabet - I'd like to use
iso-8859-2 Polish charset

e.g.:
<?xml version="1.0" encoding="iso-8859-2"?>

is there such posibility in DOM XML?

View Replies !
LDAP And TelephoneNumber Attribute
Anyone have a problem with PHP returning the telephoneNumber attribute empty while all the other attributes return just fine. Someone had the same exact problem on phpbuilder but it was never solved. Apparently it holds true for facsimileTelephoneNumber also. Any ideas?

View Replies !
A '<' Character Cannot Be Used In Attribute 'href', Except Through <[xml]
The following embedded snip it of PHP code won't validate using xhtml 1.0 strict. When validating I get the following error:

A '<' character cannot be used in attribute 'href', except through <[xml] Code:

href="/_Director/forms.php? <?PHP create_request_query('AskQuestions', 'AskQuestions'); ?>" Any idea what's wrong?

View Replies !
SimpleXML Parsing By Attribute Value
I have an existing XML data set and would like to parse it with PHP5 based on the value of an attribute (any attribute!). I don't want to convert all my data from an attribute-heavy structure to a more proper element-based structure if I don't have to because of the javascript I am using on the client side. Listed below is the XML structure and PHP code I have been testing.

My existing data structure looks like this:
<gallery>
<photos>
<photo
path = "sunflower01.jpg"
width = "500"
height = "375"
thumbpath = "sunflower01.jpg"
thumbwidth = "125"
thumbheight = "94">
</photo>
</photos>
</gallery>

The script is here:

<?php
$xml = simplexml_load_file("pictures.xml");
$image = $xml->xpath("/gallery/photos/photo[@path='sunflower01.jpg']");
echo $image[0]->photo@thumbpath;
?>

View Replies !
Reading Lastchild Attribute In XML?
I have this code:

<root>
<news>
<item id="1" headline="I am a headline">
<item id="2" headline="I am also a headline">
<item id="3" headline="again, I'm a headline">
</news>
</root>


I want to use DOM to read the id-attribute of the last child. I want to do kind of this:

$id = $dom->documentElement->getElementsByTagName('news')->lastChild->getAttribute("id");

It doesn't work... How do I do that?

View Replies !
Random Attribute Change
is it possible with php to change a file's attribute randomly between 2 dates? For instance, get a date between 01-01-2007 and 17-07-2007 and use that date to change a file's creation date? If it's possible it would be great in a batch ofcourse, like batching an entire folder, changing attributes of 1000 files by hand is quite difficult.

View Replies !
Calendar - Attribute Eventday
i've been trying to modify a already done calendar, what im trying to do is getting dates where there are an event to get an backgroundcolor.

The problem is that it does work... but if i set an event on 23' of feb i get a backgroundcolor there, which all 23' in every month get Code:

View Replies !
Allows Someone To Change The Given Attribute Via A Pick-list
I have a form that lists query results (members, attributes) side by side, and allows someone to change the given attribute via a pick-list. I'd like to know how all of the member attributes (one for each member listed in the query results) can be updated at once. I have no problem implementing this when just one record is being updated, but as soon as there is more than one record I get into trouble. Here's a little diagram of what I'm trying to do:

------------------------------------------
Name | Attribute
------------------------------------------
Member1 | Pick List
Member2 | Pick List
Member3 | Pick List
" etc " | " etc "
------------------------------------------

| Update |

View Replies !
Counting Items In An Array Having X Attribute
I want to randomly select 5 cards from a standard playing card deck and count how many of each suit are returned:

[connect]
$sql = "SELECT * FROM cards ORDER BY RAND()LIMIT 5";
$result = mysql_query($sql);
while($cards = mysql_fetch_array($result)) {

$value = $cards["card_value"];
$suit = $cards["card_suit"];
$image = $cards["card_image"];
--------

Using count() within the loop returns a count of 1 since each card can only be of one suit. I tried using something like this:

$spades = 0;
if($suit='spades') {
$spades = $spades+1;
}

and I tried a foreach statement to count within the loop which always returns a count of 1.

Would someone be so kind as to point me in the right direction?

View Replies !
Sort A Group Of Nodes By Attribute? How?
I have the following XML file:

<?xml version="1.0" encoding="iso-8859-1"?>
<items>
<item line="2">all that glitters is gold,</item>
<item line="1">Theres a lady thats sure,</item>
<item line="3">and she's buying a stairway to heaven</item>
</items>

To output this code Im using the following PHP:

$xmldoc = domxml_open_file('stairway.xml',
DOMXML_LOAD_DONT_KEEP_BLANKS);
$node = $xmldoc->document_element();
if ($xmldoc->has_child_nodes()) {
$node = $node->first_child();
$endwhile = false;
while ($endwhile != true) {
echo $node->get_content() . "<br />";
if ($node->next_sibling()) {
$node = $node->next_sibling();
}else{
$endwhile = true;
}
}
}

This does what it supposed to do except I want to ensure that it
outputs nodes ordered by 'line' attribute. The obvious answer would be
to put them in order in the XML file and the above example is very
simple so that you get the point, the real life example however will be
much larger and encase anyone put something in the wrong order it would
muck up my presentation. How could I adapt my code above to allow my
nodes to be sorted? I dont mind the nodes being out of order in the
physical file (stairway.xml) but when they are output using my script,
I want them to be ordered.

View Replies !
Accept Form Attribute Not Working
I cannot get my accept attribute working properly inside either my form, or my input tag. W3schools says that accept is supposed to go inside the input tag, but msdn says it goes in the form tag. I need it for an upload form I'm making, I want to only allow application/octet-stream type files, so I put this as my opening form tag:

<form enctype="multipart/form-data" accept="application/octet-stream" action="{$_SERVER['PHP_SELF']}" method="POST">

But I can still upload music, text files, and movies.  What gives?

View Replies !
How To Remove $_server['server_name'] From A Img Src Attribute?
does anyone no how to remove an $_server['server_name'] from a given image url. For example I have a image that have a src as "http://www.domain.com/images/aa.jpg".

I want to remove the $_server['server_name'] from that src trribute so i can have the output as "images/aa.jpg".

View Replies !
Altering LDAP Memberof Attribute
I have been using PHP's LDAP protocal to access Active Directory in my company. Authentication, search, and attribute editing have been working great for some time. Recently, I've been assigned to update our online AD manager to include membership altering - the "memberof" attribute.

The user I use for working with LDAP is an admin, so it has full permissions.

Adding a user with with ldap_add() an array like this work fine: .....

View Replies !
Tag Or Attribute For Correct Image Size
I have a php-generated webpage with images. My problem is: the Internet Explorer cannot calculate the correct image size. Because of this the images are not cached. So everytime a user clicks on some link all the images gets retransfered and the page loads very slow. You can check it if you right-click on an image and select properties. Is there a possibility to send the image and its actual size-information to the browser?

View Replies !
Target Attribute Picked Up On End Of Get Querystring
Can anyone see anything wrong with this PHP code:

echo "<td width=&#3932;'><a href='download.php?filename=".$FileDownload."&type=".$type." target = 'iframedownload' class='main'>Download</a>&#160</td>";

When I click this the querystring appears to have the HTML target attribute in it, whioch it shouldn't because this is needed to load the page into the iframe.

View Replies !
Viewing Data Based On Attribute Value ?
The scores table has an attribute named "APPROVED" which data type is boolean (true/false)

Can someone give me an idea on how to make grades data viewable ONLY IF the value on this column is set to TRUE

Another question ? what is the datatype in MySQL equivalent to (true/false) in Access ( note : i'm using PHPMyAdmin ) and how true and false values are represented ?

View Replies !
Locating A Node's Text Value By Tag Name Or Attribute
I dont normally use DOM XML but have been given the task of
integrating it with a web site using PHP. I have to use DOM XML as
this is what is provided by the server.

Basically what I am tryin to do is get it to load an XML document
(that I can do) and find a specific node by its id attribute. The code
I am up to is: Code:

View Replies !
Validation Problem - Get The Content-type Attribute
UPDATE: my page will validate, but it doesn't seem to be able to get the content-type attribute from my php page. any idea how to do that? again MANY thanks in advance.

View Replies !
After I Load An XML File, Can I Sort It By Node Attribute
After loading an xml file, is it possible to sort it by attribute?

For example, I have the following xml file:

<xml...
<diary>
<entry date="2005-01-01">I went to the park</entry>
<entry date="2005-01-03">Sold the car today</entry>
<entry date="2005-01-02">Went for a stroll</entry>
</diary>

When I go to load this using PHP, I would use some this similar to
this:

$xmldoc = domxml_open_file('diary.xml', DOMXML_LOAD_DONT_KEEP_BLANKS);

$node = $xmldoc->document_element();

Before I go storming through the xml tree outputing along the way, can
I sort it by (in this case) date?

View Replies !
Warning: Ldap_get_values_len(): Cannot Get The Value(s) Of Attribute Decoding Error
Any idea why Im i getting this error

Warning: ldap_get_values_len(): Cannot get the value(s) of attribute
Decoding error in ...

Im trying to read logonhours attribute of a user in Active Directory
(AD) using ldap.

View Replies !
Php-4.4.0 And Test.wsf = Error: The Value For The Attribute Is Not Valid: Language
We need to use version php-4.4.0-Win32 because one of the portal software
doesn't support version php-5.0.5-Win32. We cannot get the PHP setup part
working. Here is the error message:

Windows Script Host

Script: C:kits est.wsf
Line: 3
Char: 11
Error: The value for the attribute is not valid: language
Code: 80040049
Source: Windows Script Host

Here is the code from the install.txt

To test if ActiveScript is working, create a new file, named test.wsf (the
extension is very important) and type:

<job id="test">

<script language="PHPScript">
$WScript->Echo("Hello World!");
</script>

</job>

Save and double-click on the file. If you receive a little window saying
"Hello World!" you're done.

Everything works fine using php-5.0.5-Win32.

View Replies !
Multiple Form Attribute Not Working. Sugestions?
OK here is a table and the corasponing code. If you notice some of the drop down form feilds have "multiple="multiple" as an attribute. For some reason I can't select more than one option. I need to be able to select multiple options. Code:

View Replies !
Simplexml And Attributes With A Namespace In Front. How Do You Getthe Attribute?
Here's a bit of xml code that works.

<?php

$string =
"<?xml version="1.0" standalone="yes"?>
<world>
<people xmlns:ss="http://crap">
<person id="5">John Doe</person>
<person id="2">Susie Q. Public</person>
</people>
</world>";

$xml = simplexml_load_string($string);
print "<pre>";
print_r($xml);
print "</pre>";

foreach($xml->people->person as $p)
foreach($p->attributes() as $a =$b)
{
print "$a =$b<br />";
}

// prints out
// id =5
// id =2
?>

Now what if I change the first person to this
<person ss:id="5">John Doe</person>

Anyone know how to get the id?

This is a question that is pertinent to an excel .xml file as
you'll get lines like this
<Cell ss:Index="3">stuff</Cell>

btw: there is a guide on ibm that tells you how to do this with php
and dom. I'm just wondering if there's a way to do it with simplexml.

View Replies !
Obtaining File Attribute - Title, PDF, Word, Excel
I'm trying to write something that will traverse the directory
structure of my web server directory and pull some particular
information on particular file types to create a listing of what all is
where.

For PDF files I want to find the title. I've been looking through
php.net and the ClibPDF Functions, but I'm still not clear on how to
find the title of an existing pdf document. Code:

View Replies !
How Can I Retrieve And Display Fields From MySQL To The Value Attribute Of Forms?
Let's suppose we have a table with many records like this :

CREATE TABLE ARTICLE (
ID INTEGER NOT NULL
, NAME TEXT NOT NULL
, CONTENT TEXT NOT NULL
, SOURCE TEXT
, ARTDATE DATE
, HITS INTEGER DEFAULT 0
, PRIMARY KEY (ID)
)TYPE=InnoDB;

I want to execute the following query: SELECT NAME,CONTENT,SOURCE,ARTDATE FROM ARTICLE WHERE ID=[some_valid_id ]

CONTENT and SOURCE are usually fields with text of many lines. Code:

View Replies !
Height Attribute Of An Image To Be Controlled By Data In A Database Table
I want my web site to be as dynamic as possible (hence the reason for trying to master php) but the knowledge I have at the moment will not quite stretch to doing the following:

I want to have the height attribute of an image to be controlled by data in a database table. The table will hold the numeric test result that pupils score when they take a test on my web based tutorial. The image is a column, the larger the score, the larger the column. I would like to know: Code:

View Replies !
Extracting Images :: Warning: Ldap_get_values_len(): Cannot Get The Value(s) Of Attribute Decoding Error
I am trying to get a script, see below, to ouput an image from our LDAP. I am using the script below. However it returns the errors

Warning: ldap_get_values_len(): Cannot get the value(s) of attribute Decoding error in c:apacheapachehtdocsmtldapadminlistldapusers5.php on line 22

Warning: Cannot modify header information - headers already sent by (output started at c:apacheapachehtdocsmtldapadminlistldapusers5.php:22) in c:apacheapachehtdocsmtldapadminlistldapusers5.php on line 23 ......

View Replies !
RegEx - Make HTML Lower Case Except Attribute Values
I'm in the middle of writing a function at the moment that uses a series of regular expressions to clean up some dynamically generated HTML from a WYSIWYG editor but I'm having a problem getting the HTML to convert to lower case correctly.

I have the following expression to convert the tags to lower case:

$strHTML = preg_replace("/(<[^>]+>)/ies", "strtolower('$1')", $strHTML);
Naturally of course this changes everything about the tag to lower case, the tag itself, the attributes and the attribute values which is all good except that I dont want it to convert the attribute value to lower case. Code:

View Replies !
Warning: Net-enabling Start-tag; Possibly Missing Required Quotes Around An Attribute Value
I'm somewhat new to PHP/MySQL interaction and have a database of menus for my school's cafaterias. It may not be the slickest and even yet most efficient way to have it setup but it works for my first database/query web project. Due to our school's policy on accessability I need to validate all my pages and the only problems I have now are in my querys. Here is an example of my non-validataing code.

Line 89, character 6:
<br /><b>Now Serving @ the Wildcat Den:</b /><br /><b>Soup/ ...
^
Warning: net-enabling start-tag; possibly missing required quotes around an attribute value

Line 89, character 45:
... erving @ the Wildcat Den:</b /><br /><b>Soup/Salad Bar</b><b ...
^
Error: delimiter / invalid: only s and tagc allowed here

Line 89, character 51:
... @ the Wildcat Den:</b /><br /><b>Soup/Salad Bar</b><br>Chil ...
^
Warning: net-enabling start-tag; possibly missing required quotes around an attribute value

Line 89, character 364:
... ow Serving @ Marketplace:</b /><br /><b>Soup/Salad Bar</b><b ...
^
Error: delimiter / invalid: only s and tagc allowed here

Line 89, character 370:
... ving @ Marketplace:</b /><br /><b>Soup/Salad Bar</b><br>Mine ...
^
Warning: net-enabling start-tag; possibly missing required quotes around an attribute value

To me it looks liek a stripslashes issue. Here is my code for this query.

PHP Code: .....

View Replies !
Populating A Select Box
What I want to do for members of my website is to allow them to click a button that will add their name to a list that populates a select box.  I can do this on my own, but I was curious if I have to use a database in order for this to be possible. 

View Replies !
Populating A Combo Box
Using php how can i give a combobox a default value when the page is loaded?

View Replies !
Populating Rad Chk Inputs
How do you populate input elements other than text inputs with posted data?

View Replies !
Populating Drop Down
How do I do this drop down box ? Making an edit page. I have 2 tables

groups
id || categoryname

program

id || cateogry_id

I need to populate the groups in it at same time show the selected choice from program. Not showing id but needs to show categoryname with of course the values being the id of groups.

View Replies !
Populating Dropdown Box.
I have been looking around the internet for an example of what I need to do but cant find anything was wondering if someone here might be able to help. What I need to do is to connect to a mysql db select a table and then a field from that table and put all the contents of that field into a dropdown box.

View Replies !
Populating A Webpage
I am trying to create a webpage that will allow me to view my 'email' website whilst I'm at work. The firewall blocks the page and I was hoping that there was some surreptitious way to get around this problem. My thoughts for a solution to this would be to create a variable with the website's name in pieces. Then send it to a function that opens it in a frame or something.

View Replies !
Populating Tables
I'm trying to populate an HTML table using the data in MySQL. "how to do format it to where I can make shipping labels?" There will be three lines of text for each label but I will have three columns of labels X 10 rows. Code:

line A1 line B1 line C1
line A2 line B2 line C2
line A3 line B3 line C3

line D1 line E1 line F1
line D2 line E2 line F2
line D3 line E3 line F3
....

View Replies !
PHP + MYSQL, Populating Drop Down Box
I am looking to generate a dropdown box from MYSQL data:

db name = h2, table = Working, Column = Home.

View Replies !
Populating Two Combo Boxes
I have one combo box (Category) which is populated by a MySQL table using php. I am trying to use the onchange javascript to submit the value selected so that I can populate the other combo box (sub-category) based on what was previously choosen. So can anybody give me a clue on how to submit the first boxes value so that the second can see what was selected (javascript function).

View Replies !
Populating Dropdown List
I am wanting to know how to populate the <SELECT> dropdown menu with all existing values from the DB and also have the value associated with that id selected. This is an updating area of my admin. Any ideas? Here's the code so far. At the moment it only retrieves the value assigned to that id. PHP Code:

View Replies !
Populating A Drop Down Menu
How would I go about populating a Drop Down menu from data in MySQL? If you can show me wither a URL to learn this, or if you feel like telling me here, that would be great.

View Replies !
Dymanic Populating Checkboxes
i like to retrieve a value from DB,
accordingly i like to display the checkbox, either checked or not.

Now im able to retrieve the value from DB, i can show even show the
checkbox, but i cant make it checked????

the Code i used to display as follows,

#Require the database class
require_once('../dbinfoinc.php');

#Get an array containing the resulting
record
$query = "SELECT * FROM event";
$result = mysql_query($query);

$num=mysql_numrows($result);
mysql_close();

$i=0;
while ($i < $num) {
if(($i % 2) == 0) { $c =
'"TableDetail"' }
else { $c = '"TableDetail2"' }

$event_id=mysql_result($result,$i,"event_id");

$event_name=mysql_result($result,$i,"event_name");

$event_publish=mysql_result($result,$i,"publish");
// if(($event_publish) == 0) {
$event_publish = 'No' }
// else { $event_publish = 'YES'
}
$take_action = 'Delete'
echo "<tr>
<td Class='navText'
align='center' class=$c>$event_id</td>
<td class='navText'
class=$c>$event_name</td>
<td class='navText'
align='center' class=$c><input type='checkbox'
name='publish' if($event_publish==1){'CHECKED'}?></td>
<td class='navText'
align='center' class=$c><a
href='delete_event.php?event_id=$event_id'>$take_action</a></td></tr>";

$i++;
}
?>

View Replies !
Re-populating A Form If Errors
I am learning php. I have created a simple Web page with a form.
After receing the POST request, I do some error checking. In case of
errors, I would like to re-post the page, but with the current values
for each field.

I have organized my files like this:
1) Webpage with the form (all in html, form action points to a php
file)
2) php file that receives the request.

View Replies !
Populating Form Text Box.
I have a PHP form for entering data on-line into a mySQL
table..
Because of the intended search facility, I require one field in the form
to be completed with exact and precise item names and spelling.
In testing, I had achieved this with look-up tables.
Ideally I would like the selected item from one of five drop-down lists
to autopopulate the form text field when selected.
Alternatively at least the option of copy and paste.
Copy and paste - for some reason will not work.
Autofill worked fine on a test form with no database connection
and in standard HTML and javascript, however, once the PHP
is added to the page neither method works.
Could anyone please point me in the direction of how to get the
autofill to work?

View Replies !
Populating A Select Box From A Database
I have a subscription database that allows you to edit a subscribers data. For example, you enter a search term like "Bob" and it returns a list of everyone named Bob. You click the one you want and it goes to a subscriber detail page, where all of his data is populated to a form. You can directly edit this form and click save to overwrite it.

The only issue is the select boxes (drop downs) - say I have four options in the drop down box, red, blue, green and black. On my details page for bob I end up with five, I have those four PLUS whatever was saved for his color, so it shows up twice. If Bob is green, my select box looks like:

Green
Red
Blue
Green
Black

How can I make it so that Green only shows up once?

View Replies !
Populating Drop Down And Table
I have a database with the following fields.
Name | Company | Date

values in each column could be repeated, or not. as in there could be several same names with the same company with different dates, or different names with same company.

How do I populate a table with this info and have drop down boxes, so that I can narrow down the search? For example:
Name | Company | Date
12     | 1           | 1929
13     | 1           | 1929
14     | 1           | 1929
12     | 2           | 1929
12     | 4           | 1929
13     | 1           | 1941
12     | 6           | 1929

So if in the drop down I select '12' under name, only those entries with 12 are shown, and then I can further sort it by selecting only '1' under Company.
Hope I'm clear, I manage to complicate things when I post them.

View Replies !
Populating Table Information
I am trying to dynamically generate bgcolors with to help populate some information for a site. Here is the code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved