simplypixie 123 Posting Pro in Training

@pritaeas - that is a good point as even though I haven't integrated the php yet, this area will dynamically load 8 products and all I have done is float each 'box' to the left and they just wrap down to the next line which saves me having to use php to calculate the number of products already showing so as to know when to create the next table row.

simplypixie 123 Posting Pro in Training

This is a re-design for an existing client of mine which I am converting from PSD to HTML at the moment so the new design isn't live yet. If you want to see the current site though the domain is www.uniteddiesel.co.uk.

simplypixie 123 Posting Pro in Training

@dantinkakkar, I think you misunderstand - I was looking for opinions only as I have been designing/developing using CSS for about 8 years now and already know its benefits. I only asked for opinions as it was a table format and in a sense contains tabular data.

Anyway I went with CSS as the first 2 responders confirmed my thoughts and all is done now.

simplypixie 123 Posting Pro in Training

@teedoff - I agree and I hate working with tables and you make a good point about bloat.

simplypixie 123 Posting Pro in Training

I always develop sites using CSS but am aware that tables have their place when displaying tabular data, however I can't decide whether to use CSS or a table to display the products on the home page of a re-design I am doing and just want peoples opinions please (note I will be lining up the product descriptions vertically though they don't appear that way yet).

The layout is attached as a jpg.

What would you do??

simplypixie 123 Posting Pro in Training

Have you checked that you are getting any results from the actual query or tested that the query is working in any way (you can try echoing it as a start)?

Your echo of paid_thru should just be

echo $row['paid_thru'];
simplypixie 123 Posting Pro in Training

What is the problem exactly - you don't say?

simplypixie 123 Posting Pro in Training

And?

simplypixie 123 Posting Pro in Training

In this case you just need one IF statement to check

if ($s_veration <= $remnder_ver) {
echo" <strong>Specific Variation</strong> ought to have a value grater than <strong>Reminder Variation</strong>, please go back and alter your values";
}

You shouldn't be exiting either so leave that out

simplypixie 123 Posting Pro in Training

These conditionals don't make sense

if($s_veration == $remnder_ver)
	 {
	echo" <strong>Specific Variation</strong> ought to have a value equal to <strong>Reminder Variation</strong>, please go back and alter your values";
	exit();
	}

elseif($s_veration >= $remnder_ver)
	 {
	echo" <strong>Specific Variation</strong> ought to have a value grater than <strong>Reminder Variation</strong>, please go back and alter your values";
	exit();
	}

In the first you are saying if $s_veration is equal $remnder_ver then it is incorrect yet your echo says that they should equal.

The second says if $s_veration is greater than or equal to $remnder_ver then it is incorrect yet your echo statement says that $s_veration SHOULD be greater than $remnder_ver.

To match your errors you need to change to

if($s_veration != $remnder_ver)
	 {
	echo" <strong>Specific Variation</strong> ought to have a value equal to <strong>Reminder Variation</strong>, please go back and alter your values";
	exit();
	}

elseif($s_veration <= $remnder_ver)
	 {
	echo" <strong>Specific Variation</strong> ought to have a value grater than <strong>Reminder Variation</strong>, please go back and alter your values";
	exit();
	}

However if the first conditional says they should be equal then your 2nd will always fail as one is not greater than the other

simplypixie 123 Posting Pro in Training

Thank you so much @pritaeas I have implemented the function and it appears to be working brilliantly.

online_profile_url: { 
				url: {
					depends: function () {
						return $("#online_profile_url").attr("value") !== 'http://';
					}
				}
			}
pritaeas commented: Thanks for sharing. +14
simplypixie 123 Posting Pro in Training

Thanks, I will have a play with that

simplypixie 123 Posting Pro in Training

Sorry if the title of this thread doesn't make sense - I didn't know what to write :)

I am using jQuery form validation and one of the rules is to check for a valid url. The field isn't required so am just validating formatting. This all works fine but where the complication comes (for me anyway) is that I also have some javascript populating the field with http:// onfocus and removing onblur and I need to stop the url validation if the field is left blank but what is happening at the moment is that as soon as the focus is lost the form still looks for a valid url as the field has been focused on (hope some of this makes sense.

The code (I have removed all other rules for clarity)

// Pre-fill Online Profile URL form field with http:// on focus and remove on blur
	var text = "http://";
	
	$("#online_profile_url").focus(function() {
		if($(this).attr("value") == "") $(this).attr("value", text);
	});
	
	$("#online_profile_url").blur(function() {
		if($(this).attr("value") == text) $(this).attr("value", "");
	});
$("#appForm").validate({
		
		rules: {
			
			online_profile_url: "url"
			
		}
		
	});

How can I only run the url validation if more than just the http:// has been input in the field (I don't know if and how to set conditionals within the rules)?

simplypixie 123 Posting Pro in Training

Resolved!!!!

I changed the name of the file (2nd parameter in code below) from just 'CV FIle' to the actual name of the file being attached.

$mail2->AddAttachment('files/cvs/'.$cv->filename, $cv->filename);
simplypixie 123 Posting Pro in Training

No good :-(

simplypixie 123 Posting Pro in Training

To be hoest I haven't tried any other file types and it was working on my server so I am still wondering if it is a server issue instead. I will try out a different file type and see what happens.

simplypixie 123 Posting Pro in Training

There are no leading zeros in auto-incremented ids so you will only ever get MATH 20121 as your code is. If you want to include a zero you will have to put it in

$b="MATH"."$yr".0."$id";
simplypixie 123 Posting Pro in Training

That was a great idea, but still no good I am afraid (attached a .doc and it came through without an extension)

simplypixie 123 Posting Pro in Training

Unfortunately that hasn't worked either.

simplypixie 123 Posting Pro in Training

Sorry the missing $ is just my copying and pasting (yes to move_upload etc, this is just a snippet to show the filename formatting).

The filename is all correct as the name is stored in the database correctly and the file opens in the correct software from the link in the admin area, it is just changing to being a filename without an extension when attached to the confirmation email.

I will try changing the reference to the filename in the attachment and see what happens.

simplypixie 123 Posting Pro in Training

I am not sure if this is a server issue as seemed to be working on my testing server but now live on the clients server this issue is arising. The email is generated from a form which includes a file upload in either word or pdf which is saved to the server and then attached to the email.

The problem is that the files are coming through in the email without any file extension by the looks of things so .doc files open as .txt files and .pdf files open as gobbledigook.

Can anyone shed any light on this (the server is on PHP 5.2.9 if this does have any impact). Not sure if code is needed but the attachment part is:

// From applications class to rename file upload
this->ext = pathinfo($file['name'], PATHINFO_EXTENSION);
$this->filename = $name.'-'.date('dmY-Hi').'-cv.'.$this->ext;
// $_POST['cv_file'] is re-populated with the new filename in the form submission page before email is sent (this is because I use the array of posted values to insert into the database rather than having to type them out over and over)
$mail->AddAttachment('files/cvs/'.$_POST['cv_file'], "CV File");
simplypixie 123 Posting Pro in Training

Because to display 2 columns next to each other and independent of each other you need to float at least one of them. For example

#faq1 {
float: left;	
margin: 0 0 0 10px;
	width: 250px;
}

#faq2 {
	margin: -200px 0 0 300px;
	width: 250px;
}
simplypixie 123 Posting Pro in Training

pritaes:

Just a note: not true. You can use whitespace, including line breaks just fine.

Actually, yes I don't know why I put that as I have linebreaks in my code all the time.

I have never realised (and there used) multiple fetches in a while loop so my apologies as I didn't think it was acceptable as I have never seen it before.

darkc99:

Have you re-formatted your code to remove the duplicate mysql_query as I said?

simplypixie 123 Posting Pro in Training

A few things - firstly you have out your die on the next line, php needs to be on one line, secondly you are running your mysql_query twice and thirdly you are trying to run two queries in your while loop.

This should work (unless there are other problems):

include ("config.php"); 
// select data from database   
$w3db = mysql_query( "SELECT * FROM w3dbx" ) or die("SELECT Error: ".mysql_error());
$worth = mysql_query( "SELECT * FROM worth" ) or die("SELECT Error: ".mysql_error());
			
// fetching data 
//while ($get_infox = mysql_fetch_assoc($resultx) && $get_info = mysql_fetch_assoc($result))
while ($get_w3db = mysql_fetch_array($w3db)) {
// code here
}
while ($get_worth = mysql_fetch_array($worth)) {
// code here
}

If you need to display the two sets of query results together you will either have to change your query to one using joins of run your second query within your first while loop.

simplypixie 123 Posting Pro in Training

Can you clarify - are you trying to calculate the total weight of multiples of the same item or the total weight of multiple items?

simplypixie 123 Posting Pro in Training

Very sorry I obviously didn't read your original post properly as I now see the part about Browse, I read it that you were having problems shortening your text on your website which is why my reply was as it was.

simplypixie 123 Posting Pro in Training

I did solve this issue with pure CSS, no errorPlacement used at all in the end.

simplypixie 123 Posting Pro in Training

I am not sure why you still think phpMyAdmin has anything to do with your website and code - it doesn't

simplypixie 123 Posting Pro in Training

phpMyAdmin is just an admin area for MySQL to make working with your database easier and more intuitive so don't get confused that it has anything to do with your website or coding.

It is the PHP that will determine how much of your text is displayed so you need to look at what might have changed there and amend it.

simplypixie 123 Posting Pro in Training

I have now applied some different styling to the css and things are working much better. I just need to work out how to place the last of the error messages differently to the others and I will be sorted.

simplypixie 123 Posting Pro in Training

I knew what you meant :) I am looking in it and none of it makes sense to me but never mind.

simplypixie 123 Posting Pro in Training

Thank you - anything for Chrome??? :)

I will test it in Fireefox

simplypixie 123 Posting Pro in Training

There was no initial styling on the div and the label.error is set to float: none;. Anyway, I thought I would try adding some styling to see if I can move the text (have tried various postions, floats etc) but still nothing.

Am I right in thinking that I should be able to see the error text within the div tags when I view source if the error text is being correctly appended to the div?

simplypixie 123 Posting Pro in Training

OK, thank you. To be honest I thought it would just move the error message into the empty div but presumably not with css formatting on that div.

simplypixie 123 Posting Pro in Training

I have finally got around to utilising jQuery form validation on a new site I am doing the coding for and even though everything is working exactly as it should I need to move one of the error messages to display below rather than to the right as the other error messages and even though I have an idea of how it is done I can't get it to work (of course I may be way off).

What I have done in the form so far is this

<p><label for="tsandcs">&nbsp;</label>
<input name="tsandcs" id="tsandcs" type="checkbox" style="width:20px;" class="required" value="<?php if (isset($_POST['tsandcs'])) { echo 'checked'; } ?>"  /> I agree to the Terms and Conditions </p>
<div id="tsandcs_error"></div>

And the JS

errorLabelContainer:("#tsandcs"),
	errorElement: "p",
	errorPlacement: function(error, element){
		error.appendTo($("div#tsandcs_error"));
	}

I really could do with some help as I need the error text to display underneath the "I agree to ....." text rather then to the right.

simplypixie 123 Posting Pro in Training

To prevent the gap, remove cellspacing from the table (or set it to 0).

simplypixie 123 Posting Pro in Training

No problem - please now mark as solved

simplypixie 123 Posting Pro in Training

Undefined index is just a warning, not an error and it is just advising to check if the variable exists or has a value so all you have to do is out an if statement in your code and in your case around the whole php by the look of it:

<?php
if (isset($_POST['add_item1'])) { 
// Your current php code here
}
?>
simplypixie 123 Posting Pro in Training

No problem - sorry for my initial rushing and errors :)

simplypixie 123 Posting Pro in Training

I have tested this one:

echo '<a href="http://www.mysite.com/' . $row['seo'] . '/' . $row['PID'] . '/' . $row['gtitle'] . '">Random Link</a>';
simplypixie 123 Posting Pro in Training

Is the error definitely on this line?
I have also missed an underscore from the str_replace:

$row['gtitle'] = str_replace(" ", "-", $row['gtitle']);
simplypixie 123 Posting Pro in Training

Please put your row values back into " ", so

$row["seo"]

Sorry, I rushed this a bit when I replied to you.

simplypixie 123 Posting Pro in Training

Please put your row values back into " ", so

$row["seo"]

Sorry, I rushed this a bit when I replied to you.

simplypixie 123 Posting Pro in Training

Sorry I left an extra " at the end of the echo statement.

Change to:

</a>';
simplypixie 123 Posting Pro in Training

In your css:

body {
margin = 0;
padding = 0;
text-align: center;
}
simplypixie 123 Posting Pro in Training

Your whole format is wrong (missing " " and closing them too early etc). If you use " " for your echo statement it is much easier to format. Try this:

echo '<a href="http://www.mysite.com/'" . $row['seo'] . "'/'" . $row['PID'] . "'/'" . $row['gtitle'] . "'">
Random Link
</a>"';

Not sure why you are only getting the first word of the gtitle but to re-format use strreplace:

$row['gtitle'] = strreplace(" ", "-", $row['gtitle']);

For the header redirect you need to assign the created link to a variable, not just echo it out and then use that variable in your header redirect:

$link = // your link code here as I have reformatted above;
header("Location: {$link}");
simplypixie 123 Posting Pro in Training

You can't do what you are trying to do with a while loop as for one you need to include everything after while and before { in brackets but as far as I am aware you cannot select within a while condition either.

All you need to do is run another query:

$sql = mysql_query("SELECT mem_id FROM members WHERE user = '$username'");
$query = mysql_fetch_array($sql);
if ($query) {
  $username = genPswd();
}

However you will need to keep running this until you generate a username that is not already in the database which is not productive so I would recommend creating usernames that are more random or use something from the selected user data to add to the beginning or end of the random username (like the id or initials etc).

simplypixie 123 Posting Pro in Training

You need to go through your code and count the number of opening { and closing } (indentation helps) and make sure you have the same number of each

simplypixie 123 Posting Pro in Training

The error you are getting means you are missing a closing } somewhere so as I can see nowhere in your code that has this problem I would suggest checking your include file as well.

simplypixie 123 Posting Pro in Training

You also shouldn't have ' ' around your column names in the query (use nothing around them or ` `).

I think what is causing your error though as that you have a line break between your query and

or or die(mysql_error());

- code must all be on one line without line breaks before the semi-colon.