Fadion
-
Posts
1,710 -
Joined
-
Last visited
Posts posted by Fadion
-
-
Poisano ure still not too clear. Are those links going to be like:
<textarea cols="100" rows="10" name="url1"></textarea> <textarea cols="100" rows="10" name="url2"></textarea> <textarea cols="100" rows="10" name="url3"></textarea>
and u need a code which parses those urls?
-
change it to:
if(isset($_GET['activelocation'])){
-
Write both the errors u get and which lines they belong to. For the second error be sure u have the right name for the $_GET['activelocation'].
-
With dreamweaver make sure u have the coding toolbar showed, by going to View >> Toolbars >> Coding. Select the code (normaly in code view ) and click the third icon on that toolbar which is Collapse Selection . To expand it again double click.
-
edit: sorry double posted
-
i forgot the '{'
if($_GET['activelocation']){
-
make smth like:
if($_GET['activelocation']) $activelocation = $_GET['activelocation']; setcookie('location', $activelocation, time()+60*60*24*30); } elseif(isset($_COOKIE['location'])){ $activelocation = $_COOKIE['location']; //if the cookie is set, get the value } else{ setcookie('location', 'New York, NY', time()+60*60*24*30); }
So u make progressive checking. If the user has changed the location then set the cookie. If not the first then check if the cookie exists to set the location. If not any of both set the cookie to its default value.
-
I usually use:
$file = 'file.doc'; $ext = strtolower(substr(strrchr($file, '.'), 1));
It is basically play_ and Crow's techniques merged togather lol. In this way i get a 'doc' extension without the dot.
-
Then u should make this topic solved.
-
Normaly it should add a '/' when u have a ' (single quote) and thats because u have magic_quotes_gpc on or u are just using addslashes to GET, POST variables. That breakes the possibility of injections. The advise is to turn off magic_quotes_gpc and escape the data manually.
-
when u click a tutorial u mess the breadcrumb maybe cos u loose the the url variable 'category' which is used in the query. Just guessing anyway. Also dont forget to clean your input data, as with your current code, one can inject code as much as he likes.
$category = mysql_real_escape_string($_GET['category']); $result = mysql_query("SELECT * FROM cats WHERE name='$category'");
-
dont know of any print_l() but sure i know about print_r() which u can use to print array values. What i think is that $game is a config variable and to it are assigned site values like:
$game['siteName'] = 'Game Site'; $game['siteDesc'] = 'A very good site';
Dont know how the script works but im sure it gets the page title from a database field. Look at the database to find a column 'title' or smth and then look at the code to find where that column is echoed.
-
Guess it wont be that easy, as they got different db user fields and different cookie and sessions handling. Anyway i guess that with a bit of working around and studying the code u could do it
-
Yep as u said u can use cookies.
if(isset($_COOKIE['location'])){ $location = $_COOKIE['location']; //if the cookie is set, get the value } else{ setcookie('location', 'new york', time()+60*60*24*30); //set the cookie to the default value and //make it expire after aprox. 1 month }
-
The code of the first part looks good, except if(mysql_num_rows($result)!= "") that will always be true. mysql_num_rows returns 0,1,2 etc not an empty value. Anyway thats not your problem. If the link to the subforum takes the correct id then im guessing that your problem is in view_active.php which we are not able to see as its included. Basically u need to get the id from url and make a query of all the sub forums that have that parent id.
-
do u have session_start() for the last code u posted?
-
A cookie with the same name but different values for different folder? I guess no. Im sure u can find a way around using two different cookies then just stress yourself making things complicated.
-
Im not reviewing your code as im pretty sure uve not written it completely by yourself. If so correct me pls. Instead ill give u a working code which i just wrote and tested. It will let the user browse for a file, verify the file, upload it and make a sql query.
The form
<form enctype="multipart/form-data" name="uploadform" method="post" action=""> <input name="picupload" type="file" /> <input type="submit" name="Submit" value="submit" /> </form>
The php code
<?php if($_FILES['picupload']['name'] != ""){ $path = "pics/" . basename($_FILES['picupload']['name']); $ext = strtolower(substr(strrchr($_FILES['picupload']['name'], '.'), 1)); $allowedExt = array('jpg', 'png', 'gif', 'bmp'); if(in_array($ext, $allowedExt)){ if(move_uploaded_file($_FILES['picupload']['tmp_name'], $path)){ $query = mysql_query("INSERT INTO table (path) VALUES('$path')"); echo "The file was uploaded successfully."; } else{ echo "There was an error uploading the file. Please try again later."; } } else{ echo "The format is not supported."; } } ?>
U have just to modify the path and sql query to your needs. Another thing is the require_once() thing. Sure u can include a file with absolute path, but it will give u problems after uploading in a web server as u dont have the same directory structure. Use smth like include('includes/connections/test.php'). Hope this helps.
-
lol. What i was saying is that u cant use $i+2 to increment $i by 2. U must use $i=$i+2 or simply $i += 2. At least at my side it is entering an endless loop. The other thing is that teng84 wrote a for loop without incrementing $i. But guess these arent important in an example code.
-
Thought u needed it that way. In this case the code provided by hitman6003 is your case. Probably they crashed cos in the first it is '$i + 2' and not '$i += 2' and in the second the $i is not incremented. Anyway this code should do it:
for($i=0; $i<count($id); $i += 2){ echo $id[$i] . ' - ' . $id[$i+1] . '<br />'; }
-
I tried the whole code at localhost and its working correctly. Logically theres no error at all.
-
Why are people so fascinated with a GD thumbnail? You can use an html image tag to do the same task.
Probably because with GD one can resize and resample the thumbnail to mantain image quality and to lower a lot filesize. With your example u have a thumbnail with crisp edges and of the same filesize of the fullsize image.
-
$text = 'This is a string'; echo substr($text, 0, 4);
substr(string, int start, int length).
-
foreach($id as $value){ echo $value . " - " .next($id) . "<br />"; }
socializing script
in PHP Coding Help
Posted
Dont know any free or open source. But as cooldude said u may try one by yourself. Sure there are a lot of things to do in a social networking script but u can learn a lot in the meanwhile