wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Using $_SERVER["HTTP_REFERER"] in a link
wildteen88 replied to bob_the _builder's topic in PHP Coding Help
I didnt say go away, just post your code over at pastebin.com then provbide the link to the code you pasted over at pastebin.com. Also read your thread you posted earlier [url=http://www.phpfreaks.com/forums/index.php/topic,106564.0.html]here[/url] -
Using $_SERVER["HTTP_REFERER"] in a link
wildteen88 replied to bob_the _builder's topic in PHP Coding Help
lounger for now post your code over at http://www.pastebin.com Also are you asking bob_the _builder for help, or are you in some way trying to help bob_the _builder? If you are asking for help then post in your own topic. Dont [i]hijack[/i] other peoples threads. -
I am going to move this to the javascript help forum as this has nothing to do with PHP.
-
PHP cannot resized the browser. PHP cannot do anything to the clients browser window like javascript can. You open a new window with normal html when you click a link. Use [b]target="_blank"[/b] in your anchor tag, eg: [code]<a href="http://google" target="_blank">Google</a>[/code] What you are aksing is not possible with PHP AFAIK. The only option is javascript if you want to resize the browser window, create a popup etc.
-
The only thing I can see that caues the IPS to be activated is the script tag. Would be nice if phpfreak could provide a list of what gets blocked,.
-
Also if you have script tags then add a space around the word script eg: [code]< script >your script code</ script >[/code] Also ober that thread doesnt count any more as you can post any php function ina post. Its only a few things that causes the cannot post error
-
How to use rewrite a rule containing other characters [RESOLVED]
wildteen88 replied to AdRock's topic in Apache HTTP Server
Yes, \- means - When you want to allow hyphens in rewrite rule you'll have to escape them (\-) as a hyphen to mod_rewrite has special meaning so you have to escape it. This: [a-zA-Z0-9\-_] Allows alphanumeric characters, a hyphen (-) and an underscore (_) -
PHP cannot create popup windows. If you want to create a popup window you'll have to use javascript
-
Using $_SERVER["HTTP_REFERER"] in a link
wildteen88 replied to bob_the _builder's topic in PHP Coding Help
Try this: [code=php:0]$referer = urlencode($_SERVER["HTTP_REFERER"]. '?' .$_SERVER['QUERY_STRING']); echo '<a href="index.php?action=delete&subcat_id=' . $_GET['subcat_id'] . '&confirm=y&referer=' . $referer . '">Yes</a>';[/code] When you retrieve the referer you'll need to urldecode($_GET['referer']) -
How to use rewrite a rule containing other characters [RESOLVED]
wildteen88 replied to AdRock's topic in Apache HTTP Server
You'll want to use this: [code]RewriteRule ^([a-zA-Z0-9\-_]+)$ index.php?page=$1[/code] as the rewrite rule, it also allows underscores to -
PHP can work with lots of SQL databases, MSQL, MS SQL, MySQL, PostgreSQL etc. Go to http://php.net/mssql for more info. For a list of the mssql functions scroll down to the Table of Contents heading when you click the link above
-
Using $_SERVER["HTTP_REFERER"] in a link
wildteen88 replied to bob_the _builder's topic in PHP Coding Help
Uus $_SERVER['QUERY_STRING'] to get the query string from the url, the bit after the question mark $url = $_GET['REFERER'] . '?' . $_SERVER['QUERY_STRING']; -
Java popup scripts not working in my with my php. Help!
wildteen88 replied to zachishi's topic in PHP Coding Help
How are you putting the javascript in. When you put the javascript in use Heredoc syntax, or make sure you are escaping your quotes. Using HEREDOC saves you from escaping your quotes: eg: [code=php:0]echo <<<JSCRIPT -- your javascript code here -- JSCRIPT; // DO NOT INDENT ABOVE LINE OR PUT ANYTHING ELSE ON IT, As it'll result in a fatal error.[/code] Also when ever you are ouputting anything to the browser make sure you put in an echo statement. -
Have a read of the [url=http://www.phpfreaks.com/forums/index.php/topic,95867.0.html]What does -> & => do?[/url] thread in the FAQ forum. Just read the bit under [b]The -> Operator[/b] heading, dont read the bit under the [b]The => Operator[/b]
-
well by default mysql will install a defualt user, which is root with no password. I am not experienced with installing apps in linux so I cant help you there. If are using ubuntu prehaps have a read of [url=https://help.ubuntu.com/community/ApacheMySQLPHP]this guide[/url] over at help.ubuntu.org for installing Apache Mysql and PHP on Ubuntu
-
Java popup scripts not working in my with my php. Help!
wildteen88 replied to zachishi's topic in PHP Coding Help
I see no javascript code in the code provided that atempts to create a popup. Or do you mean you want a new browser window/tab to appear when the user click the link? If so use [b]_blank[/b] in the target attribute in your links. So use this: [code]$output='<a href="view-property.php?id='.$id.'" target="_blank">'.$prop_image.'</a><br>[/code] -
Well it depends on what the type of data the fields will hold. Say you are doing a questbook. You ahve three fields Name, Email and Website. You obvisouly want to store the posters name and email address in the database so you make those fields not null. However for the webpage field you'll make that field NULL. As not everyone may have a website. Thats one example of use of setting a row to null. Null means whether the field can have a null value, meaning you are able to store nothing in that field. not null doesnt allow to store nothing in the field. So basically use NULL on a field when a field is not required to have a value when inserting data in to the database.
-
Yes just type it as normal. But if use double quotes in your html make sure you add a slash infront of them, eg: [code=php:0]$result = mssql_query('blah ...') or die("<span style=\"color: red; font-wight: bold\">There appears to be an internal error. Please come back later</span>");[/code]
-
You are using variables in single quotes. Variables will not be parsed if they are using in single quotes. So use double quotes: [code=php:0]$sql = "SELECT COUNT(*) FROM `survey` WHERE `6` = CONVERT( _utf8 'yes' USING latin1 ) COLLATE latin1_swedish_ci AND stage = '$life' AND date_submitted BETWEEN '$from_date' AND '$to_date'"; $query1 = mysql_query($sql); $yes = mysql_result($query1, ROW_NUMBER_HERE);[/code] Also the mysql_result function requires two parameters, one for the query result ($query1) and the other the row number
-
Thats your problem you get something to do something for you, and then you try do something, but you cant. You should learn to code PHP yourself rather than get DW to do it for you. Dreamweaver isnt a good editor to develope PHP scripts with. But anyway lets crackon. Whats the code you are using to query the database. You can use $_SESSION['MM_Username'] in the WHERE clauase of you query, For example: [code=php:0]$sql = "SELECT firstname, lastname FROM user_table WHERE firstname='" . $_SESSION['MM_Username'] . "'";[/code] Noter: Change where it says user_table to the correct table name which holds the firstnames and lastnames. Now use the following to perform the query: [code=php:0]$sql = "SELECT firstname, lastname FROM user_table WHERE firstname='" . $_SESSION['MM_Username'] . "'"; $sql_result = mysql_query($sql) or die("unable to perform the query due to an internal error: " . mysql_error()); // check that the query returned 1 result, if it did it found a match if(mysql_num_rows($sql_result) == 1) { // retrieve the first name and lastname from result $row = mysql_fetch_assoc($sql_result); // display first name and last name: echo "Welcome <b>" . $row['firstname'] . ' ' . $row['lastname'] . "</b>,"; }[/code] Thats it!
-
How to pass hidden variables when using header(location:...)?
wildteen88 replied to Bbliksted's topic in PHP Coding Help
if you dont ant to pass the variables in the url use a session or a cookie. -
Cannot modify header information - zenphoto include
wildteen88 replied to n9ne's topic in PHP Coding Help
Okay, that is a little strange. How is test2.php included in the page? Is it included before line 9 in index.php? What happens if you comment out line 9 in index.php. Line 9 is this: [code]header ('Content-Type: text/html; charset=' . zp_conf('charset'));[/code] Comment that out by adding // infront of it: [code]// header ('Content-Type: text/html; charset=' . zp_conf('charset'));[/code] -
This: if (!dbconn Should be: if (![b][color=red]$[/color][/b]dbconn
-
From just browsing your code. You dont close you if statements in the create_account function, you start the if then you dont close it anywhere. For example this is the first if statment in the create_account function: [code]if(empty($fname)) { error_message("Please Enter Your First Name");[/code] Notice you havn't closed the if statment, you have left out the closing curly brace - } - after you call the error_message function. That first if should be like this: [code]if(empty($fname)) { error_message("Please Enter Your First Name"); } // close the if statment[/code] If you close all if statments that should solve the error
-
Cannot modify header information - zenphoto include
wildteen88 replied to n9ne's topic in PHP Coding Help
Is that the output of test2.php or is that whats actually coded in test2.php? If its not, post the source code of test2.php here and not the output. As that matches the output of the code when I go to the link you posted. I need to see more code to understand whats going on. Attach test2.php and index.php here. (Click Reply button > Additional Options... link > click Browse button, to attach files to post)