samarudge 16 Posting Whiz

As Imthwee said, please try to find tutorials too.

Anyway Please follow this to get your work done:

1) Just create an empty movie clip with a instance name (emptyMC)
2) Place your jpeg file in the same location

use this code in timeline:

const IMAGE_URL:String = "followme.png";

var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, ldr_complete);
ldr.load(new URLRequest(IMAGE_URL));



function ldr_complete(evt:Event):void 
{
	emptyMC.addChild(ldr);
}

Hope this helps!

Note: Don't worry about the size of the movie clip, Just an empty movie clip thats it!

Thank you so much, I would buy you a virtual pint but I don't think that is possible =P

samarudge 16 Posting Whiz

I have been following tutorials all day and none of them work, I just thought that an WEB DESIGN FORUM might be able to help, I didn't see the point in saying "This has taken me the last 8 hours to do but it doesnt work

Some Code

"

samarudge 16 Posting Whiz

Hi,

I have a movie clip called dsp_albumcover (Already created and on the stage, instance name is dsp_albumcover)

I also have a variable with a .jpg file (Can be changed to any other though) defined as

var albumimg:String = '/albumcover.jpg';

How do I load this in to dsp_albumcover?
dsp_albumcover is 128 pixles high x wide and the image is the same dimentions.

Thanx,
Sam

P.S. Before anyone says that I should just include it in my libary, /albumcover.jpg?ID={ID} is the actual image that would be called and would be retrieved from a DB

samarudge 16 Posting Whiz

You must post a compleatly disasociated word to the previous one I.E.

Elephant, Battery is OK
Elephant, Plant is OK
Elephant, Giraph is NOT (Both Animals)
Elephant, Table is NOT (4 Legs)

Etc.

Not allowed words: Universe, Plannet, Dictionary, Thesorus, Internet (Including Google :P) and any other words that are globaly associated

Lets get started...

House
samarudge 16 Posting Whiz

--Moved This Post---

samarudge 16 Posting Whiz

Mr samarudge,

Your code is written in a right way!, and It works. But whats the problem is before reading your xml, the trace statement is executed once. You should give time to load your xml and after that only have to use trace statement. Thats the problem!.

you can test this by using the below code.

var songdataurl:String;
var xml:XML;
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE,onXMLLoaded);
urlLoader.load(new  URLRequest("data.xml"));

function onXMLLoaded(e:Event):void{
       xml =  new XML(e.target.data);
	   GetSongData();
}
function GetSongData():void{
       songdataurl = xml..song[0];
}

var timer:Timer=new Timer(500);
timer.addEventListener(TimerEvent.TIMER,process);
timer.start();
function process(e:TimerEvent):void
{
trace(songdataurl);
}

Hope this helps!

GENIUS =D
Thanx, marked solved and rep added :P

samarudge 16 Posting Whiz

This is the first time I have ever used AS3, I just want the variable to be available further on in the script (outside onXMLLoaded function)

samarudge 16 Posting Whiz

Hi, I am trying to retrieve the contents of my XML file and use the variables later on in the script;
I have the following actionscript code

// Get XML Vars
var xml:XML;
var urlLoader = new URLLoader();
var songdataurl:String = '0';
urlLoader.addEventListener(Event.COMPLETE,onXMLLoaded);
urlLoader.load(new  URLRequest("data.xml"));

function onXMLLoaded(e:Event):void{
       xml =  new XML(e.target.data);
	   GetSongData();
}
function GetSongData():void{
       songdataurl = xml..song[0];
}
trace(songdataurl);

//Use songdataurl in script

and the following is the contents of data.xml

<?xml version="1.0"  encoding="UTF-8"?>
<songs>
	<song  title="A Song" artist="Joe Blogs" album="An Album">/getsong/?ID=12345&Hash=12345678&IP=0.0.0.0</song>
</songs>

I'm trying to get the contents of the <song></song> tag and use it later on in my script.

Thanx,
Sam

samarudge 16 Posting Whiz

Firefox, Netscape Navigator and Opera will allow target to eather be an id= or a name= whereas IE only allows name= so I have both to cover all browsers

samarudge 16 Posting Whiz

Probz already been posted but hey

Do you believe in Cod?

Christians believe if they do not sin they will have salivation.

We must try to control our animal orgies.

What means “you should never stone the first cast”?

Which religion do you use?

Our church has smaller members every week.

I Know that if I pray hard,
God will forgive me for my shins.

I think maybe our house is haunted with dead goats.

People don’t think for themselves. Most people have the same religion their parrots had.

If you don’t believe in God your spit can go to hell.

The thirty largest religious leaders met to
talk about world hunger.

Jesus lived during the Roman Catholic Empire.

I think Moses was that guy that climbed into a mountain. then he read God’s Ten Big Rules from the top.

Do you believe some part of you
still lives after you are dead?
You mean organ donation?


I don’t agree with some of the conceptions
in that church.

We believe the spit of our ancestors stays with us
and helps our food to grow.

At that time, the romanians had stronger arms so they controled the Judists.

When the bad army tried to follow them in the land of milky honey land, probably they couldn’t walk on water so they sank.

When turtles …

samarudge 16 Posting Whiz
<form id="form1"  action="#" method="post" enctype="multipart/form-data" runat="server" target="myframe">
    <input type="file" id="myfile"   accept="image"  runat="server"/>
    <input type="submit" value="upload"  runat="server" />
    </form>
    <iframe id="myframe" name="myframe">
    </iframe>

Does that work now?

Dhaneshnm commented: Thanks ... +1
samarudge 16 Posting Whiz

The problem is that I designed a website for someone and at the bottom I put
"Created by Sam Rudge"
When I search for "Sam Rudge" on Google the first result that comes up is that website where as I want MY website to come up first
Hope it is a bit clearer what I am trying to do now

samarudge 16 Posting Whiz

Perhaps this might be better:

mail($to, $subject, $body,
    "From: Mr. User <user@site.com>\r\n" .
    "MIME-Version: 1.0\r\n" .
    "Content-Type: multipart/alternative;\r\n" .
    "     boundary=" . $mime_boundary_header."\r\n") or die('Mail Error');

Thanks for the suggestion but same error again :(

samarudge 16 Posting Whiz

2 ways to do this
Option 1, as you said, edit the php.ini file
however from what you were saying this may be easyer
at the start of the file that handels the upload (Not the one with the form on) add this line

<?php
ini_set('upload_max_filesize ', '31M'); //Gone 1M over just to allow files slightly larger but edit to your specifications
?>
samarudge 16 Posting Whiz

Hi,
I am having a problem with my PHP mail function. I am trying to send an email from user@site.com. This code is fine:

mail($to, $subject, $body,
    "From: user@site.com\n" .
    "MIME-Version: 1.0\n" .
    "Content-Type: multipart/alternative;\n" .
    "     boundary=" . $mime_boundary_header) or die('Mail Error');

however this does not

mail($to, $subject, $body,
    "From: Mr. User <user@site.com>\n" .
    "MIME-Version: 1.0\n" .
    "Content-Type: multipart/alternative;\n" .
    "     boundary=" . $mime_boundary_header) or die('Mail Error');

The exact error returned is

[Sat Sep 26 21:08:11 2009] [error] [client 127.0.0.1] PHP Warning:  mail() [<a href='function.mail'>function.mail</a>]: SMTP server response: 501 &lt;&lt;TubeTool&gt; user@site&gt;: missing or malformed local part in [removed for security]\\scripts\\0\\saccount\\signup.php on line 168, referer: [...]

Please note that the &lt; and &gt; are exactly that in the error log not < or >
Regards,
Sam Rudge

samarudge 16 Posting Whiz

Due to the way the HTML file selector works it is not possible to do this through only HTML/PHP
However...
It is possible through Flash
There is a brilliant up-loader here - http://swfupload.org/
It allows you to specify file type as well as showing a progress bar

samarudge 16 Posting Whiz

This is probably one of the oddest SEO questions ever but here we go;
My site is showing up fine on the keywords I want but it is also showing up top on keywords that I don't want it to show up on. Is there any way to get Google etc. to get my site not to show up on certain keywords. I have full Webmaster Tools access to the site as well as access to sitemaps, robots.txt and the pages themselves

Regards,
Sam Rudge

samarudge 16 Posting Whiz

There are a few options
1st would be JoomlaXplorer if you are running a Joomla system
This is a very good method of editing files and includes pritty syntax highlighting which makes it much easyer to edit
2nd Dustin Minnich's Simple PHP File Editor
http://www.dminnich.com/files/php_simple_fileed.tar.gz (Download)
or
http://www.hamburgernecklace.com/dm/demo/php_simple_fileed (Demo)
Never used it but told its quite good

samarudge 16 Posting Whiz

See the contents of your variable with

print_r($row);

This prints out all the values in an array

samarudge 16 Posting Whiz
$Escaped = mysql_real_escape($String);

or

$Escaped = mysqli_real_escape($Connector, $String);

(Depending on connector used)

samarudge 16 Posting Whiz

If you use Dreamweaver it can create them for you (Spry>Menu) but this is realy much more to do with HTML, CSS and Javascript than PHP

samarudge 16 Posting Whiz

Image magik is a command line tool so it gets its own little "lump" of memory whereas gd runs of the memory already given to PHP. There will be now difference in quality HOWEVER magik is faster and safer because if GD was to crash it would take down your entire PHP thread and if you were running off an Apache server, crash the host. Although it is very unlikely to happen, magik or any other command line tool will be much more reliable because if it were to crash it would just kill that session (the image being created) and one user might not see an image but the server would remain stable.

samarudge 16 Posting Whiz

You meen the URLs look like
index.php?ID=1251341234
Etc.

samarudge 16 Posting Whiz

Just add scrolling="no" to the iframe, that should work

samarudge 16 Posting Whiz

This is nothing to do with PHP, its all to do with the browsers trying to "URL Encode" the strings.

samarudge 16 Posting Whiz

For doing something like this you should realy look into imagemagik etc. as GD is very CPU intensive and lower quality

samarudge 16 Posting Whiz

But TommyBs, that will be the first 50 charicters. I would do something like this

<tr>
<td bgcolor="ffffff" width="400" valign="top"><img src="mainpic.jpg"></img></td>
<td bgcolor="ffffff" width="360" valign="top"><h4><? echo "$headline"; ?></h4><h3><?
$Words = explode(" ", $story); //Split it into individual words

$i = 0; //Loop var
while ( $i <= 50 ) { //Before 50 words
$story[$i] = $Words[$i];//Put 50 words into origonal variable
$i++; //Add to our loop
}
echo implode(" ", $story)."..."; //Stick everything back together with spaces and add ... to the end
?></h3><a href="view_story.php?id=<? echo "$id"; ?>" style="text-decoration:none"><h5>read more...</h5></a></td>
</tr>

^^Havent actualy tested it^^
but get back on wether it works

samarudge 16 Posting Whiz

Well in that expression it meens if it fails to connect to the database (IE the function returns a FALSE value) it will run testFun(); Probably the most common use in that format is

mysql_connect('localhost', 'root', 'password') or die(mysql_error());

which trys to connect to mysql and if it fails it returns the error text and exits the script

samarudge 16 Posting Whiz

if you have the width and height set in the peramiters

<iframe width="300px" height="400px">

etc.
Then it should not change size. You may however need to specify that in the style E.G.

<iframe name="Frame" width="400px" height="300px" frameborder="0" src="homepage.html" [B]style="width: 400px; height: 300px;"></[/B]iframe>

If you have any more problems just post back, i never remember 2 unsubscribe threads lol

samarudge 16 Posting Whiz

You create a link in HTML with <a href="somewhere.html">Link</a> But you have to tell it that you want it to change the location (Page) in the frame by giving it a target like this <a href="somewhere.html" target="AnIFrame">Link</a> THe target has to be the name="" peramiter in the iframe tag.

samarudge 16 Posting Whiz

Hi,

thanks for your help on this.

Im getting the following error message:

Parse error: syntax error, unexpected T_STRING in (location) on line 24

line 24 is

mail("paul.white1978@hotmail.com","Email Subject", "From: $email", $msgBody);

I have tried $msgbody with and without brackets.

Thanks

Paul

Please correctly read my code, the lines added were

$msgBody="Name: $name\n BNameEmail: $bname\nAdd: $add\n $email\n\n Message:$message"			 mail("paul.white1978@hotmail.com","Email Subject ", $msgBody, "From: $email");

not

mail("paul.white1978@hotmail.com","Email Subject", "From: $email", $msgBody);
samarudge 16 Posting Whiz
header('Location: '."http://".$_SERVER['HTTP_REFERER']);

Try that one out

samarudge 16 Posting Whiz

This can be achieved using IFrames (Inline Frames or Framesets)
basicaly its a window within a page that can display another page. You could set it up like this

<iframe name="Frame" width="400px" height="300px" frameborder="0" src="homepage.html"></iframe>

That code will embed homepage.html within the 'parent' page. Next we need some links (Anchors) that can change the location of the page. These can be eather within the frame (homepage.html) or in the 'parent' page however you have to tell the browser that you want only the frame to change location not just the whole page. This can be done like this.

<iframe name="Frame" width="400px" height="300px" frameborder="0" src="homepage.html"></iframe>
<p><a href="page1" target="Frame">Page 1</a> &bull; <a href="page2" target="Frame">Page 2</a></p>

Note the peramiter name= within the iframe and the param target= in the anchor. It is very important that these are the same else the whole page will change location

samarudge 16 Posting Whiz

Replace with this code should work:

<?php 
	session_start();
?>
<?php
 	if (isset($_POST['submit'])) {
		if (isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] ==  $_POST['keystring']) {
			 // Grab the form vars
			 $name = (isset($_POST['name'])) ? $_POST['name'] : '' ;			 
			 $email = (isset($_POST['email'])) ? $_POST['email'] : '' ;
			 $org = (isset($_POST['org'])) ? $_POST['org'] : '' ;
			 $bname = (isset($_POST['bname'])) ? $_POST['bname'] : '' ;
			 $add1 = (isset($_POST['add1'])) ? $_POST['add1'] : '' ;
			 $add2 = (isset($_POST['add2'])) ? $_POST['add2'] : '' ;
			 $county = (isset($_POST['county'])) ? $_POST['county'] : '' ;
			 $pcode = (isset($_POST['pcode'])) ? $_POST['pcode'] : '' ;
			 $message = (isset($_POST['message'])) ? $_POST['message'] : '' ;
			 
			 // Check for email injection
			 if (has_emailheaders($email)) {
			  die("Possible email injection occuring");
			 }
			 
			 $msgBody="Name: $name\n BNameEmail: $bname\nAdd: $add\n $email\n\n Message:$message"
			 mail("paul.white1978@hotmail.com","Email Subject ", $msgBody, "From: $email");


 		    $message = 'Your message has been recieved';
    	} else {
    		$message = 'The word verification was not correct.  Please press back and resubmit.';
    	}
	} else {
		$message = 'Please use the contact form for communication';
	}
	
function has_emailheaders($text) {
	return preg_match("/(%0A|%0D|\n+|\r+)(content-type:|to:|cc:|bcc:)/i", $text, $org);
}
?>
</head>
<body>
 <div style="text-align:center">
  <h1>Your message has been sent</h1>
  <h2><?php echo $message; ?></h2>
 </div>
</body></html>

To change the email edit $msgBody, use \n for a new line and just add the variable name to insert it into the email

samarudge 16 Posting Whiz

Try this one out
http://pmsys.sourceforge.net/
Its open source :D

samarudge 16 Posting Whiz

You meen something like the PM system here at Daniweb?
I'm sure there will be loads of systems out there prebuilt for you

samarudge 16 Posting Whiz

Posting to the forums for something like this might not be the best place to do it. Look in the Geeks Lounge forum.
However I have some experience with PHP, AJAX, HTML and Flash and I would enjoy getting envolved in something like that so PM me with your email and we can get in touch. I have a couple of friends who might be interested as well.
Regards,
Sam Rudge

samarudge 16 Posting Whiz

When I set up my first server I used this tutorial
http://www.howtoforge.com/perfect-server-fedora-11-x86_64-ispconfig-2
This contains instructions for all the latest software so you can have an up to date server

samarudge 16 Posting Whiz

Yes PHP Mailer or some other class or PEAR extension to supply SMTP support

samarudge 16 Posting Whiz

Thanx airshow, i guess your solution is kind ov like explode() in PHP but it works perfectly

samarudge 16 Posting Whiz

Clasic examples of rules in spam filters are
If your site is younger that about a year
Your message is in plain text
The email address you are sending from doesn't actualy exist (The server can't send a message back to it)
The SMTP server you are using to send is known for spamming or is on a dynamic IP or an unsecure connection
Hope that helps,
Sam

samarudge 16 Posting Whiz

When you reffer to the security_code what do you mean?
Do you mean some sort of CAPTCHA or something where people enter some sort of password. Pleas be more specific in your posts and possibly post some of the code where you think the error is occuring.

samarudge 16 Posting Whiz

PHP uses ZEND to get data from remote sites (E.G. the Google APIs get data from the google servers) so if ZEND was trying to get data from the Built2go site then it would call an error if their site is down.

samarudge 16 Posting Whiz

Hi,
I have used AJAX lots before and I wondered if it was possible to set variables from an AJAX file E.G. an ajax file could set
var set1 = 10;
var set2 = 55;
with both variables coming from an external file called by AJAX
Could you tell me the JS side for performing the request and the format of the file that is requested.
Regards,
Sam RUdge

samarudge 16 Posting Whiz

Try start>accessories>system tools>system restore and select a date when you didn't have a problem. If that doesn't work post bak on the result/error

samarudge 16 Posting Whiz

This is not a PHP thing, plz move this 2 the Javascript forum and look for the answer there

samarudge 16 Posting Whiz

Most likely not installed properly, do you have a dedicated server?
P.S. If its urgent, don't post it to a forum! People are here for leasure not to solve ur comercial problems

samarudge 16 Posting Whiz

JSP is unable to do this because (As far as I am aware) it does not have an image library. You would need to use PHP GD as a backed or something similar. PHP is the preferred method for handling images unless you want to create a custom app in CGI or PyTHON

samarudge 16 Posting Whiz

No because ../ is up ONE DIR and ./ is same DIR

samarudge 16 Posting Whiz

You need to use seo on the site and submit to search engines. Then get into link sharing programs, ect. That will help make the site more noticeable.

I have some javascript that can do what you want. It seems to work on all major browsers.

That would be really useful. Personaly I'm not very good with Javascript, I'm more of a PHP person, but for the site I really need something similar to the Thumbshots thing that scans all <a> tags and picks out certain tags (Posibly using the rel= attribute) and adds some simple javascript to show a thumbnail. If you are any good with JS then we could kind-of team up, me doing the site and PHP stuff and you sorting out the browser script to show the thumbnails, obviously you can have whatever credit you want on the site and in the code. This might be easyer over email so if you are interested drop me a message @
[removed]
Thanx,
Sam Rudge