ahmksssv 0 Junior Poster in Training

hi,

how can i access the .htaccess file. i have been created a .htaccess file and write the code wat i want. this is working fine when i should type url with correct formate which i mention in the .htaccess file. i want to redirect page automatically.. plz give me some suggestions regarding this...

ahmksssv 0 Junior Poster in Training

hi frnds...


i need to find the users visiting page in my website?

basically i m doing project on Music player...i need to find user listening which movie songs ?


give me some suggestions plz....how to do that?

ahmksssv 0 Junior Poster in Training

Hi ...i m sorry to ask..can u send me the code..if there is no prob to u....

Hi ...

I got every thing wat i want by following ur referances....

i need something more...

i want to display song name, singers like....in the player....if possible buffering time also....plz give me some suggestions...

Thanks..

ahmksssv 0 Junior Poster in Training

All those players are open-source so you can download the source ActionScript 3 files and edit them to your liking, i managed to edit that to get its souce files from an XML source (Dynamicaly)
If you want help with the ActionScript, start a new thread in this forum
http://www.daniweb.com/forums/forum28.html

Hi ...i m sorry to ask..can u send me the code..if there is no prob to u....

ahmksssv 0 Junior Poster in Training

hi frnd...

i want to remove/disable ADDRESS BAR from the new pop up window...

now i m using this code....its working only for IE6.....

window.open(url ,'title',
'location=1,menubar=no,resizable=no,scrollbars=no,status=no ,toolbar=no,width=300,height=200')

Also i want to remove expand button in browser...plz tell me how can i do it...

Thanks in advance...

ahmksssv 0 Junior Poster in Training

It would need to be done in Flash, not Javascript. I am working on a similar project and my player is roughly based on the source of this
http://flash-mp3-player.net/

hi Samarudge,

Thanks a lot...Its working fine...

But here i m facing some problems...


1) here the file name doesn't take SPACES , -...
2)in playlist it displays full path of the song...is there any option to remove this..i want to display file name only...

once again thanks a lot..

Give me some suggestions to solve this problem.

ahmksssv 0 Junior Poster in Training

Hi,

now i m working for musical website...

here my problem is how can i create a playlist and how to pass the selected songs to my player....


i dont have any idea regarding this.. plz give me JAVASCRIPT, php code ...

plz give me some suggestions...sorry for asking code..but i m new to this type of project....

Thanks..

ahmksssv 0 Junior Poster in Training

Hello sir,

Sorry for not getting again...i done what u said perfectly..but again i am getting an extra error as

Warning: imagecreatefromjpeg(../../gallery/allgallerys/Heroines/Naina/thumb/reema-sen-4-51247033438.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in C:\wamp\www\telugu\admin\gallery\thumbnail.php on line 41

and also previous errors are repeated..but, the thumbnail is creating. ..but not good clarity..image lokking damaged...

ahmksssv 0 Junior Poster in Training

Hello cwarn,

thanks 4 ur reply..

I dont know exactly where the error occured..

the errors are:

Warning: imagesx(): supplied argument is not a valid Image resource in C:\wamp\www\telugu\admin\gallery\thumbnail.php on line 42

Warning: imagesy(): supplied argument is not a valid Image resource in C:\wamp\www\telugu\admin\gallery\thumbnail.php on line 43

what is meant by $recourse..plz explian this and check the errors which i phased..

$thumb -> saveImage($thumbpath0,"115","120");

If your refering to the above line being the error line then it would be because you need to specify $recourse in the first parameter and not $path. So try looking up functions like createimagefromgif() for the first parameter input. Basically functions like createimagefromjpeg() load a file into the php file system where it can be used via variables.

ahmksssv 0 Junior Poster in Training

Hi frnds...

here i am getting some error...plz check this one...
these are the two files regarding my code...

thumbnail.php

<?php
class thumbnail {
    var $img;

    function thumbnail($imgfile)
    {
	   
        //detect image format
        $this->img["format"]=ereg_replace(".*\.(.*)$","\\1",$imgfile);
        $this->img["format"]=strtoupper($this->img["format"]);
        if (strtoupper($this->img["format"])=="JPG" || strtoupper($this->img["format"])=="JPEG") {
            //JPEG
            $this->img["format"]="JPEG";
            $this->img["src"] = imagecreatefromjpeg($imgfile);
        
        } elseif ($this->img["format"]=="PNG") {
            //PNG
            $this->img["format"]="PNG";
            $this->img["src"] = @ImageCreateFromPNG ($imgfile);
        } elseif ($this->img["format"]=="GIF") {
            //GIF
            $this->img["format"]="GIF";
            $this->img["src"] = @ImageCreateFromGIF ($imgfile);
        } elseif ($this->img["format"]=="WBMP") {
            //WBMP
            $this->img["format"]="WBMP";
            $this->img["src"] = @ImageCreateFromWBMP ($imgfile);
        } else {
        return 0;
        }
        $this->img["src_width"] = imagesx($this->img["src"]);
        $this->img["src_height"] = imagesy($this->img["src"]);
        
    }
/*$save => containa a path where the thumbnail will be stored ex. sohail/a.png
  $w => width of thumbnail    
  $h => height of thumbnail
*/
    function saveImage($save="",$w,$h)
    {
        
            $old_x=imageSX($save);
            $old_y=imageSY($save);
            if ($old_x > $old_y) {
                $thumb_w=$w;
                $thumb_h=$old_y*($h/$old_x);
            }
            if ($old_x < $old_y) {
                $thumb_w=$old_x*($w/$old_y);
                $thumb_h=$h;
            }
            if ($old_x == $old_y) {
                $thumb_w=$w;
                $thumb_h=$h;
            }
        
        
        $this->img["dest_width"] = $thumb_w ;
        $this->img["dest_height"] = $thumb_h ;
        
        /* change ImageCreateTrueColor to ImageCreate if your GD not supported ImageCreateTrueColor function*/
        $this->img["des"] = imagecreatetruecolor($this->img["dest_width"],$this->img["dest_height"]) ;
       
        @imagecopyresized($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["dest_width"], $this->img["dest_height"], $this->img["src_width"], $this->img["src_height"]);

        if ($this->img["format"]=="JPG" || $this->img["format"]=="JPEG") {
            //JPEG
            

            
            @imagejpeg($this->img["des"],"$save",75);
        } elseif ($this->img["format"]=="PNG") {
            //PNG
            @imagepng($this->img["des"],"$save");
        } elseif ($this->img["format"]=="GIF") {
            //GIF
            @imagegif($this->img["des"],"$save");
        } elseif ($this->img["format"]=="WBMP") {
            //WBMP
            @imagewbmp($this->img["des"],"$save");
        }
    }
}

//End of thumbnail

gallery.php

@$tmp_name0 = $_FILES["attachments4"]["tmp_name"][0];
        @$name0 = $_FILES["attachments4"]["name"][0];
	@$type0=$_FILES["attachments4"]["type"][0];
	 @$size0=$_FILES["attachments4"]["size"][0];

          $title1="../../gallery/allgallerys/$gcategory/$gname";
	
	@move_uploaded_file($tmp_name0, "$title1"."/"."$name0");

if($name0!='')
{	

$thumbpath0="$tpath/thumb/$name0";
$filepath0="$title1/$name0";
$thumb = new thumbnail($filepath0);
[B]$thumb -> saveImage($thumbpath0,"115","120");[/B]
$path="$title"."/"."$name0";
$sql="insert into galleryphotos values('','$gid','$path','$thumbpath0','$date')";
mysql_query($sql)or die(mysql_error());
}

here everything is ok..but my problem is getting warning

ahmksssv 0 Junior Poster in Training

Hi frnds...

here i am confusing a lot..lot...from last 4 days i am struggling here...plz solve this problem aeap with patience....


This is my code for uploading images to my folder and db table...now, all images are blur at my user side...so, i need to create THUMBNAIL images for every image...plz change my code and write code for thumbmail creation..explain it breifly....

<?php
ob_start();
session_start();
include("config.inc.php");
$gcategory=mysql_real_escape_string($_POST['gcategory']);

$gname=mysql_real_escape_string($_POST['gname']);

$date=date('y-m-d');

foreach ($_FILES["attachments4"]["tmp_name"] as $key => $error) 
{
    if ($error == UPLOAD_ERR_OK) 
{

		@$tmp_name0 = $_FILES["attachments4"]["tmp_name"][0];
        @$name0 = $_FILES["attachments4"]["name"][0];
		
		@$tmp_name1 = $_FILES["attachments4"]["tmp_name"][1];
        @$name1 = $_FILES["attachments4"]["name"][1];
		@$tmp_name2 = $_FILES["attachments4"]["tmp_name"][2];
        @$name2 = $_FILES["attachments4"]["name"][2];
		@$tmp_name3 = $_FILES["attachments4"]["tmp_name"][3];
        @$name3 = $_FILES["attachments4"]["name"][3];
		@$tmp_name4 = $_FILES["attachments4"]["tmp_name"][4];
        @$name4 = $_FILES["attachments4"]["name"][4];
		
		@$tmp_name5 = $_FILES["attachments4"]["tmp_name"][5];
        @$name5 = $_FILES["attachments4"]["name"][5];
		@$tmp_name6 = $_FILES["attachments4"]["tmp_name"][6];
        @$name6 = $_FILES["attachments4"]["name"][6];
		@$tmp_name7 = $_FILES["attachments4"]["tmp_name"][7];
        @$name7 = $_FILES["attachments4"]["name"][7];
		
		@$tmp_name8 = $_FILES["attachments4"]["tmp_name"][8];
        @$name8 = $_FILES["attachments4"]["name"][8];
		@$tmp_name9 = $_FILES["attachments4"]["tmp_name"][9];
        @$name9 = $_FILES["attachments4"]["name"][9];

		$title1="../../gallery/allgallerys/$gcategory/$gname";
		
		@move_uploaded_file($tmp_name0, "$title1"."/"."$name0");
	    @move_uploaded_file($tmp_name1, "$title1"."/"."$name1");
		@move_uploaded_file($tmp_name2, "$title1"."/"."$name2");
		@move_uploaded_file($tmp_name3, "$title1"."/"."$name3");
		@move_uploaded_file($tmp_name4, "$title1"."/"."$name4");
	    @move_uploaded_file($tmp_name5, "$title1"."/"."$name5");
		@move_uploaded_file($tmp_name6, "$title1"."/"."$name6");
		@move_uploaded_file($tmp_name7, "$title1"."/"."$name7");
		@move_uploaded_file($tmp_name8, "$title1"."/"."$name8");
		@move_uploaded_file($tmp_name9, "$title1"."/"."$name9");
		}
		}
		

	
$sql="select id from gallerymain where gcategory='$gcategory' and gname='$gname'";
$res=mysql_query($sql)or die(mysql_error());
while($row=mysql_fetch_array($res)){
$gid=$row['id'];
}
$title="allgallerys/$gcategory/$gname";

if($name0!='')
{	
$path="$title"."/"."$name0";
$sql="insert into galleryphotos values('','$gid','$path','$date')";
mysql_query($sql)or die(mysql_error());
}

if($name1!='')
{	
$path="$title"."/"."$name1";
$sql="insert into galleryphotos values('','$gid','$path','$date')";
mysql_query($sql)or die(mysql_error());
}

if($name2!='')
{	
$path="$title"."/"."$name2";
$sql="insert into galleryphotos values('','$gid','$path','$date')";
mysql_query($sql)or die(mysql_error());
}

if($name3!='')
{	
$path="$title"."/"."$name3";
$sql="insert into galleryphotos values('','$gid','$path','$date')";
mysql_query($sql)or die(mysql_error());
}

if($name4!='')
{	
$path="$title"."/"."$name4";
$sql="insert into galleryphotos values('','$gid','$path','$date')";
mysql_query($sql)or die(mysql_error());
}

if($name5!='')
{	
$path="$title"."/"."$name5";
$sql="insert into galleryphotos values('','$gid','$path','$date')";
mysql_query($sql)or die(mysql_error());
}

if($name6!='')
{	
$path="$title"."/"."$name6";
$sql="insert into galleryphotos values('','$gid','$path','$date')";
mysql_query($sql)or …
ahmksssv 0 Junior Poster in Training

Ask to your vendor. Generally, public_html or www or something like this folders are used.

Thanks ..

here i have another doubt?

is there any API regarding stock news instead of software?
means any google path....and call that path to web page?

(or)


i am doing exactly like stock news...instead of s/w , is there any other way? plz give some suggestions...

thanks

ahmksssv 0 Junior Poster in Training

Hi frnds...


i have some problem regarding uploading a s/w when hosting a website...

here i am doing project like stock market news...in this i had a software for updating share prices per every seconds....

where and how can i install software on my hosting panel?

ahmksssv 0 Junior Poster in Training

hi frnds...
i want to know something about php.ini..
what r the regular changes in this file..and functions regarding that changes..plz provide interview tips regarding .htacess file and php.ini file

thanks...

ahmksssv 0 Junior Poster in Training

Hi frnds...

i am trying to know something about Url Rewriting..here i need to load mod_rewrite module...where can i get this..

In this i saw a point as

Open the httpd.conf file and uncomment the following lines (remove the trailing #s):

#LoadModule rewrite_module modules/mod_rewrite.so
#AddModule mod_rewrite.c

...


But in my http.conf file there is no code related to this .

Plz say some thing abt this what u know...which is the best guide to refer...

Thanks...

ahmksssv 0 Junior Poster in Training

hi..plz dont repeat that same thread..
last 2 threads related to urs...i already send some info regarding this...first try to do that...or think is there any other way? try to do by using sessions...

ahmksssv 0 Junior Poster in Training

hello everyone , I am beginner in PHP, I have a problem ,

I have a login page (login.php), where user can enter some necessary information ,after submiting ...it goes to another php page(submit.php) and do something there , ... however on that submit.php it perform some business logic validation .. if it finds some error there ... it should redirect to the login.php page with some error message ( may be more than one error messages).... and the error messages should be display in the top of the login.php page .


i don't want to set the error message in the query string in the time of redirection... since there may be a array of error message ..

please help me .... in this regards with some sample code

hi ..
there is another way to do this ..i.e By using sessions..try to do this by using sessions..

ahmksssv 0 Junior Poster in Training

Hi cwarn23,
Thanks for u reply.
but i am unable to understand what u r tying to say.
Any u xplain me a lot.

@Prawin: May be its single quotes problme or string problem..
can u send ur Sql Query....
Try to echo ur query..

ahmksssv 0 Junior Poster in Training

My system is a stand alone system, I want to connect to MYSQL using PHP, I am giving hostname as localhost, and the needed username and passoword. In the browser i am getting Internal server error 500.


Any sort of help much appreciated,
Thank you

hi..
check the database name is there or not?
Can u send ur code...

ahmksssv 0 Junior Poster in Training

Thanks for reply,
ya sure i will tell u where i am using this.
$loginId=$_REQUEST[user];
$password=$_REQUEST[password];
$_SESSION["userId"]=$loginId;

this is working well on this page in IE and mozilla Firefox
But when i am calling this another page $_SESSION["userId"] in IE this is working well and but not in FireFox.
What is the reason. pls help me. It is very urgent.
Thanks,
Gagan

Hi gagan...
once try by using single quotes...

$loginId=$_REQUEST['user'];
$password=$_REQUEST['password'];
$_SESSION[[B]'[/B]userId[B]'[/B]]=$loginId;
ahmksssv 0 Junior Poster in Training

Hello friends i need help with onclick and onsubmit events

At the bottom of my page I have two button 1)save 2)submit.

When the user click on save button it will go to save_button.php page

When the user click on submit button it will go to submit_button.php but It will check the validation(i have function call validation) of the form and also it should prompt "are you sure want to continue"

Plz help me out

Here is the code

<html>
<body>

<script type="text/javascript">
function validate(form){
 var errors = [];
 
 if ( !checkRadioArray(form.science_soundness) ) {
  errors[errors.length] = "Please select grade for Scientific Soundness.";
 }
 
 if ( !checkRadioArray(form.relevance) ) {
  errors[errors.length] = "Please select grade for Relevance.";
 }
 
 if (errors.length > 0) {
  reportErrors(errors);
  return false;
 }
 
 return true;
}

function checkRadioArray(radioButtons){
 for (var i=0; i < radioButtons.length; i++) {
  if (radioButtons[i].checked) {
   return true;
  }
 }
 return false;
}

function reportErrors(errors){
 var msg = "You forget to select the grade.\n";
 var numError;
 for (var i = 0; i<errors.length; i++) {
  numError = i + 1;
  msg += "\n" + numError + ". " + errors[i];
 }
 alert(msg);
}
</script>

<link href="" rel="stylesheet" type="text/css" />
<form id="loginForm" name="loginForm" method="post" action="assign.php" onsubmit="return validate(this);">


<TABLE WIDTH="90%"  class="statement">
<TR bgcolor="#E0E0E0">
<TD WIDTH="30%" align="center" ><font size="3"><b>Category</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>A</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>A-</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>B+</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>B</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>B-</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>C+</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>C</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>C-</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>D+</TD>
<TD WIDTH="3%" align="center"><font size="3"><b>D</TD>
</TR> …
ahmksssv 0 Junior Poster in Training

create the table

wht are the rows?

CREATE TABLE `table` (
  `id` int(50) NOT NULL auto_increment,
  `topic` text NOT NULL,
  `content` longtext NOT NULL,
  `photo` text NOT NULL,
  `date` datetime NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ;
ahmksssv 0 Junior Poster in Training

this is working but whr is the DB codes i cant solve without the DB codings

plzzz help me

<?php
 	$conn=mysql_connect("localhost","root","");
 	mysql_select_db('dbname',$conn);
	if(!$conn)
{
die("Unable to connect to database!");
}
?>
ahmksssv 0 Junior Poster in Training

this is working but whr is the DB codes i cant solve without the DB codings

plzzz help me

DB codes means?


u want configaration code ? at the top of ur page having database code....

ahmksssv 0 Junior Poster in Training

Hello nav33n,
Thanks For UR Reply , but No RESULT ,Same as of BEFORE .

hi can u check the $filename extention.....extention is there or not?

ahmksssv 0 Junior Poster in Training

sorry....i mean i have a string for example

ssfihuihuiifhhdfhishfihfh jjjjjif ee@gg.com jfiosofjojofjjm ojofjojfc ojjofjojw

From this i want to extract ee@gg.com

Hi..

can u try to using SUBSTRING FUNCTIONS ..i dont know the exact solution..but, if string having hdgfhgfgjh http://aaaa@g.com hdgfhdgfhdfg ....than u can do...ok...

any body knows good solution,plz solve this one...

ahmksssv 0 Junior Poster in Training

i have a long string which contains a url. I want to extract that url from that particular string. Please help me.

Hi ditty....

U can extract by using this way....

1) by using EXPLODE function
2)by using SPLIT function...

eg:

$url="http://info@abc.com";
list(first,second)=split("@",$url,2)
echo $second;

or

$a=explode('@',$url);
$a[1];
ahmksssv 0 Junior Poster in Training

actually you can upload files to the database, but its better to save them on the server.

Hi this is the code for uploading files or images....if u want specific formates plz go to other codes...

here first u create folder for uploading images.....in this example code i created news folder..u can change it...
plz change this code based on ur requirement..

<?php
include_once("dbconnect.php");
$uploaddir="news/";
if(isset($_POST['save']))
	{
	$headline=$_POST['headline'];
	$content=mysql_real_escape_string($_POST['content']);
	$upload_Name1=$_FILES['file']['name'];
	
	 if(file_exists($uploaddir.$upload_Name1)) {  ?>
     
	 <div align="center"><font color="#000000" size="+1">
	 
	 <?php echo "EXISTED FILE NAME, Please rename your files and try again."; ?></font></div> 
	 
	 <?php
			
		}
		else
         {
		 if ($_FILES['file']['name'] != "")
        	{
            $uploadfile = $uploaddir.$_FILES['file']['name'];
			if(move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile))

                {
				$query="insert into news values('','$headline','$content','$upload_Name1',NOW())";
				mysql_query($query) or die(mysql_error());
?>
     <div align="center"><font color="#000000" size="+1"><?php echo "Successfully Saved in our Database"; ?></font></div>           
<?php
				}
			
			}
			
		 }
	
	}
	
	
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>News-JaiPolitics</title>
</head>

<body>
<fieldset>
	
<div  ><font color="#000066" style="font-weight:bold"><a href="news.php">
    News
    </a>| <a href="Logout.php">Logout   </a></font></div>
<table border="0" cellpadding="0" cellspacing="0" width="1024" align="center">




	<tr>
	
            <td width="210" valign="top"></td>
			<td width="10">&nbsp;</td>
			<td class="lakstoppad1" valign="top">

            		<form name="news" action="" method="post"  enctype="multipart/form-data">

                    	

                    	<table border="0" cellpadding="0" cellspacing="1" width="100%" bgcolor="#EEEEEE">

                    		<tr>
                            	<td class="tblhdr" colspan="7" height="24">
                                	News	Post							</td>
                            </tr>
							
							<tr>

                            	<td width="16%" class="tbldt">

                                	Headline<span class="manda">*</span>                                     </td>

                          <td width="84%" class="tbldt">

                   	   <input name="headline" type="text" id="headline" tabindex="1" size="70"/>

								 </td>
                          </tr>

                             <tr>

                            	<td height="197" class="tbldt">

                                	News                                </td>

                            <td class="tbldt">

                                	<textarea id="content" name="content" tabindex="2" style="width:90%" rows="25"></textarea>                                </td>
                            </tr>
<tr>

                            	<td width="16%" class="tbldt">

                                	Photo <span class="manda">*</span>                                     </td>

<td width="84%" class="tbldt">

<input type="file" name="file"/>

									                   </td> …
ahmksssv 0 Junior Poster in Training

ok sorry. lets say test1 == course. test2 == topic. I want to add a course in the database and display it to a drop-down menu(done). After selecting the desired course, we will now add a topic to that course. so from there, if we want to view a course, the topic added to that course will display.

im creating a test bank btw. :)

HI..
first i want to know ..this is right? plz check...

1)display courses in first select box..
2) afeter selecting the course u need to display topics related to that course in second select box..

if the above procedure is right try to using this one...


in this select box display all courses frm database..

<select name="course" id="course" onchange="switchProduct();">
<?php
		include("config.php");
		$row=mysql_query("select distinct course from courses  ")or die(mysql_error());
		
?>
        <?php if(!$cu==""){ ?>
 <option value="<?php echo $cu ; ?>"><?php echo $cu;?></option><?php }else { ?> 
<option value="Select One">Select One</option><?php } ?>
<?php 
		while($res=mysql_fetch_array($row))
		{
		$course1=$res['course'];
		if($cu!=$course){
?>
          <option value="index.php?cu=<?php echo $course1 ; ?>&topic=<?php echo $topic; ?>"><?php echo $course1;?></option>
<?php }}
?>
            </select>

after by using onchange event u can display topics.....
here is the code...

<script language="javascript">
	 function switchProduct()
	 {
	 if(window.document.form1.course.options.selectedIndex!=0)
	 
	 window.location=window.document.form1.course.options[window.document.form1.course.options.selectedIndex].value
	 }
	  
	 
	  </script>

here is second selectbox code.....

$cours= $_GET['course'];
<select name="topic" id="topic">
     
<?php
$course
if($course==""){?>
<option value="Select One">Select Course</option>
<?php }else  { ?> 
 <option value="<?php echo $topic;?>"><?php echo $topic;?></option>
<?php }
		while($res=mysql_fetch_array($row1))
		{
		$topic1=$res['topic']; 
		if($topic==$topic1){}else{
?>
          <option value="<?php echo $topic1;?>"><?php echo $topic1;?></option>
<?php }}
?>
        </select>

If …

ahmksssv 0 Junior Poster in Training

thanks..

how can i "connect" test1 to test 2? example, i already have an id for the test1. i want to connect test2's id to test1... i dont know how to implement it in PHP... XD

Hi...

here what is test1 and test2 ?
explain plz?

ahmksssv 0 Junior Poster in Training

No ahmksssv,
no error throws, say i have some details in name column, address column, email column , fax no column, phone no column and i stored the code no of locations, suppose i want to edit any data regarding to name column i use value="<?php echo $customername; ?>"
here
<td width="80">Username&nbsp;*&nbsp;</td><td><input type="text" name="comp_name" class="textbox" size="30" maxlength="50" title="Enter your name" value="<?php echo $customername; ?>"/></td>

and the same for all the phone no, email fax no. and what i s problem i have is , i got all the results except the address column and select location. and i need ur help in how the get the post value of address and location where i stored in database

Hi.. the above code is correct.....
i think the address field is empty ,due to some reasons....

when u inserting address into database you use this way...

$address=mysql_real_escape_string($_POST['address']);

just try this one....

ahmksssv 0 Junior Poster in Training
<?php
  $result = mysql_query('SELECT MAX(mailer_id),email FROM mailer_directory')or exit(mysql_error()); 
  $row = mysql_fetch_assoc($result);
  echo 'the max mailer_id is ' . $row['email']; 
?>

or:

<?php
  $result = mysql_query('SELECT email FROM mailer_directory ORDER BY mailer_id DESC LIMIT 1')or exit(mysql_error()); 
  $row = mysql_fetch_assoc($result);
  echo 'the max mailer_id is ' . $row['email']; 
?>

Hi... try to do this....

$query="SELECT mailer_id,email FROM mailer_directory where mailer_id=MAX(mailer_id)"
$result = mysql_query('')or exit(mysql_error());
ahmksssv 0 Junior Poster in Training

i am trying to get this code to work but there is something wrong with the array (not to good at these). the main part of the code works it is sending out the email but only ever to one registered user.

Hi..
i dont know the exact solution....but, try to do this...

1) if there is any id in database, try to using id by incrementing.......
2) try to use FOREACH instead of while......


this is just try, i dont know the exact way.....

ahmksssv 0 Junior Poster in Training

hello, how can I display a data (ex. course) in a drop-down list whenever I add a data? thanks!

hi...

from database? or any other way?

can u explain be detail?

from data base, u can get this way.....

$course="aaaaa"; //example...
<select name="course" title="course" value="<?php echo $course; ?>" >
<option value="">Select course</option>
<?php
while($row=mysql_fetch_array($result))
{
?>
<option value="<?php echo $row['course']; ?>"><?php echo $row['course']; ?></option>
<?php
}
?>
</select>
ahmksssv 0 Junior Poster in Training

Hi..
i didnt get u...whats the problem here...have u got any error?
plz note it...

ahmksssv 0 Junior Poster in Training

I'm not very good at MySQL stuff, so I need a little help with a problem I'm having.

I'm trying to make a script that will open up a text file and print the contents of the list onto the screen. Additionally I wanted the contents of the file (a.k.a. what was printed onto the screen) saved as individual rows in a MySQL database.

For the most part this works. But item's #41, #57, and #91 although printed onto the screen, are not entered in the database.

I have absolutely no clue why these three items would not be entered in the table!

Here's the code:
<head><title>Movie's</title></head>
<body>

<?php
//--------------------- Program Start ----------------------------

// Opens file, then sorts contents alphabetically.
$contents = file("./movies.txt");
$nummovies = count($contents);
sort($contents);

// Connects to mysql database.
mysql_connect("localhost","root","[password]") or die ("Unable to connect to MySQL server.");
$db = mysql_select_db("god") or die ("Unable to select requested database.");

for($i = 0; $i < $nummovies; $i++)
{
$currstr = $contents[$i]; // Get the current string from the array.
echo($i . ': ' . $currstr . '<br>'); // Print the string's array index num, then the string.
$query = "INSERT INTO nathan (movie) VALUES ('$i: $currstr')"; // Insert into table. should look identical to above.
mysql_query($query); // Send the query to MySQL server.
}

// Close the connection to the MySQL server.
mysql_close();

//--------------------- Program End ------------------------------
?>

</body>
</html>

Hi....use code …

ahmksssv 0 Junior Poster in Training

Then such people aren't worthy of telling anything at all. Because this community attempts to nurture an environment that makes people learn while helping them. Giving away readymade answers just because someone would not like you telling him "go-read-the-manual", isn't the right approach.

And if you feel that your time is wasted, siting people references from which they can learn, then isn't not posting a good idea to consider ?

@verruckt24 :hi..if anybody post new thread in forums means, its urgent to them...i think pointing to some referance manual is waste of time....Learning depends on their own interest..no body can force them...ok coool....enjoy & learn something by using this forumm..

verruckt24 commented: that's to cool you down +0
ahmksssv 0 Junior Poster in Training

basename is the filename within the path inputed. So say the filename was located /folder1/folder2/folder3/index.php basename would convert it to index.php

Hi Thank u Cwarn....
oooh..its nice...i was struggling many times.... how can i get only filename....now i got it...

Thank u..

ahmksssv 0 Junior Poster in Training
<html>
<head>
<title>Calendar: Add</title>
<META HTTP-EQUIV="refresh" content="1;URL=../../calendar.php">
<LINK rel="stylesheet" type="text/css" name="style" href="../../calendar.css">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<?php

function getMaxKey($db)
{
    $maxKey = 0;
    $sortby = "event_key";
    $result = $db->getall();
    foreach ($result as $item) {
        $key = $item["event_key"];
        if ($key > $maxKey) $maxKey = $key;
    }
    return $maxKey;
}
include ("../../ffdb.inc.php");
$db = new FFDB();
if (!$db->open("../calendar")) {
    $schema = array(array("event_key", FFDB_INT, "key"), array("event_name",
        FFDB_STRING), array("event_description", FFDB_STRING), array("event_submitted_by",
        FFDB_STRING), array("event_month", FFDB_STRING), array("event_day", FFDB_INT),
        array("event_year", FFDB_INT));
    if (!$db->create("calendar", $schema)) {
        echo "Error creating database\n";
        return;
    }
}
if (!file_exists("key.dat")) {
    $newKey = getMaxKey($db);
    $newFile = fopen("key.dat", "w") or die("Can't open file");
    fwrite($newFile, $newKey);
    fclose($newFile);
}
else {
	$fileread = fopen("key.dat", "r") or die("Can't open file");
	$data = (int)fread($fileread, 10);
	fclose($fileread);
	$data++;
	$fileread = fopen("key.dat", "w") or die("Can't open file");
	fwrite($fileread, $data);
	fclose($fileread);
}
$event = stripslashes($event);
$description = stripslashes($description);
$submitted = stripslashes($submitted);
$event = htmlentities($event, ENT_QUOTES);
$submitted = htmlentities($submitted, ENT_QUOTES);
$record["event_key"] = $data;
$record["event_name"] = $event;
$record["event_description"] = $description;
$record["event_submitted_by"] = $submitted;
$record["event_month"] = $month;
list($record["event_day"]) = sscanf($day, "%d");
list($record["event_year"]) = sscanf($year, "%d");
echo ("");
{
    echo $addedTable;

else 
{
    echo ("go back and add event");
}
}
?>
</body>
</html>

Parse error: syntax error, unexpected T_ELSE in E:\domains\h\highweb.co.uk\user\htdocs\geeta\assignments\php\calendar\admin\calAdd.php on line 64

Hi....
The below code having one wrong if condition....u need to open on if conition ....u can not open { for echo....

[B]echo ("");
{[/B]
    echo $addedTable;

else 
{
    echo ("go back and add event");
}
ahmksssv 0 Junior Poster in Training

If you are talking about the line number the die() function is used on then the following is an alternative die function that will show the line number.

function dieline($stringz) {
$dataz=file_get_contents(basename($_SERVER['PHP_SELF']));
$datazz=explode($stringz,$dataz);
$rowz=substr_count($datazz[0], '
'); //must start at beginning of line
die ('<b>Error Line number '.$rowz.'</b><br>'.$stringz);
}
//now to use it
$result=mysql_query('SELEC * FROM `table`') or dieline('Error 001'.mysql_error());

The only thing to keep in mind is that the string you enter into the die function needs to be unique from all the other strings in the file. So the best way to avoid the wrong line number from comming up is having the phrase 'Error 001' before the mysql error reporting except replace the number with a unique number from all the other die() / dieline() functions.

Hi Cwarn...
Can u explain me what is basename...

file_get_contents([B]basename[/B]($_SERVER['PHP_SELF']));
ahmksssv 0 Junior Poster in Training

Thanks! It turns out I needed to specify MemberName in the SELECT area, since the column is in both tables. It should have been:

$sql = "SELECT t_Members.MemberName, FirstName, LastName, Website, Location, Timezone, Bio FROM t_Members, t_MemberBio WHERE t_Members.MemberName=t_MemberBio.MemberName ORDER BY t_Members.MemberName ASC";

hi..once try to use table name before all fields which u want yo fetch... like...

$sql = "SELECT t_Members.MemberName, t_Members.FirstName, t_Members.LastName, t_Members.Website,t_Members. Location, t_Members.Timezone,t_Members. Bio FROM t_Members, t_MemberBio WHERE t_Members.MemberName=t_MemberBio.MemberName ORDER BY t_Members.MemberName ASC";

or

the above one of our frnd said us joins....it is the better method...

ahmksssv 0 Junior Poster in Training

We have integrated Paypal with our application and everything is working perfectly. But after the transaction is completed and successful we need that it should redirect to our application again. But its not happening. We have turned on the auto return option in the paypal too but its still not working.

Please help me out.

Hi...i dont know the exact solution to this..
we have one method to phase this situation what i know...u need to give target is blank in form posting...by using this we can create new window for paypal.....

<form name="aaa" target="_blank">
ahmksssv 0 Junior Poster in Training

Thank u ahmksssv,
It works good for me, I am really appreciate ur work, Thanks a lot , Keep it up.

Welcome....plz mark as solved this thread....

ahmksssv 0 Junior Poster in Training

Hi any one please solve this,
I am new to php, i displayed the datas from db , via select ,
whats the problem i got is , i didnt got the first entry of the database , But it displays Rest of the elements in db.
Here is the code

  1. <?php

  2. /*$link = mysql_connect('localhost', 'root', '');

  3. if (!$link) {

  4. die('Could not connect: ' . mysql_error());

  5. }

  6. mysql_select_db("b2bassociates");*/

  7. include 'dbcon.php';

$qry = "select * from tbl_location order by loc_name";
$result = mysql_query($qry,$con);
if($result)
{
$row=mysql_fetch_array($result);

}
?>
<select name="sel_loc" title="Select Location">
<option value="">----Select Location----</option>
<?php
while($row=mysql_fetch_array($result))
{
?>
<option value="<?php echo $row; ?>"
>
<?php echo $row; ?>
</option>
<?php
}
?>

ie if i have 5 names in the above table named tbl_location , it displays only 4. Please help me.

hi...
plz use code tags....here u have to check 2 ways....
1) u wrote order by loc_name, check location is empty or not?
2)u have to use mysql_fetch_array() only once...
try to use this below code..

<?php
/*$link = mysql_connect('localhost', 'root', ''); 
if (!$link) {
  die('Could not connect: ' . mysql_error());
}
mysql_select_db("b2bassociates");*/
include 'dbcon.php';

$qry = "select * from tbl_location order by loc_name";
$result = mysql_query($qry,$con);
?>
<select name="sel_loc" title="Select Location">
<option value="">----Select Location----</option>
<?php 
while($row=mysql_fetch_array($result))
{ 
?>
   <option value="<?php echo $row['loc_code']; ?>" 
   > …
ahmksssv 0 Junior Poster in Training

Hi....

sry..
in the above code...

<?php
$vedio="vedios/[B]aaa.swf[/B]" ;
?>

is not a php file. its a vedio file.....

ahmksssv 0 Junior Poster in Training

Hi frnds...
I need to integrate php variable with vedio scripting file.....

i fetch my vedio file path from database...here i need to replace the file=videos/movieimgae.swf ....with $vedio..

<?php
$vedio="vedios/aaa.php";

?>
<SCRIPT type=text/javascript>
var s1 = new SWFObject('player.swf','player','400','300','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam('flashvars','file=[B]videos/movieimgae.swf[/B]');
s1.write('preview');
                        </SCRIPT>
ahmksssv 0 Junior Poster in Training

hi
i design a php event calendar

but it showing some error, anyone check it plz..

Parse error: syntax error, unexpected T_ELSE in W:\www\Calendar-php\admin\calAdd.php on line 149

<html>
<head>
<title>Calendar: Add</title>


<META HTTP-EQUIV="refresh" content="1;URL=../calendar.php">
<LINK rel="stylesheet" type="text/css" name="style" href="../calendar.css">
</head>

<body bgcolor="#FFFFFF" text="#000000">



<?php


//returns highest key in the database
function getMaxKey($db) {

$maxKey = 0;

$sortby = "event_key";
$result = $db->getall();

foreach($result as $item){
           $key = $item["event_key"];
           if($key > $maxKey)
              $maxKey = $key;
}

return $maxKey;

}

// Include the FFDB library
include("../ffdb.inc.php");

//open db or create new db
$db = new FFDB();
if (!$db->open("../calendar"))
{
   // Define the database shema.
   // Note that the "last_name" field is our key.
   $schema = array(
      array("event_key", FFDB_INT, "key"),
      array("event_name", FFDB_STRING),
      array("event_description", FFDB_STRING),
      array("event_submitted_by", FFDB_STRING),
      array("event_month", FFDB_STRING),
      array("event_day", FFDB_INT),
      array("event_year", FFDB_INT)
   );

   // Try and create it...
   if (!$db->create("calendar", $schema))
   {
      echo "Error creating database\n";
      return;
   }
}

//if no key file create a new one
if(!file_exists("key.dat"))
{
 $newKey = getMaxKey($db);
 $newFile = fopen("key.dat", "w") Or die("Can't open file");
 fwrite($newFile,$newKey);
 fclose($newFile);

}

//add a record
      //convert forms to record
$fileread = fopen("key.dat", "r")Or die("Can't open file");
$data = (int) fread($fileread, 10);
fclose($fileread);
$data++;
$fileread = fopen("key.dat", "w") Or die("Can't open file");
fwrite($fileread,$data);
fclose($fileread);

//removes escape slashes
   $event = stripslashes($event);
   $description = stripslashes($description);
   $submitted = stripslashes($submitted);

//add html entities
   $event = htmlentities($event,ENT_QUOTES);
   $submitted = htmlentities($submitted,ENT_QUOTES);

   $record["event_key"] = $data;
   $record["event_name"] = $event;
   $record["event_description"] = $description;
   $record["event_submitted_by"] = $submitted;
   $record["event_month"] = $month;
   list($record["event_day"]) = sscanf($day, "%d"); // string -> int
   list($record["event_year"]) = …
ahmksssv 0 Junior Poster in Training

Here is some expectablel solution not sure...
for example , if you have a quantity field then , if we entered any letters on that it will show an immediate alert "Please Enter Only Numbers (0-9)"
if this is your expected solution . then the following is the code for that...if not post clearly....

<form name="exampleform" method="post" action="">
<input name="qty" type="text"  id="qty" value="" onKeyUp="Only_Num(this.id)" size="3" maxlength="5">
</form>

function:

function Only_Num(id)
{
 if(isNaN(document.getElementById(id).value))
 {
  alert("Please Enter Only Numbers (0-9)..");
  document.getElementById(id).value='';
  document.getElementById(id).focus();
 }
 return;
}

Hi frnds..
Sry for posting this question in php forums...
Thank U shanthi for giving quick reply...
Now i can manage by using this one...

Hi naveen..
i am not asking about readymade code..i need just how to use onchange event ...i am having good validation code, but,that is working only on submitting the total form.....anyhow i am sry 4 distrubing u...

Thank u Naveen..

ahmksssv 0 Junior Poster in Training

Hi frnds....

i need Javascript Validations...these validations by using onchange or onblur events..i mean when focus out from a textbox or any field then immediatley shows the error msg and focus will be at error field(not after submitting the form)..i want error immediatley focus out from the field...plz provide 4 or 5 fields, after i can manage...

i am having validations code..but in this way idon't have,basically i am not good in javascript...

plz help me asap..

Thank u...

Hi reply plz..
If u have any problem with my english plz ask me..
this is urgent for me....i have to complete this today only..

plz reply only for 3 or 4 fields...(when we press tab than immediatly display error beside at the text box or alert box..)

Thank u...

ahmksssv 0 Junior Poster in Training

Hi frnds....

i need Javascript Validations...these validations by using onchange or onblur events..i mean when focus out from a textbox or any field then immediatley shows the error msg and focus will be at error field(not after submitting the form)..i want error immediatley focus out from the field...plz provide 4 or 5 fields, after i can manage...

i am having validations code..but in this way idon't have,basically i am not good in javascript...

plz help me asap..

Thank u...