![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
mga_ka_php
-
Posts
134 -
Joined
Posts posted by mga_ka_php
-
-
created a website which it can compress and uncompress files such as zip, tar and tgz.
the problem is. when i compress files it will save in the server if after the script i will delete the files, users cannot download the files.how do i make the delete the files after a period of time?
-
i need to know this, anyone?
-
got the idea. thanks.
-
i've seen in wordpress, the anchor of post title something like this http://www.yourdomain.com/test-me-again
my question is if
<a href="http://www.yourdomain.com/test-me-again" />Test Me Again</a>
how do you use the $_GET[]?
$_GET["?"] = what is the name?
-
use regex
-
1stly you have to create a form:
<form action="" method="POST"> <input type="text" name="name"> <input type="text" name="age"> <input type="text" name="hobbies"> </form>
Then in PHP:
Connect to mysql and db... //insert into table $sql="insert into personal(name,age)values('$_POST['name']','$_POST['age']')"; $query=mysql_query($sql) or die(mysql_error()); //write the rest for other tables.....
This is just a basic idea, try to build it for your need.
additional to this, if your going to use the id of first sql query,
$sql="insert into personal(name,age)values('$_POST['name']','$_POST['age']')"; $query=mysql_query($sql) or die(mysql_error()); $last_id=mysql_insert_id(); $sql="insert into hobbies(hobbies,personal_id)values('$_POST['hobbies']','$last_id')"; $query=mysql_query($sql) or die(mysql_error());
-
$myname = $_POST["myname"]; $mymail = $_POST["mymail"]; $msubj = $_POST["msubj"]; $mbody = $_POST["mbody"]; $mcompany= $_POST["mcompany"]; // INSERT THIS $mphone= $_POST["mphone"]; // INSERT THIS ////////////////////////////////////////////////////////////////////////////////////// $fpmanager = popen("/usr/sbin/sendmail dmcnzl@gmail.com","w"); fputs($fpmanager,"Content-Type: text/html; charset=iso-8859-1\n"); fputs($fpmanager,"From: ". $mymail ."\n"); fputs($fpmanager,"Subject: Website Enquiry > $msubj"); ////////////////////////////////////////////////////////////////////////////////////// fputs($fpmanager,"\n\nMessage Subject > $msubj\n\n"); fputs($fpmanager,"Message Content > \n"); fputs($fpmanager,"$mcompany\n\n"); // INSERT THIS fputs($fpmanager,"$mphone\n\n"); // INSERT THIS fputs($fpmanager,"$mbody\n\n"); fputs($fpmanager,"\n\nMessage From > $myname ($mymail) \n\n"); fputs($fpmanager,"User IP Address > ". $_SERVER['REMOTE_ADDR'] ."\n");
-
$name=stripslashes($_POST['name']); $email=stripslashes($_POST['email']); $company=stripslashes($_POST['company']); $phone=stripslashes($_POST['phone']); $subject=stripslashes($_POST['subject']); //Let's start our headers $header="MIME-Version: 1.0\n"; $header.="Content-type: text/html\n"; $header.="From: Free Form Blister Pack Customer: $name<$email>"; $message="<table width='100%' cellpadding='0' cellspacing='0' border='0'>"; $message.="<tr><td>Name</td><td>$name</td></tr>"; $message.="<tr><td>Email</td><td>$email</td></tr>"; $message.="<tr><td>Company</td><td>$company</td></tr>"; $message.="<tr><td>Phone</td><td>$phone</td></tr>"; $message.="<tr><td>Subject</td><td>$subject</td></tr>"; $message.="</table><br /><br />"; // send the message mail("email address","Contact Form",$message,$headers);
-
This is correct. cause i use this.
$SelectThis = mysql_query("SELECT * FROM Table_Name WHERE PostID = '" . $_GET['PostID'] . "'", $Connection);
-
substr("your string", 0, 25);
-
while($a = mysql_fetch_object($result)) { $images[] = array("img " => $a->table_image, "title" => $a->table_title, "imgId" => $a->table_id);
-
debug your if statement in your function checkLogin
if your $access value is change to true.
-
-
you could also try notepad++
-
wow thanks.
-
got a problem like that before, but mine was limited only to view 3x4 per page. so what i did was i used css left and top for positioning it into every column and row.
if someone has a better solution please post.it can help me too.
-
is your id dynamic?
mysql_insert_id();
-
use mysql_insert_id.
like this
$album = clean_full($_POST['album']);
$artistid = $_POST['artist'];
$year = (int)($_POST['year']);
$review = clean_body($_POST['review']);
$user_id = $_SESSION['user_id'];
$query = "INSERT
INTO albums
SET
id = '', // This id will auto-increment in the database but I need to get the number it is assigned
artist_id = '$artistid',
title = '$album',
year = '$year',
user_id = '$user_id',
created_at = NOW()
";
$result = mysql_query($query);
$prev_id=mysql_insert_id();
$query1 = "INSERT
INTO reviews
SET
id = '',
artist_id = '$artistid',
album_id = $prev_id // I need to get the id from the previous insert and place it here
body = '$review',
user_id = '$user_id',
created_at = NOW()
";
mysql_insert_id() = get the id from the previous sql statement
-
can you show the output you want to achieve?
-
select concat(column1,column2) as column3 from table1 where column3 like '%$str%' ???????
coz i want to search in a concatenated column, how do i do that?
-
would like to know what does this symbol do " -> "?
is it different from " => "?
-
how do you explode string with two conditions, space and newline?
i use strtok but i could only use 1 condition
i cannot use the 2 condition space and newline
i want to explode a string with if a string has a space and newline?
how do i do that?
thanks in advance.
-
how do i input textarea value to mysql database that will preserve the format?
ex.
if i input a text in textarea
----------------------------------
line one
line two
----------------------------------
and transfer it to mysql database and retreive it
the text will look like this
----------------------------------------------------
line one line two
----------------------------------------------------
it will not put it to the next line.
thank you.
-
i used this script but it doesn't work?
First off, you need to be adjusting your action to reflect the page you're wanting to submit to. Try something like this:
<script type="text/javascript"> var myForm = document.forms[0]; function submitAdd() { myForm.action = "users.php?do=add"; myForm.submit(); } function submitEdit() { myForm.action = "users.php?do=edit"; myForm.submit(); } </script> <a href="#" onclick="return submitAdd();">new</a> <a href="#" onclick="return submitEdit();">edit</a>
Also, I'm moving this to the javascript forum since it has nothing to do with PHP
how to install rar
in PHP Coding Help
Posted
what do i need to be able to compress and uncompress files with RAR in website? do you know a script? tnx.