|-|x 126 Junior Poster in Training

I have been using Chrome for years as my primary browser. The main reason is its light weight memory usage, the way it handles processes for pages and plugins, and the speed it can load and render a page. IE has improved in v9, but IMHO both Firefox and IE are still too heavy.

As a web developer, I run installs of Chrome, IE, FF, Opera and Safari, and I maintain virtual machines with older versions of each for testing large global projects. It is important to test layouts and scripts on as wide a platform base as possible to ensure consistency and expected performance. Although, as Philippe mentions, it can depend on the target demographic for the project.

|-|x 126 Junior Poster in Training

Are you working with Oracle or MySQL?

This is a typical connection setup for the default local MySQL install, I assume it will be the same for you as you mentioned you use PHPMyAdmin. You will need to know your root password for mysql though.
Capture1

|-|x 126 Junior Poster in Training

... Al... that syntax is for UPDATE statements, not INSERT

|-|x 126 Junior Poster in Training

@bonsoirval you're right, but that assumes he's specifying values for all columns in the table, in the order they appear in the table schema.

|-|x 126 Junior Poster in Training

MySQL Workbench is the official utility from MySQL, although I find Toad more user friendly for most things, and it has some more features like DB compare.

|-|x 126 Junior Poster in Training

what exactly do you mean by not available?

you could try something like

if (img == null || img == DBNull.Value) { // no data returned
|-|x 126 Junior Poster in Training
|-|x 126 Junior Poster in Training

you have told it to be 1 pixel wide... it needs to be something like width:100%

|-|x 126 Junior Poster in Training

Insert syntax is wrong

INSERT INTO table_name [(column_names, ...)] VALUES (value [, values...])

In other words

INSERT INTO leads (`facility`, ...) VALUES ('{$facility}', ...)
|-|x 126 Junior Poster in Training

you need to add a width property, else it defaults to zero.

|-|x 126 Junior Poster in Training

pirates

-> Ninjas

|-|x 126 Junior Poster in Training

try abs positioning the hr

also, there is an extraneous </p> in there.

|-|x 126 Junior Poster in Training

Try changing from INNER JOIN to LEFT JOIN as your filter is on the left hand table.

|-|x 126 Junior Poster in Training

Do you think I should get a "css reset?"

I would suggest at least starting your CSS definitions off with a global selector, something like this

* {
    margin: 0;
    padding: 0;
}

Think of it like painting your canvas white before painting the picture on it. Have a look at some sample ones online and see what you think is useful. You can also use these to set global default fonts and colour schemes on a per-site basis, if it is useful to you.

Do you think I should buy photoshop?

I can't make that call for you, it is a hefty investment and would depend on your needs and usage. However, I have not come across another editor that does as much as well as PS. But, that may also just be because I'm used to it and know how to do what I need easily.

|-|x 126 Junior Poster in Training

The SelectedIndexChanged event is not really an appropriate place to call databinding - at least not your initial databind. This event only fires when an existing item in the DataList is Selected by the user. See here for more info.

You should try moving the code you have from this event into the Page_Load function and see what you get.

|-|x 126 Junior Poster in Training

Further to the above... it is common for web developers to use a 'master reset' at the top of their css definitions. The purpose of this is to set defaults for clearing margin padding and anything else you may need.

There are a few different versions of these available if you google, but this is a good place to start.

|-|x 126 Junior Poster in Training

If you don't specify a height and width, then the browser defaults to a single "line" height.

If specified then the block element is rendered precisely to the height and width you specify. In this case there should not be extraneous whitespace.

Of course there are also margin and padding properties, which some browsers have different defaults for.
These should be set to 0px unless you specifically need/want them. And don't forget that these properties are inherited. In other words, consider the following example.

<div id="a" style="margin:5px;">
    <div id="b"></div>
</div>

in this case, both divs a and b would render with a 5px margin. In order for b not to have a margin, it must specify margin:0px.

|-|x 126 Junior Poster in Training

not if you define the size (height and width) values in its css as well. By default it will be 1 line high based on the current font size. But you can override this, even set height:0px - this is how some menus and collapsing divs work, by adjusting the height value dynamically with javascript.

|-|x 126 Junior Poster in Training

I run WAMP for development purposes. There is an easy setup and configuration guide that can get you up and running quite easily.

|-|x 126 Junior Poster in Training

<BR> is a new line, but it also creates a blank line most of the time, depending on the display characteristics of it and the other elements on the page.

by specifying the display property of the a tags to be block, it tells the browser that each element is to be rendered as a block, on a new line, not next to the previous element. Hence you don't need the br's

|-|x 126 Junior Poster in Training

ah kk... you need to remove the brs from between the a tags.

|-|x 126 Junior Poster in Training

now is not a keyword, it's a function. You would normally use it when you create a new record.
example

INSERT INTO dates (date_field) VALUES (NOW())

to execute this in PHP code you call mysql_query

mysql_query("INSERT INTO dates (date_field) VALUES (NOW())");

On its own, however, the date stored may not have much value. In the context of your post, you would normally add a date field to your post table and save the date when the post content is saved. Have you got as far as creating a table for your posts yet? because this is probably a more logical place to start.

|-|x 126 Junior Poster in Training

really? can you post your code again now.

|-|x 126 Junior Poster in Training

I tested as Al said, if the form is using the default GET method then it does generate url parameters, but if using form method="POST" then nothing is added to the URL and values are available via $_POST

|-|x 126 Junior Poster in Training

I get an error saying that my syntax is wrong

What is the actual error message you are getting? Is it from mysql or from PHP?

the line of code you posted doesn't have a semicolon at the end, which will generate a syntax error in php if its like that in your page.

Patiodude commented: The error message doesn't actually display an error code; very strange. +0
|-|x 126 Junior Poster in Training

Correct me if I am wrong though, Al, but even if the default form method is used and the data sent as a GET request, it still would not appear in the query string. Right?

|-|x 126 Junior Poster in Training

afaik PHP has never done this for input values by default. Form input values are available via the $_POST variable on the server. If you want to pass them via the url, I think you have to construct the url yourself as a string and link or redirect to it. Ten the values will be available via the $_GET and REQUEST objects.

But do you really need / want to pass this data as a URL parameter? especially for username and password data this would not be recommended.

|-|x 126 Junior Poster in Training

I believe the PRIMARY statement needs to go at then end of all the column definitions

CREATE TABLE example (
  id int NOT NULL AUTO_INCREMENT,
  name varchar(30),
  age int,
  PRIMARY KEY (id)
)
|-|x 126 Junior Poster in Training

if you still have the spacing issue, try doing it this way instead:

.pecor {
    text-decoration: none;
    display: block;
    background-image: url("home.jpg");
    height: 49px;
    width: 111px;
}

and delete the img tag from inside the links.

------

I generally use photoshop for image editing, but you could try this, its supposed to be good.

|-|x 126 Junior Poster in Training

Is anyone familiar with PDFlib? I'm having trouble geting it to run.

Running a WAMP server, PHP 5.2.16, followed the instructions to install the appropriate version of the DSO, the PHP monitor recognises that the extension is loaded, but when I try to use it I just get undefined function errors.

|-|x 126 Junior Poster in Training

Secondly I don't think base64_decode is necessary. Just check it out. I've worked with the same system before. And i directly echoed the data rather than a base64_decode

I believe you are correct, but you have to then specify the encoding type Header to be base64, if I'm not mistaken...?

@hwoarang

Post your whole code for both pages again please, I'll set it up localy and see if I can make it work.

hwoarang69 commented: tyy +0
|-|x 126 Junior Poster in Training

hmm... ok. check that the margin and padding for both the a and img tags are set to 0px.

I'll take another look later as well.

|-|x 126 Junior Poster in Training

Please explain what are value options

I just meant the possible values to be assigned to the display property. As that w3school page describes several, but the most common ones (that I use at least) are display:block;, display:inline; and display:none;

nice link btw. :) here is a different resource if you prefer.

|-|x 126 Junior Poster in Training

i should del $sql from gallery side right? and while loop

Sorry, forgot to respond to this part.

No, you still want the loop in your gallery page, as this is selecting all images for the logged in user, and formatting the HTML page output.

The image.php page is only returning the contents of a single image file for display.

Both parts must work together for the user to see all images they have uploaded. Does this make sense the way I have explained it?

now only error is the T_STRING

in your page above, line 5 does not have a closing quote " which may be causing the issue.

please also make sure there are no blank lines in connect.php

hwoarang69 commented: t +0
|-|x 126 Junior Poster in Training

it just goes into your css definitions like so.

#pecor {
    display:block;
    ...
}

I believe the default for an anchor (a) tag is block, but it doesn't hurt to specify.

This page explains the various value options available for the display property. Most common you will use are block, inline and none.

(also I put more notes in the other post, not sure if you saw those before your reply)

|-|x 126 Junior Poster in Training

does connect.php produce any output??

there can't be any output at all before setting the Header
Also remove that blank line (line 5 above) from image.php, as that may be generating empty output.

hwoarang69 commented: ty +0
|-|x 126 Junior Poster in Training

try removing the <br/>s from between each link and add display:block to the a style properties.
Also make sure the margin and padding is set to 0px;

Let me also make the suggestion that it is better to use the class attribute to identify groups of controls to apply the same styling to, rather than id

.im {
    ...
.pecor {
    ...

<a class="pecor" href="h.html"><img class="im" src="home.jpg" height="49" width="111" /></a>
                                            also, make sure you close your img tags  -^
|-|x 126 Junior Poster in Training

oooh... sorry, haven't used Dreamweaver in years. Does the recordset query generate some php code to fetch records from the database?? If it does, post the code it creates here - I can help with the code, but not with DW.

|-|x 126 Junior Poster in Training

try changing line 8 of image.php

$imgdata = base64_decode($row[image]);
header("Content-Type: image/jpeg");
header("Content-Length: ".strlen($imgdata));
echo $imgdata;

note: the actual content-type used must depend on the type of image stored. ie: jpg gif png etc.
See this list for more details.

hwoarang69 commented: ty +2
|-|x 126 Junior Poster in Training

I just noticed that my browser's "Show Source" doesn't display that particular PHP snippet; just <h6>Posted on </h6>.

No, PHP code will never be displayed in a browser source view, as it is compiled on the server into pure HTML.

<?php date("Y-m-d H:i:s") ?>

This is calling the date function, but not outputing anything. To print it to the page use echo

<?php echo date("Y-m-d H:i:s") ?>

However, also note that this function by default returns the current date. If you want to have an actual posted date you will likely need to store a date/timestamp in the database table with the post itself. Then read it from the database and print it using the function.

<?php echo date("Y-m-d H:i:s",$posteddate) ?>
|-|x 126 Junior Poster in Training

Not sure tbh.

I would recommend recreating the .htaccess file one line at a time, and testing to see that each line works. At least this should allow you to isolate the specific statement that is causing a problem, and hopefully narrow down why it is a problem in the process.

|-|x 126 Junior Poster in Training

Both JorgeM and hericles are correct in their points. The reason your DataList is not visible when you initialy start the app is because SqlDataSource1 has no query and thus DataList1 will contain no data and not display.

|-|x 126 Junior Poster in Training

what code are you using to display the timestamp?

|-|x 126 Junior Poster in Training

I think this section is wrong. (lines 24-27)

echo"
$image = $sql['image'];
base64_decode($image);
echo "$row[image]";
";

Try something like the following in its place.

echo '<td><img src="image.php?id='.$row['image_id'].'" /></td>';

then create a new file called image.php with the following content.

<?php
    session_start();
    include("connect.php");
    $sql = "SELECT image FROM image WHERE image_id = ".$_GET['id'];
    $result = mysql_query($sql);
    if ($row = mysql_fetch_assoc($result)) //should only be one record
    {
        echo base64_decode($row[image]);
    }
?>
hwoarang69 commented: ty +0
|-|x 126 Junior Poster in Training

can you post an example? link or sample code, something we can test.

|-|x 126 Junior Poster in Training

hey Kip,

You'll need to include your css files/code as well, so I can take a look at what styling you've got specified.

|-|x 126 Junior Poster in Training

@Mitch

I apologise, I wasn't intending to be negative - just pointing out that as far as I can tell everyone is posting basicallythe same things, and it doesn't seem to be what you are looking for. So, you need to clarify precisely what you want.

Your last post to Al does this a bit better. So, you are wanting to write your own WYSIWYG editor for PHP? or you want to find an existing one that is purely PHP based?

AFAIK all online WYSIWYG editors require javascript, otherwise you would have to post every change to the server before you could see the update - which would be a very tedious process to edit anything.
I have even written one myself in the past, but it also involves javascript in order to update the visual display of what you are editing.

The easiest one I have used is probably TinyMCE, but it is javascript based. You simply include this code in your page to convert a textarea into wysiwyg editor:

<script type="text/javascript" src="../tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
        mode : "textareas"
});
</script>

(taken from http://www.tinymce.com/wiki.php/Installation)

|-|x 126 Junior Poster in Training

I just want to know a free text editor that I can used to put it in the admin section

We have all pointed out several options available to you. Have you actually checked out any of the links or Googled for any of the suggestions?

I don't know how to put the text editor in the admin section meaning setup the text editor

I'm sure all of the suggested products have clear setup instructions on their websites.

He is asking me not you how this is going to work? Well, I tell Ardav I'm not sure either!

So, what exactly are you looking to get out of this thread? Since none of the suggestions so far seem to have satisfied your request, how can we help?

|-|x 126 Junior Poster in Training

you need to databind the DropDownList itself, as you point out correctly the ListItem doesn't have any data binding events.

<asp:DropDownList ID="ddlLocation1" runat="server" DataSourceID="dsLocation" DataValueField="TotalCost" DataTextField="Location" />
|-|x 126 Junior Poster in Training

Hi All

I'm looking for ideas or suggestions about how to implement this feature.

The concept is I have 2 dropdown select boxes, with data that is not directly related (in the sense that there is no identifiers or foreign keys or anything within the data itself) but that have a logical relationship (although some data may not correlate to anything).
The dropdowns are populated from a database via ASP.NET, and I need to be able to select a value in dd2 based on the user selection of dd1.
I am hoping to do this in javascript so as to avoid the need to postback whenever the selection changes.

Example data set;

 dd1   dd2  |  relationship
-----+------+---------------
 A     W    |  A -> X
 B     X    |  B -> Z
 C     Y    |  C -> Y
 D     Z    |  E -> W
 E          |  F -> Z
 F          |  

I am thinking at this point that I will have to dynamically generate the javascript with a large array defining the relationships and check through it upon dd1 selection.

My question is, is there a more efficient way of doing this?
Can I set javascript events on the list items themselves, and would that be better?

How would you approach finding a solution to this problem?