کدهای کاربردی زبان پی اچ پی(php Code)

نویسنده Amir Shahbazzadeh, بعد از ظهر 23:00:54 - 07/24/11

« آموزش جامع ++c | آژاکس چیست؟ *Ajax* »

0 اعضا و 1 مهمان درحال دیدن موضوع.

Amir Shahbazzadeh

كد زير رنگ Background وبلاگتون رو بطور خودكار عوض مي كنه .

<?php
echo "<SCRIPT Language = "JavaScript">
n"

echo 
"
n"

echo 
"    start = new Date();
n"

echo 
"    minstart = start.getMinutes()
n"

echo 
"    secstart = start.getSeconds()
n"

echo 
"     
n"

echo 
"function brighter(){
n"

echo 
"
n"

echo 
"    var now = new Date();
n"

echo 
"
n"

echo 
"    var seconds = now.getSeconds();
n"

echo 
"
n"

echo 
"    var minutes = now.getMinutes();
n"

echo 
"
n"

echo 
"    var base = "00";
n"

echo 
"
n"

echo 
"    var color =  1000;
n"

echo 
"
n"

echo 
"    var interval = 103;
n"

echo 
"
n"

echo 
"    var sec= interval * (seconds - secstart);
n"

echo 
"
n"

echo 
"    var min= 60 * interval * (minutes - minstart);
n"

echo 
"
n"

echo 
"    var add= color   min   sec;           
n"

echo 
"
n"

echo 
"    total= base   add;
n"

echo 
"    if (add>=9999) {secstart = seconds; minstart = minutes}
n"

echo 
"   
n"

echo 
"    document.bgColor = total;
n"

echo 
"    setTimeout("brighter()", 1000);
n"

echo 
"        document.coffeeform.cc.value = total;
n"

echo 
"}
n"

echo 
"</script>
n"

echo 
"</HEAD>
n"

echo 
"<body onLoad = "brighter()" text="white"  LINK="C0C0C0"  VLINK="C0C0C0">
n"

echo 
"<form name="coffeeform">
n"

echo 
"<P>This is the hex code of the current background color
n"

echo 
"<input name = "cc" type="text" size="7">
n"

echo 
"</form>n";
?>

Amir Shahbazzadeh

كد زير جمله اي را در وبلاگتان قرار خواهد داد كه اين جمله متحرك و لرزان است .
جمله ي پيش فرض welcome my to weblog است، كه مي تونيد اون رو به دلخواه خود تغيير دهيد.

<?php
echo "<head>
n"

echo 
"<style>
n"

echo 
".jc{
n"

echo 
"position:relative;
n"

echo 
"}
n"

echo 
"</style>
n"

echo 
"
n"

echo 
"<script language="JavaScript1.2">
n"

echo 
"var ns6=document.getElementById&&!document.all
n"

echo 
"var ie=document.all
n"

echo 
"
n"

echo 
"var customcollect=new Array()
n"

echo 
"var i=0
n"

echo 
"
n"

echo 
"function jiggleit(num){
n"

echo 
"if ((!document.all&&!document.getElementById)) return;
n"

echo 
"customcollect[num].style.left=(parseInt(customcollect[num].style.left)==-1)? customcollect[num].style.left=1 : customcollect[num].style.left=-1
n"

echo 
"}
n"

echo 
"
n"

echo 
"function init(){
n"

echo 
"if (ie){
n"

echo 
"while (eval("document.all.jiggle" i)!=null){
n"

echo 
"customcollect[i]= eval("document.all.jiggle" i)
n"

echo 
"i  
n"

echo 
"} 
n"

echo 
"}
n"

echo 
"else if (ns6){
n"

echo 
"while (document.getElementById("jiggle" i)!=null){
n"

echo 
"customcollect[i]= document.getElementById("jiggle" i)
n"

echo 
"i  
n"

echo 
"}
n"

echo 
"}
n"

echo 
"
n"

echo 
"if (customcollect.length==1)
n"

echo 
"setInterval("jiggleit(0)",80)
n"

echo 
"else if (customcollect.length>1)
n"

echo 
"for (y=0;y<customcollect.length;y  ){
n"

echo 
"var tempvariable='setInterval("jiggleit(' y ')",' '100)'
n"

echo 
"eval(tempvariable)
n"

echo 
"}
n"

echo 
"}
n"

echo 
"
n"

echo 
"window.onload=init
n"

echo 
"
n"

echo 
"</script>
n"

echo 
"</head>
n"

echo 
"
n"

echo 
"<span id="jiggle0" class="jc"><b><font face="Arial" size="5" color="#FF0000">welcome my to weblog</font></b></span>n";
?>

Amir Shahbazzadeh

اين هم اسكريپت ريزش برف.



<?php
echo "<script>
n"

echo 
"// CREDITS:
n"

echo 
"// Snowmaker Copyright (c) 2003 Peter Gehrig. All rights reserved.
n"

echo 
"// Distributed by http://www.hypergurl.com
n"

echo 
"// Permission given to use the script on webpages provided that this notice remains as is.
n"

echo 
"
n"

echo 
"// Set the number of snowflakes (more than 30 - 40 not recommended)
n"

echo 
"var snowmax=35
n"

echo 
"
n"

echo 
"// Set the colors for the snow. Add as many colors as you like
n"

echo 
"var snowcolor=new Array("#aaaacc","#ddddFF","#ccccDD")
n"; 
echo "
n"; 
echo "
// Set the fonts, that create the snowflakes. Add as many fonts as you like
n"; 
echo "
var snowtype=new Array("Arial Black","Arial Narrow","Times","Comic Sans MS")
n"; 
echo "
n"; 
echo "
// Set the letter that creates your snowflake (recommended:*)
n"; 
echo "
var snowletter="*"
n"; 
echo "
n"; 
echo "
// Set the speed of sinking (recommended values range from 0.3 to 2)
n"; 
echo "
var sinkspeed=0.6
n
"; 
echo "
n"; 
echo "
// Set the maximal-size of your snowflaxes
n"; 
echo "
var snowmaxsize=22
n
"; 
echo "
n"; 
echo "
// Set the minimal-size of your snowflaxes
n"; 
echo "
var snowminsize=8
n
"; 
echo "
n"; 
echo "
// Set the snowing-zone
n"; 
echo "
// Set 1 for all-over-snowing, set 2 for left-side-snowing 
n"; 
echo "
// Set 3 for center-snowing, set 4 for right-side-snowing
n"; 
echo "
var snowingzone=3
n
"; 
echo "
n"; 
echo "
///////////////////////////////////////////////////////////////////////////
n"; 
echo "
// CONFIGURATION ENDS HERE
n"; 
echo "
///////////////////////////////////////////////////////////////////////////
n"; 
echo "
n"; 
echo "
n"; 
echo "
// Do not edit below this line
n"; 
echo "
var snow=new Array()
n"; 
echo "
var marginbottom
n
"; 
echo "
var marginright
n
"; 
echo "
var timer
n
"; 
echo "
var i_snow=0
n
"; 
echo "
var x_mv=new Array();
n"; 
echo "
var crds=new Array();
n"; 
echo "
var lftrght=new Array();
n"; 
echo "
var browserinfos=navigator.userAgent 
n
"; 
echo "
var ie5=document.all&&document.getElementById&&!browserinfos.match(/Opera/)
n"; 
echo "
var ns6=document.getElementById&&!document.all
n
"; 
echo "
var opera=browserinfos.match(/Opera/)  
n"; 
echo "
var browserok=ie5||ns6||opera
n
"; 
echo "
n"; 
echo "
function randommaker(range) {
n"; 
echo "
rand=Math.floor(range*Math.random())
n"; 
echo "    
return rand
n
"; 
echo "
}
n"; 
echo "
n"; 
echo "
function initsnow() {
n"; 
echo "
if (ie5 || opera) {
n"; 
echo "
marginbottom document.body.clientHeight
n
"; 
echo "
marginright document.body.clientWidth
n
"; 
echo "
}
n"; 
echo "
else if (ns6) {
n"; 
echo "
marginbottom window.innerHeight
n
"; 
echo "
marginright window.innerWidth
n
"; 
echo "
}
n"; 
echo "
var snowsizerange=snowmaxsize-snowminsize
n
"; 
echo "
for (i=0;i<=snowmax;i  ) {
n"; 
echo "
crds[i] = 0;                      
n"; 
echo "    
lftrght[i] = Math.random()*15;         
n"; 
echo "    
x_mv[i] = 0.03   Math.random()/10;
n"; 
echo "
snow[i]=document.getElementById("s" i)
n"; 
echo "
snow[i].style.fontFamily=snowtype[randommaker(snowtype.length)]
n"; 
echo "
snow[i].size=randommaker(snowsizerangesnowminsize
n
"; 
echo "
snow[i].style.fontSize=snow[i].size
n
"; 
echo "
snow[i].style.color=snowcolor[randommaker(snowcolor.length)]
n"; 
echo "
snow[i].sink=sinkspeed*snow[i].size/5
n
"; 
echo "
if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
n"; 
echo "
if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
n"; 
echo "
if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].sizemarginright/4}
n"; 
echo "
if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].sizemarginright/2}
n"; 
echo "
snow[i].posy=randommaker(2*marginbottom-marginbottom-2*snow[i].size)
n"; 
echo "
snow[i].style.left=snow[i].posx
n
"; 
echo "
snow[i].style.top=snow[i].posy
n
"; 
echo "
}
n"; 
echo "
movesnow()
n"; 
echo "
}
n"; 
echo "
n"; 
echo "
function movesnow() {
n"; 
echo "
for (i=0;i<=snowmax;i  ) {
n"; 
echo "
crds[i]  = x_mv[i];
n"; 
echo "
snow[i].posy =snow[i].sink
n
"; 
echo "
snow[i].style.left=snow[i].posx lftrght[i]*Math.sin(crds[i]);
n"; 
echo "
snow[i].style.top=snow[i].posy
n
"; 
echo "

n"; 
echo "
if (snow[i].posy>=marginbottom-2*snow[i].size || parseInt(snow[i].style.left)>(marginright-3*lftrght[i])){
n"; 
echo "
if (snowingzone==1) {snow[i].posx=randommaker(marginright-snow[i].size)}
n"; 
echo "
if (snowingzone==2) {snow[i].posx=randommaker(marginright/2-snow[i].size)}
n"; 
echo "
if (snowingzone==3) {snow[i].posx=randommaker(marginright/2-snow[i].sizemarginright/4}
n"; 
echo "
if (snowingzone==4) {snow[i].posx=randommaker(marginright/2-snow[i].sizemarginright/2}
n"; 
echo "
snow[i].posy=0
n
"; 
echo "
}
n"; 
echo "
}
n"; 
echo "
var timer=setTimeout("movesnow()",50)
n"; 
echo "
}
n"; 
echo "
n"; 
echo "
for (i=0;i<=snowmax;i  ) {
n"; 
echo "
document.write("<span id='s" "' style='position:absolute;top:-" snowmaxsize "'>" snowletter "</span>")
n"; 
echo "
}
n"; 
echo "
if (browserok) {
n"; 
echo "
window.onload=initsnow
n
"; 
echo "
}
n"; 
echo "
</script>n";
?>

Amir Shahbazzadeh

با استفاده از كد زير نشانگر موس شما به صورت يك قلب خوشكل قرمز در مياد.

<?php
echo "<STYLE TYPE=\"text/css\">p {align=justify}
\n"

echo 
"BODY{cursor: url(http://www.boomspeed.com/sfhelpers/cursors/187.cur);}
\n"

echo 
"a {cursor: url(http://www.boomspeed.com/sfhelpers/cursors/187.cur);}
\n"

echo 
"</STYLE><STYLE TYPE=\"text/css\">p {align=justify}
\n"

echo 
"BODY{cursor: url(http://www.boomspeed.com/sfhelpers/cursors/129.cur);}
\n"

echo 
"a {cursor: url(http://www.boomspeed.com/sfhelpers/cursors/129.cur);}
\n"

echo 
"</STYLE>\n";
?>

Amir Shahbazzadeh

نمايش متن به صورت افكت

<?php
echo "<!-- START OF Zoom Message DHTML -->
n"

echo 
"
n"

echo 
"<!-- SUMMARY BRIEFS
n"

echo 
" This example shows how you can create a webpage
n"

echo 
" that displays lines of text that appear to be 
n"

echo 
" flying out of the webpage.  Our example has an image.
n"

echo 
"
n"

echo 
"     IMPORTANT
n"

echo 
" The image used in this example can be found in the 
n"

echo 
" CoffeeCup Software folder.  You do not need an image
n"

echo 
" for it to work.
n"

echo 
"-->
n"

echo 
"
n"

echo 
"
n"

echo 
"<!-- Style Sheet created with the CoffeeCup StyleSheet Maker   -->
n"

echo 
"<!-- http://www.coffeecup.com -->
n"

echo 
"
n"

echo 
"<head>
n"

echo 
"<style type="text/css">
n"

echo 
"body
n"

echo 
" {
n"

echo 
" background-color:#FFFFFF; 
n"

echo 
" font-family: Arial; 
n"

echo 
" font-size:10pt; 
n"

echo 
" }
n"

echo 
"</style>
n"

echo 
"<script>
n"

echo 
"//<!--Change this text-->
n"

echo 
" text=new Array('welcome','My','To','Weblog')
n"

echo 
"
n"

echo 
"//<!--This is the number of words in your message-->
n"

echo 
" var numText=5
n"

echo 
"
n"

echo 
"//<!--These are the colors the last word will fade to.  The first color is the main color.-->
n"

echo 
" color=new Array('#000000','#2F2F2F','#4F4F4F','#7F7F7F','#408080')
n"

echo 
"
n"

echo 
"//<!--This is the total number of colors from above.-->
n"

echo 
" var numColors=5
n"

echo 
"
n"

echo 
"//<!--This is the size you want the zoom to end at.-->
n"

echo 
" var endSize=70
n"

echo 
"
n"

echo 
"//<!--This is the speed you want it to zoom in.-->
n"

echo 
" var Zspeed=30
n"

echo 
"
n"

echo 
"//<!--This is the speed the colors will fade.-->
n"

echo 
" var Cspeed=200
n"

echo 
"
n"

echo 
"//<!--This is the font of the fade in message.-->
n"

echo 
" var font='Arial Black'
n"

echo 
"
n"

echo 
"//<!--This will allow you to have the message stay or go.  True will make it go.
n"

echo 
"//      False will make it stay.-->
n"

echo 
" var hide=false
n"

echo 
"
n"

echo 
"var size=10
n"

echo 
"var gonum=0
n"

echo 
"var ie, n;
n"

echo 
"if (document.all) {
n"

echo 
" n=0
n"

echo 
" ie=1
n"

echo 
" zoomText='document.all.zoom.innerText=text[num]'
n"

echo 
" zoomSize='document.all.zoom.style.fontSize=size'
n"

echo 
" closeIt=""
n"

echo 
" fadeColor="document.all.zoom.style.color=color[num]"
n"

echo 
" }
n"

echo 
"if (document.layers) {
n"

echo 
" n=1;ie=0
n"

echo 
" zoomText=""
n"

echo 
" zoomSize="document.zoom.document.write('<p align="center" style="font-family:' font '; font-size:' size 'px; color:' color[0'">' text[num'</p>')"
n"

echo 
" closeIt="document.zoom.document.close()"
n"

echo 
" fadeColor="document.zoom.document.write('<p align="center" style="font-family:' font '; font-size:' endSize 'px; color:' color[num'">' text[numText-1'</p>')"
n"

echo 
" }
n"

echo 
"function zoom(num,fn){
n"

echo 
" if (size<endSize){
n"

echo 
" eval(zoomText)
n"

echo 
" eval(zoomSize)
n"

echo 
" eval(closeIt)
n"

echo 
"    size =5;
n"

echo 
" setTimeout("zoom(" num ",'" fn "')",Zspeed)
n"

echo 
" }else{
n"

echo 
"   eval(fn);
n"

echo 
" }
n"

echo 
"}
n"

echo 
"function fadeIt(num){
n"

echo 
" if (num<numColors){
n"

echo 
" eval(fadeColor)
n"

echo 
" eval(closeIt)
n"

echo 
"    num =1;
n"

echo 
" setTimeout("fadeIt(" num ")",Cspeed)
n"

echo 
" }else{
n"

echo 
" hideIt()
n"

echo 
" }
n"

echo 
"}
n"

echo 
"function hideIt(){
n"

echo 
" if(hide){
n"

echo 
" if(ie)document.all.zoom.style.visibility="hidden"
n"

echo 
" if(n)document.layers.zoom.visibility="hidden"
n"

echo 
" }
n"

echo 
"}
n"

echo 
"function init(){
n"

echo 
" if(ie){
n"

echo 
" document.all.zoom.style.color=color[0]
n"

echo 
" document.all.zoom.style.fontFamily=font
n"

echo 
" }
n"

echo 
" if(ie || n) go(0)
n"

echo 
"}
n"

echo 
"function go(num){
n"

echo 
" gonum =1
n"

echo 
" size=10
n"

echo 
" if(num<numText){
n"

echo 
" zoom(num,'go(' gonum ')')
n"

echo 
" }else{
n"

echo 
" fadeIt(0)
n"

echo 
" }
n"

echo 
"}
n"

echo 
"</script>
n"

echo 
"</head>
n"

echo 
"<body onload="init()" bgcolor="FFFFFF">
n"

echo 
"<CENTER> </CENTER><P>
n"

echo 
"<div id="zoom" align="center" style="position:absolutetop:150">
n"

echo 
"</DIV>
n"

echo 
"
n"

echo 
"<!-- END OF Zoom Message DHTML -->n";
?>

Amir Shahbazzadeh

کد برای اتوماتیک maximize شدن صفحه :

<?php
echo "<script>
\n"

echo 
"<!--
\n"

echo 
"top.window.moveTo(0,0);
\n"

echo 
"if (document.all) {
\n"

echo 
"top.window.resizeTo(screen.availWidth,screen.availHeight);
\n"

echo 
"}
\n"

echo 
"else if (document.layers||document.getElementById) {
\n"

echo 
"if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth){
\n"

echo 
"top.window.outerHeight = screen.availHeight;
\n"

echo 
"top.window.outerWidth = screen.availWidth;
\n"

echo 
"}
\n"

echo 
"}
\n"

echo 
"//-->
\n"

echo 
"</script>\n";
?>

Amir Shahbazzadeh

این کد برای اینه که اگه موس رو روی لینک ببرید در پایین صفحه تبلیغش میاد با توضیحاتش . بین head کپی کنید

<?php
echo "<script type="text/javascript">
n"

echo 
"
n"

echo 
"/***********************************************
n"

echo 
"* Bottom slide tooltip- by Ron Grafe (mailto:grafer@REMOVETHIScolumbus.rr.com)
n"

echo 
"* Website URL: [url]http://www.gdevresources.com[/url]
n"

echo 
"* Script modified by and available at Dynamic Drive: [url]http://www.dynamicdrive.com/[/url]
n"

echo 
"***********************************************/
n"

echo 
"
n"

echo 
"//SET TOOLTIP DESCRIPTIONS BELOW
n"

echo 
"//Extend or contract array as needed
n"

echo 
"var description=new Array()
n"

echo 
"description[0]='This is tool-tip description 1'
n"

echo 
"description[1]='<b>This is tool-tip descrition 2'
n"

echo 
"description[2]='<i>This is tool-tip description 3'
n"

echo 
"
n"

echo 
"//Do not edit below here
n"

echo 
"
n"

echo 
"iens6=document.all||document.getElementById
n"

echo 
"ns4=document.layers
n"

echo 
"
n"

echo 
"<!--GLOBAL VARIABLES-->
n"

echo 
"var thename
n"

echo 
"var theobj
n"

echo 
"var thetext
n"

echo 
"var winHeight
n"

echo 
"var winPositionFromTop
n"

echo 
"var winWidth
n"

echo 
"var startH=2
n"

echo 
"var openTimer
n"

echo 
"<!--END GLOBAL VARIABLES-->
n"

echo 
"
n"

echo 
"<!--GLOBAL FUNCTIONS-->
n"

echo 
"
n"

echo 
"function ietruebody(){
n"

echo 
"return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
n"

echo 
"}
n"

echo 
"
n"

echo 
"function setObj(text,theswitch,inwidth,inheight) {
n"

echo 
" thetext=text
n"

echo 
" if(iens6){
n"

echo 
" thename = "viewer"
n"

echo 
" theobj=document.getElementById? document.getElementById(thename):document.all.thename
n"

echo 
" winHeight=100
n"

echo 
" if(iens6&&document.all) {
n"

echo 
" winPositionFromTop=!window.opera? ietruebody().clientHeight : document.body.clientHeight
n"

echo 
" winWidth=(ietruebody().clientWidth-ietruebody().leftMargin)
n"

echo 
" }
n"

echo 
" if(iens6&&!document.all) {
n"

echo 
" winPositionFromTop=window.innerHeight
n"

echo 
" winWidth=(window.innerWidth-(ietruebody().offsetLeft 30))
n"

echo 
" }
n"

echo 
" if(theswitch=="override") {
n"

echo 
" winWidth=inwidth
n"

echo 
" winHeight=inheight
n"

echo 
" }
n"

echo 
" theobj.style.width=winWidth "px"
n"

echo 
" theobj.style.height=startH "px"
n"

echo 
" if(iens6&&document.all) {
n"

echo 
" theobj.style.top=ietruebody().scrollTop winPositionFromTop "px"
n"

echo 
" //window.status=winPositionFromTop
n"

echo 
" theobj.innerHTML = ""
n"

echo 
" theobj.insertAdjacentHTML("BeforeEnd","<table cellspacing=0 width=" winWidth " height=" winHeight " border=1><tr><td width=100valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" thetext "</font></td></tr></table>")
n"

echo 
" }
n"

echo 
" if(iens6&&!document.all) {
n"

echo 
" theobj.style.top=window.pageYOffset winPositionFromTop "px"
n"

echo 
" theobj.innerHTML = ""
n"

echo 
" theobj.innerHTML="<table cellspacing=0 width=" winWidth " height=" winHeight " border=1><tr><td width=100valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" thetext "</font></td></tr></table>"
n"

echo 
" }
n"

echo 
" }
n"

echo 
" if(ns4){
n"

echo 
" thename = "nsviewer"
n"

echo 
" theobj = eval("document." thename)
n"

echo 
" winPositionFromTop=window.innerHeight
n"

echo 
" winWidth=window.innerWidth
n"

echo 
" winHeight=100
n"

echo 
" if(theswitch=="override") {
n"

echo 
" winWidth=inwidth
n"

echo 
" winHeight=inheight
n"

echo 
" }
n"

echo 
" theobj.moveTo(0,eval(window.pageYOffset winPositionFromTop))
n"

echo 
" theobj.width=winWidth
n"

echo 
" theobj.clip.width=winWidth
n"

echo 
" theobj.document.write("<table cellspacing=0 width=" winWidth " height=" winHeight " border=1><tr><td width=100valign=top><font type='times' size='2' style='color:black;font-weight:normal'>" thetext "</font></td></tr></table>")
n"

echo 
" theobj.document.close()
n"

echo 
" }
n"

echo 
" viewIt()
n"

echo 
"}
n"

echo 
"
n"

echo 
"function viewIt() {
n"

echo 
" if(startH<=winHeight) {
n"

echo 
" if(iens6) {
n"

echo 
" theobj.style.visibility="visible"
n"

echo 
" if(iens6&&document.all) {
n"

echo 
" theobj.style.top=(ietruebody().scrollTop winPositionFromTop)-startH "px"
n"

echo 
" }
n"

echo 
" if(iens6&&!document.all) {
n"

echo 
" theobj.style.top=(window.pageYOffset winPositionFromTop)-startH "px"
n"

echo 
" }
n"

echo 
" theobj.style.height=startH "px"
n"

echo 
" startH =2
n"

echo 
" openTimer=setTimeout("viewIt()",10)
n"

echo 
" }
n"

echo 
" if(ns4) {
n"

echo 
" theobj.visibility = "visible"
n"

echo 
" theobj.moveTo(0,(eval(window.pageYOffset winPositionFromTop)-startH))
n"

echo 
" theobj.height=startH
n"

echo 
" theobj.clip.height=(startH)
n"

echo 
" startH =2
n"

echo 
" openTimer=setTimeout("viewIt()",10)
n"

echo 
" }
n"

echo 
" }else{
n"

echo 
" clearTimeout(openTimer)
n"

echo 
" }
n"

echo 
"}
n"

echo 
"
n"

echo 
"function stopIt() {
n"

echo 
" if(iens6) {
n"

echo 
" theobj.innerHTML = ""
n"

echo 
" theobj.style.visibility="hidden"
n"

echo 
" startH=2
n"

echo 
" }
n"

echo 
" if(ns4) {
n"

echo 
" theobj.document.write("")
n"

echo 
" theobj.document.close()
n"

echo 
" theobj.visibility="hidden"
n"

echo 
" theobj.width=0
n"

echo 
" theobj.height=0
n"

echo 
" theobj.clip.width=0
n"

echo 
" theobj.clip.height=0
n"

echo 
" startH=2
n"

echo 
" }
n"

echo 
"}
n"

echo 
"<!--END GLOBAL FUNCTIONS-->
n"

echo 
"</script>n";
?>

Amir Shahbazzadeh

کدی برای گذاشتن دکمه ارسال ایمیل ...

<?php
echo "<BODY>
\n"

echo 
"<FORM>
\n"

echo 
"<INPUT TYPE=\"button\" VALUE=\"متن روی دکمه\" onClick=\"parent.location='mailto:ایمیل شما?subject=This goes to the subject'\">
\n"

echo 
"</FORM>\n";
?>

Amir Shahbazzadeh

اینم کد یک منوی متنی و تقریبا زیبا .

<?php
echo "<HEAD>
n"

echo 
"<style type="text/css">
n"

echo 
".menutitle{
n"

echo 
"cursor:pointer;
n"

echo 
"margin-bottom: 5px;
n"

echo 
"background-color:#ECECFF;
n"

echo 
"color:#000000;
n"

echo 
"width:140px;
n"

echo 
"padding:2px;
n"

echo 
"text-align:center;
n"

echo 
"font-weight:bold;
n"

echo 
"/*/*/border:1px solid #000000;/* */
n"

echo 
"}
n"

echo 
"
n"

echo 
".submenu{
n"

echo 
"margin-bottom: 0.5em;
n"

echo 
"}
n"

echo 
"</style>
n"

echo 
"
n"

echo 
"<script type="text/javascript">
n"

echo 
"
n"

echo 
"/***********************************************
n"

echo 
"* Switch Menu script- by Martial B of [url=http://getElementById.com/]http://getElementById.com/[/url]
n"

echo 
"* Modified by Dynamic Drive for format & NS4/IE4 compatibility
n"

echo 
"* Visit [url=http://www.dynamicdrive.com/]http://www.dynamicdrive.com/[/url] for full source code
n"

echo 
"***********************************************/
n"

echo 
"
n"

echo 
"var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
n"

echo 
"var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
n"

echo 
"
n"

echo 
"if (document.getElementById){ //DynamicDrive.com change
n"

echo 
"document.write('<style type="text/css">n')
n"

echo 
"document.write('.submenu{display: none;}n')
n"

echo 
"document.write('</style>n')
n"

echo 
"}
n"

echo 
"
n"

echo 
"function SwitchMenu(obj){
n"

echo 
" if(document.getElementById){
n"

echo 
" var el = document.getElementById(obj);
n"

echo 
" var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
n"

echo 
" if(el.style.display != "block"){ //DynamicDrive.com change
n"

echo 
" for (var i=0; i<ar.length; i  ){
n"

echo 
" if (ar[i].className=="submenu") //DynamicDrive.com change
n"

echo 
" ar[i].style.display = "none";
n"

echo 
" }
n"

echo 
" el.style.display = "block";
n"

echo 
" }else{
n"

echo 
" el.style.display = "none";
n"

echo 
" }
n"

echo 
" }
n"

echo 
"}
n"

echo 
"
n"

echo 
"function get_cookie(Name) { 
n"

echo 
"var search = Name   "="
n"

echo 
"var returnvalue = "";
n"

echo 
"if (document.cookie.length > 0) {
n"

echo 
"offset = document.cookie.indexOf(search)
n"

echo 
"if (offset != -1) { 
n"

echo 
"offset  = search.length
n"

echo 
"end = document.cookie.indexOf(";", offset);
n"

echo 
"if (end == -1) end = document.cookie.length;
n"

echo 
"returnvalue=unescape(document.cookie.substring(offset, end))
n"

echo 
"}
n"

echo 
"}
n"

echo 
"return returnvalue;
n"

echo 
"}
n"

echo 
"
n"

echo 
"function onloadfunction(){
n"

echo 
"if (persistmenu=="yes"){
n"

echo 
"var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
n"

echo 
"var cookievalue=get_cookie(cookiename)
n"

echo 
"if (cookievalue!="")
n"

echo 
"document.getElementById(cookievalue).style.display="block"
n"

echo 
"}
n"

echo 
"}
n"

echo 
"
n"

echo 
"function savemenustate(){
n"

echo 
"var inc=1, blockid=""
n"

echo 
"while (document.getElementById("sub" inc)){
n"

echo 
"if (document.getElementById("sub" inc).style.display=="block"){
n"

echo 
"blockid="sub" inc
n"

echo 
"break
n"

echo 
"}
n"

echo 
"inc  
n"

echo 
"}
n"

echo 
"var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
n"

echo 
"var cookievalue=(persisttype=="sitewide")? blockid ";path=/" : blockid
n"

echo 
"document.cookie=cookiename "=" cookievalue
n"

echo 
"}
n"

echo 
"
n"

echo 
"if (window.addEventListener)
n"

echo 
"window.addEventListener("load", onloadfunction, false)
n"

echo 
"else if (window.attachEvent)
n"

echo 
"window.attachEvent("onload", onloadfunction)
n"

echo 
"else if (document.getElementById)
n"

echo 
"window.onload=onloadfunction
n"

echo 
"
n"

echo 
"if (persistmenu=="yes" && document.getElementById)
n"

echo 
"window.onunload=savemenustate
n"

echo 
"
n"

echo 
"</script>
n"

echo 
"<!-- Keep all menus within masterdiv-->
n"

echo 
"<div id="masterdiv">
n"

echo 
"
n"

echo 
" <div class="menutitle" onclick="SwitchMenu('sub1')">Site Menu</div>
n"

echo 
" <span class="submenu" id="sub1">
n"

echo 
" - <a href="new.htm">What's New</a><br>
n"

echo 
" - <a href="hot.htm">What's hot</a><br>
n"

echo 
" - <a href="revised.htm">Revised Scripts</a><br>
n"

echo 
" - <a href="morezone/">More Zone</a>
n"

echo 
" </span>
n"

echo 
"
n"

echo 
" <div class="menutitle" onclick="SwitchMenu('sub2')">FAQ/Help</div>
n"

echo 
" <span class="submenu" id="sub2">
n"

echo 
" - <a href="notice.htm">Usage Terms</a><br>
n"

echo 
" - <a href="faqs.htm">DHTML FAQs</a><br>
n"

echo 
" - <a href="help.htm">Scripts FAQs</a>
n"

echo 
" </span>
n"

echo 
"
n"

echo 
" <div class="menutitle" onclick="SwitchMenu('sub3')">Help Forum</div>
n"

echo 
" <span class="submenu" id="sub3">
n"

echo 
" - <a href="http://www.codingforums.com">Coding Forums</a><br>
n"; 
echo "
</span>
n"; 
echo "

n"; 
echo "
<div class="menutitle" onclick="SwitchMenu('sub4')">Cool Links</div>
n"; 
echo "
<span class="submenu" id="sub4">
n"; 
echo "
- <a href="http://www.javascriptkit.com">JavaScript Kit</a><br>
n"; 
echo "
- <a href="http://www.freewarejava.com">Freewarejava</a><br>
n"; 
echo "
- <a href="http://www.cooltext.com">Cool Text</a><br>
n"; 
echo "
- <a href="http://www.google.com">Google.com</a>
n"; 
echo "
</span>
n"; 
echo "
n"; 
echo "
<img src="about.gif" onclick="SwitchMenu('sub5')"><br>
n"; 
echo "
<span class="submenu" id="sub5">
n"; 
echo "
- <a href="http://www.dynamicdrive.com/link.htm">Link to DD</a><br>
n"; 
echo "
- <a href="http://www.dynamicdrive.com/recommendit/">Recommend Us</a><br>
n"; 
echo "
- <a href="http://www.dynamicdrive.com/contact.htm">Email Us</a><br>
n"; 
echo "
</span>
n"; 
echo "
n"; 
echo "
</div>n";
?>

Amir Shahbazzadeh

اینم کد یک منو ی متحرک که در سمت راست سایتتون قرار می گیره .

<?php
echo "</BODY>
n"

echo 
"<script>
n"

echo 
"if (!document.layers)
n"

echo 
"document.write('<div id="divStayTopLeft" style="position:absolute">')
n"

echo 
"</script>
n"

echo 
"
n"

echo 
"<layer id="divStayTopLeft">
n"

echo 
"
n"

echo 
"<!--EDIT BELOW CODE TO YOUR OWN MENU-->
n"

echo 
"<table border="1" width="130" cellspacing="0" cellpadding="0">
n"

echo 
"  <tr>
n"

echo 
"    <td width="100%" bgcolor="#FFFFCC">
n"; 
echo "      
<p align="center"><b><font size="4">Menu</font></b></td>
n"; 
echo "  
</tr>
n"; 
echo "  
<tr>
n"; 
echo "    
<td width="100%" bgcolor="#FFFFFF">
n"; 
echo "      
<p align="left"> <a href="http://www.dynamicdrive.com">Dynamic Drive</a><br>
n"; 
echo "       
<a href="http://www.dynamicdrive.com/new.htm">What's New</a><br>
n"; 
echo "       <a href="http://www.dynamicdrive.com/hot.htm">What'
s Hot</a><br>
n"; 
echo "       
<a href="http://www.dynamicdrive.com/faqs.htm">FAQs</a><br>
n"; 
echo "       
<a href="http://www.dynamicdrive.com/morezone/">More Zone</a></td>
n"; 
echo "  
</tr>
n"; 
echo "
</table>
n"; 
echo "
<!--END OF EDIT-->
n"; 
echo "
n"; 
echo "
</layer>
n"; 
echo "
n"; 
echo "
n"; 
echo "
<script type="text/javascript">
n"; 
echo "
n"; 
echo "
/*
n"; 
echo "Floating Menu script-  Roy Whittle (http://www.javascript-fx.com/)
n"; 
echo "Script featured on/available at http://www.dynamicdrive.com/
n"; 
echo "This notice must stay intact for use
n"; 
echo "*/
n"; 
echo "
n"; 
echo "
//Enter "frombottom" or "fromtop"
n"; 
echo "
var verticalpos="frombottom"
n"; 
echo "
n"; 
echo "
if (!document.layers)
n"; 
echo "
document.write('</div>')
n"; 
echo "
n"; 
echo "
function JSFX_FloatTopDiv()
n"; 
echo "
{
n"; 
echo "
var startX 3,
n"; 
echo "
startY 150;
n"; 
echo "
var ns = (navigator.appName.indexOf("Netscape") != -1);
n"; 
echo "
var document;
n"; 
echo "
function ml(id)
n"; 
echo "
{
n"; 
echo "
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
n"; 
echo "
if(d.layers)el.style=el;
n"; 
echo "
el.sP=function(x,y){this.style.left=x;this.style.top=y;};
n"; 
echo "
el.startX;
n"; 
echo "
if (verticalpos=="fromtop")
n"; 
echo "
el.startY;
n"; 
echo "
else{
n"; 
echo "
el.ns pageYOffset   innerHeight document.body.scrollTop   document.body.clientHeight;
n"; 
echo "
el.-= startY;
n"; 
echo "
}
n"; 
echo "
return el;
n"; 
echo "
}
n"; 
echo "
window.stayTopLeft=function()
n"; 
echo "
{
n"; 
echo "
if (verticalpos=="fromtop"){
n"; 
echo "
var pY ns pageYOffset document.body.scrollTop;
n"; 
echo "
ftlObj.y  = (pY   startY ftlObj.y)/8;
n"; 
echo "
}
n"; 
echo "
else{
n"; 
echo "
var pY ns pageYOffset   innerHeight document.body.scrollTop   document.body.clientHeight;
n"; 
echo "
ftlObj.y  = (pY startY ftlObj.y)/8;
n"; 
echo "
}
n"; 
echo "
ftlObj.sP(ftlObj.xftlObj.y);
n"; 
echo "
setTimeout("stayTopLeft()"10);
n"; 
echo "
}
n"; 
echo "
ftlObj ml("divStayTopLeft");
n"; 
echo "
stayTopLeft();
n"; 
echo "
}
n"; 
echo "
JSFX_FloatTopDiv();
n"; 
echo "
</script>n";
?>

Tags:

Share via facebook Share via linkedin Share via telegram Share via twitter Share via whatsapp

https://www.meta4u.com/forum/Themes/Comet/images/post/clip.png
دانلود مود کاربردی Yahoo and MSN Search BBC Tag برای SMF, بخش BBC CODE

نویسنده Amir Shahbazzadeh در افزونه های اس ام اف

0 ارسال
2289 مشاهده
آخرین ارسال: قبل از ظهر 11:17:33 - 10/29/11
توسط
Amir Shahbazzadeh
https://www.meta4u.com/forum/Themes/Comet/images/post/xx.png
کد های کاربردی زبان XML

نویسنده Amir Shahbazzadeh در زبان های برنامه نویسی

0 ارسال
1771 مشاهده
آخرین ارسال: قبل از ظهر 10:11:10 - 08/11/11
توسط
Amir Shahbazzadeh
https://www.meta4u.com/forum/Themes/Comet/images/post/xx.png
دانلود پروژه فروشگاه اینترنتی با زبان php

نویسنده Zohreh Gholami در دانلود سنتر بخش کامپیوتر

0 ارسال
4470 مشاهده
آخرین ارسال: قبل از ظهر 08:57:25 - 12/03/11
توسط
Zohreh Gholami
https://www.meta4u.com/forum/Themes/Comet/images/post/xx.png
سورس کدهای زبان c

نویسنده mohammad a در زبان های برنامه نویسی

10 ارسال
5009 مشاهده
آخرین ارسال: بعد از ظهر 13:45:22 - 12/25/11
توسط
aria_com63
https://www.meta4u.com/forum/Themes/Comet/images/post/xx.png
ارسال ایمیل - خطای X-PHP-Originating-Script: Subs-Post.php

نویسنده lakap در مدیریت محتوای Simple Machines

1 ارسال
3760 مشاهده
آخرین ارسال: بعد از ظهر 14:36:37 - 08/11/17
توسط
متا
https://www.meta4u.com/forum/Themes/Comet/images/post/xx.png
php چیست؟ و php چه کارهایی می تواند انجام دهد؟

نویسنده parsaw در مقالات کامپیوتر, Computer Articles

0 ارسال
1706 مشاهده
آخرین ارسال: بعد از ظهر 14:31:12 - 12/08/16
توسط
parsaw
https://www.meta4u.com/forum/Themes/Comet/images/post/clip.png
خطای Code 0xc0000098 در ویندوز ۱۰

نویسنده متا در سیستم عامل ویندوز 11 و 10 و 8 Windows

0 ارسال
1601 مشاهده
آخرین ارسال: بعد از ظهر 18:04:40 - 07/07/17
توسط
متا