708 Posted Topics

Member Avatar for talisien

Do you have to use php authentication? A simple session login system would make it so you can stop people from getting images ect. from other peoples folders.

Member Avatar for talisien
0
96
Member Avatar for rupeshpradhan

Are you wanting a list of folders on the clients computer or the server? If server, then you can use php, html, and some javascript to create a pop-up kind of like that (same functionality).

Member Avatar for somedude3488
0
117
Member Avatar for anarki2k3

You haven't defined $siteconn within the function. Mostly likely you need to put [icode]global $siteconn[/icode] at the top of the function. [code] function CreateMenu($main, $limit) { global $siteconn; [/code]

Member Avatar for anarki2k3
0
357
Member Avatar for anuj_sharma
Member Avatar for anuj_sharma

How I avoid this is by submitting the form to the same page. After the login is successful I use the header() function to redirect the members area. If they press back there won't be any post data to give that "Web page has expired" crap. Also, put some logic …

Member Avatar for somedude3488
0
62
Member Avatar for brianzet

Why are you making a new table for each post? I think you don't understand how a database works. You might want to research that a bit before trying to create a blog/cms.

Member Avatar for brianzet
0
198
Member Avatar for gingank

What do you mean by php can't display image? Are you trying to serve images files with php?

Member Avatar for zapid
0
80
Member Avatar for samarudge

I have a website I am building right now, that needs something like this. When I get to that point in development, I will let you know how it goes. Also, how did you do it?

Member Avatar for somedude3488
0
122
Member Avatar for TommyBs

Yes you will have to pass it to every class. You can use global but its not recommended. If you really want the best solution, look into the singleton method. Its what I have been using for a while now and it has saved me so much development time.

Member Avatar for kvprajapati
0
120
Member Avatar for keepbusy

I would use post for something like this. I am not sure how the url handles newlines. Also, mysql_real_escape_string messes up line breaks. You need to run nl2br before inserting into the database.

Member Avatar for keepbusy
0
102
Member Avatar for justted

Its pretty secure. Adding more info and creating extra session is unnecessary overhead. The best way to prevent this is to run session_regenerate_id(true). [kireol explains everything nicely, I posted at the same time. Didn't see that post]

Member Avatar for somedude3488
0
109
Member Avatar for nikhita
Member Avatar for nish123

How about process the form on the same page. Why does it need to be submitted to another page?

Member Avatar for nish123
0
130
Member Avatar for navi17

According to wikipedia (I know, not the best place for info) 3-tier consists of the presentation tier, application logic (business logic, ect) tier, and data tier. This is pretty much the workings of a webserver. Presentation tier is anything outputted to the browser, application logic is the php code itself, …

Member Avatar for navi17
0
154
Member Avatar for Aamit
Member Avatar for digital-ether
0
397
Member Avatar for lauriedk

What is this for? School? Why not search for a mysql tutorial. It will show you everything you need to know.

Member Avatar for Josh Connerty
0
177
Member Avatar for ShawnCplus

[QUOTE=cwarn23;864640]Also, you may want to note that the following script commonly used will cause an error on some servers: [CODE=php]//mysql connections $result=mysql_query('SELECT * FROM `table`'); while ($row=mysql_fetch_array($result)) { echo 'test didn't work. There shouldn't be any rows in the table.'; break; }[/CODE] Instead the following should be used: [CODE=php]//mysql connections …

Member Avatar for digital-ether
6
4K
Member Avatar for sayakyi

Error is: [code] echo"<th>".{$data['engword']}."</td>"; [/code] and you don't need () around the stripslashes function.

Member Avatar for sayakyi
-1
10K
Member Avatar for ShawnCplus

I would have to better understand how its used, like in what type of application, before I can help clean it up. I personally can't think of any reason for it.

Member Avatar for ShawnCplus
0
113
Member Avatar for arosemena
Member Avatar for Tulsa
0
78
Member Avatar for kris82009
Member Avatar for denxioz
Re: HELP

[url=http://www.lmgtfy.com/?q=php%20tutorials]Try This[/url]

Member Avatar for ShawnCplus
0
85
Member Avatar for BzzBee

Just have php echo out the xml. Its pretty easy. Loop through the db records and display them in a xml format. Send the proper headers and you have an dynamic xml file.

Member Avatar for somedude3488
0
80
Member Avatar for m-hrt

Look into mysql joins or using the where clause and table aliases. Ex. [code] SELECT * FROM trip t,seat s,user_information u WHERE t.id = s.id AND t.id = u.id [/code]

Member Avatar for m-hrt
0
178
Member Avatar for dipakxyz

I am not a c++ guy but since the languages are similar I thought I'd give it a try. There are a few things I don't know yet, they are commented. If you can explain what they do, I can probably tell you the equivalent in php. [code] function print_combinations( …

Member Avatar for dipakxyz
0
143
Member Avatar for Venom Rush
Member Avatar for Venom Rush
0
71
Member Avatar for justted

Yes and no. Certain server configurations may allow them to hack variables (register_globals), but most servers have this turned off since its deprecated and is soon to be removed as of php6. You can disable this in the php.ini (and you should just as added security). As long as you …

Member Avatar for justted
0
132
Member Avatar for angelic_devil

Try this: Change [code] $thumbnail = "<img src= ".$thumb_image.">"; echo $thumbnail; echo " image thumbnail "; [/code] to [code] header('Content-Type: image/jpeg'); echo $thumb_image; exit; [/code] Thats usually what I use to output images, but you have used some different functions which I am not familiar with.

Member Avatar for cwarn23
0
128
Member Avatar for tanmoy_india

Can you explain what you are doing (not the table structure)? That way we can make sure the table setup is correct and there is not an easier way.

Member Avatar for tanmoy_india
0
86
Member Avatar for genieuk

You are not even running the update query. Its just a string. You need to put it into the mysql_query function. If you run into problems like this again, take a break and then come back and look at the code again. You will see silly mistakes like that. You …

Member Avatar for genieuk
0
107
Member Avatar for angelic_devil

On line 74 there is an extra ". This could be making the form fail. I didn't look at the rest of the code very much, so there might be another problem.

Member Avatar for angelic_devil
0
104
Member Avatar for sangdedi

[QUOTE=BzzBee;867920]$answer1=$_REQUEST['chk1']; $answer2=$_REQUEST['chk2']; $answer3=$_REQUEST['chk3']; $answer4=$_REQUEST['chk4']; for example [CODE] if($answer1=='yes') { $question_area=2; } if($answer2=='yes') { $question_area=3; } if($answer1=='yes') { $question_area=4; } <form name="frm" action="" method="post" > <? if($question_area==2) { ?> here is question2? <input type="checkbox" value="yes" name="chk1" /><br /><br /> <input type="checkbox" value="no" name="chk1" /><br /><br /> <input type="submit" name="btn" value="Submit" /> …

Member Avatar for somedude3488
0
672
Member Avatar for Aamit

What about the array_count_values() function? I have never used it, but I seems to be what you are looking for. Does anyone on this forum check php.net at all? Here is the hard way: [code] $array = array( 140,123,34,140,23,123,140,140,123 ); $data = array(); foreach( $array as $val ) { if …

Member Avatar for BzzBee
0
110
Member Avatar for otreborid

Why are you putting global in the if statement. That doesn't need to be there. You are also trying to get $_POST variables without them being set since the form hasn't been submitted. This will throw a warning of undefined index. This code: [code] '<form action="<?php echo $PHP_SELF;?>" method="post">' ; …

Member Avatar for BzzBee
0
87
Member Avatar for crsukla

That means that your time string is invalid. It can't read it. Have you looked at [url=http://us2.php.net/strtotime]php.net[/url]?

Member Avatar for BzzBee
0
86
Member Avatar for davewylie

Be aware that hover in css on non anchor tags does not work well on all browsers. I had this problem with my last site.

Member Avatar for somedude3488
0
163
Member Avatar for tanha
Member Avatar for welbyobeng

Just a guess, but are you wanting something like this [code] <?php $array = array(); $query = mysql_query( "SELECT advertisement.adver_name, customer.number_customer FROM advertisement INNER JOIN customer ON advertisement.adver_id = customer.adver_id" ); while( list( $name,$number ) = mysql_fetch_row( $query ) ) { $array[$name] = $number; } print_r( $array ); ?> [/code]

Member Avatar for welbyobeng
0
107
Member Avatar for veledrom
Member Avatar for genieuk

[search]FCKeditor[/search] is free. [search]TinyMCE[/search] is also I think. Not all features are though if I remember correctly. Here is a comparison chart: [url]http://geniisoft.com/showcase.nsf/WebEditors[/url] You can find so much using a search engine such as google.

Member Avatar for itisnot_me
0
123
Member Avatar for odysea

First of all, why? I would just insert the data, then use mysql_insert_id() to get the id. But if you really need to get it before, here is a function: [code] function getNextID() { $query = mysql_query("SELECT `id` FROM `table_name` ORDER BY `id` DESC LIMIT 1") or die(mysql_error()); if ( …

Member Avatar for odysea
0
155
Member Avatar for justted

Here is an session login example I made a few months ago. [url]http://www.daniweb.com/forums/post832028-20.html[/url] and [url]http://www.daniweb.com/forums/post832231-23.html[/url] Take a look and see if it clears up any confusion. I know this doesn't answer your question, but I figured it might help you create a better login system.

Member Avatar for somedude3488
0
751
Member Avatar for san_cash

You most likely have a problem with your query. Replace: [code] $result = mysql_query($query); [/code] with [code] $result = mysql_query($query) or die(mysql_error()); [/code] This will show the error.

Member Avatar for san_cash
0
162
Member Avatar for justted

Putting the files outside the public folder is the right thing to do. Yes, you have to put the php.ini file in the directory, thats the only way it will work. You will need to put an .htaccess file in there too so it will disallow viewing of the php.ini …

Member Avatar for justted
0
155
Member Avatar for 3DProf4online

Since you seem to have things figured out for the most part this may not be of use to you. I needed a good email class for my projects, so I made one. Its attached. All you have to do to add uploaded attachments, is use a form with input …

Member Avatar for AyuBan
0
1K
Member Avatar for Merlin33069

You made a huge security risk for yourself. Including pages based on $_POST data without proper validation can lead to serious security risks. I can include files from other servers and get sensitive information. I have been using this kind of method for awhile, a little more complex but the …

Member Avatar for Merlin33069
0
444
Member Avatar for rouse

Is there set directories for uploading, or will folders be added/deleted ect?

Member Avatar for diafol
0
93
Member Avatar for itisnot_me

That would be a waste of time really. Its easier to use arrays and dynamic variables. You can do: [code] foreach( $_POST as $key => $val ) { ${$key} = mysql_real_escape_string( htmlentities( $val ) ); } [/code] that will put all the post data into usable variables.

Member Avatar for itisnot_me
0
75
Member Avatar for ticallian

I would put them into functions, since you are probably going to be using this code often. [code] <?php session_start(); function addProductToSession( $id,$code,$name ) { $recView =& $_SESSION['recently_viewed']; if ( count( $recView ) == 5 ) { array_shift( $recView ); } $recView[] = array( $id,$code,$name ); } function getRecentlyViewedProducts() { …

Member Avatar for ticallian
0
196
Member Avatar for cloudedvision

[QUOTE=cwarn23;857505]Isn't that code meant to be the following: [CODE=php]$this->$error->trigger('noRoute','URL Has No Matching Route',array('URL'=>$url),'404');[/CODE] The code above will only work if $error is a method of $this and trigger() is a method of $error. Also you forgot a dollar sign for the middle variable.[/QUOTE] Why does he need a dollar sign? …

Member Avatar for cwarn23
0
116

The End.