wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
looking at your code. Your have not created the following variables when the form has been submitted: $video or $link So the cookie will not be set. What you'll want to do is add the following code: [code=php:0] $video = $_POST['video']; $link = $_POST['video'];[/code] After: [code=php:0]if (isset($_POST['submit'])) {[/code] Now your script should work correctly.
-
There is more too it. However I have just shown you the basics. However you should follow that tutorial through though.
-
Do you have a form field/button with the name as submit? If you don't then the if statement will return false and no cookie will get set. Post the code with your HTML here.
-
You can create a cookie with php using the [url=http://php.net/setcookie]setcookie[/url] function Here is the basics of the function: setcookie(name, value, expirey_time); The name is the the name of your cookie, the value is what your cookie holds and the expire_time is when your cookie expires in seconds. So if you want to create a remember me cookie then you'd set it using this: [code]setcookie('remeberMe', $user_var, time()+3600*24*365[/code] What that will do is create a cookie called rememberMe which holds the value of the $user_var variable and it will expire a year from now. To access the cookie you'll use the $_COOKIE superglobal variable. Example: $_COOKIE['cookie_name_here'] So to access your remeberMe cookie you'd use $_COOKIE['remeberMe'] Note when you use the setcookie function make sure there is no output before you use this function, otherwise you may get a header already sent error message/blank screen.
-
You'll want to use auto margins. Before using auto margins make sure you have a valid Doctype (XHTML Transitional DTD should be fine) and your div you wish to centre has a width set. To center the div add this to your CSS for the div you wish to center: [code]margin: 0 auto;[/code] Also when positioning your divs dont use absolute/relative positioning instead use floats.
-
The way you have your code set up it will always create the TubeProgsVideo cookie which holds the value of "akkksssssssss" whether the first cookie is set or not.
-
The query I gave wouldn't of returned anything. Try this in your query: SELECT *, COUNT(referer_col) AS refTotal FROM referer_tbl GROUP BY referer_col LIMIT 0, 5 Again change referer_col and referer_tbl to the correct values. Now in your while loop just add this: [code=php:0]echo "<pre>" . print_r($row) . "</pre>";[/code] Post here what it returns.
-
My Apache Server is not running on IP address
wildteen88 replied to terra's topic in Apache HTTP Server
You'll want to use http://localhost:8080 as your have set up the virtual host on port 8080 http://localhost/ will call port 80 -
Please do not double post threads in different forums. Thread closed.
-
[resolved] Executing Scripts Without Include() Function
wildteen88 replied to glenelkins's topic in PHP Coding Help
Take the echo statement out side of the while loop then. Everytime the while loop loops its going to echo the $content variable each time. If you stick it out side of the while loop it'll echo the $content variable when its finished looping the while loop. -
The referrer gets passed by the web browser. So if you click a link here that goes to you web site then the browser will log this site as the referrer. The browser wont log this site as the referrer if you type in your websites address in the address bar. As you have not been "referred"
-
Help with adding text after a variable please
wildteen88 replied to Chappers's topic in PHP Coding Help
You keep putting a space after your variable name in the echo statement. So you are always going to get the space. What you'll want to do is to come out of the echo by adding a double quote before your variable ($url) and then a period (.) now add another period at the end of your variable name and another double quote. So your echo statement should be like this: [code=php:0]echo "<link rel='stylesheet' href='" . $url . "css/styles.css' type='text/css'>";[/code] Or you can just ad curly braces around your variable: [code=php:0]echo "<link rel='stylesheet' href='{$url}css/styles.css' type='text/css'>";[/code] -
Its not a PHP error by a MySQL error. One of you queries has an error which MySQL has reported. From looking at your code the error is coming from this query: [code]$SearchResult=mysql_query("SELECT * FROM Hyd_Contacts" . ($page-1)*$pagenum . ",$pagenum") or die(mysql_error());[/code] Change the above query to this: [code=php:0]$SearchQuery = "SELECT * FROM Hyd_Contacts" . ($page-1)*$pagenum . ", $pagenum)"; $SearchResult = mysql_query($SearchQuery) or die("Unable to perform query<br />\n" . $SearchQuery . "<br /><br />" . mysql_error());[/code] Now re run your script again. Post the full error message it returns here.
-
If you are getting this error then there is either a problem with your SQL query or the $iQuery variable does not exists or is mistyped. Could you post the part of the code where you create the $iQuery variable.
-
What si you database scheme? Could you post it here.From form what I can tell from your post you'll want to use Count function and use the GROUP BY clause in your query, example: [code]SELECT COUNT(referal_col) FROM your_tbl GROUP BY referal_col[/code] You'll want to change referal_col and your_tbl to the correct values. referal_col is the column that holds the referals and your_tbl is the table that holds the referals.
-
You should use mysql_close() when you use a persistent connection when connecting to the MySQL server. You make a persistent connection using the mysql_pconnect() function. However if you used mysql_connect to connect to your MySQL database then you don't need to use mysql_close to close the connection as it will close the connection automatically when PHP finishes parsing the script.
-
PHP 4.4.4 MSSQL setup guide please
wildteen88 replied to mattywhi's topic in PHP Installation and Configuration
What you do you mean the --with bits? if you are compiling PHP for windows then no need. Just uncomment the php_mssql.dll exention and restart Apache. the MSSQL extension should now be loaded. -
You will need to to use the concatenation operator (.): [code]echo "Welcome back " . $log->GetUserName();[/code]
-
PHP4 or 5.1.x is not supported by Apache2.2.x due to the change in the way Apache2.2 handles the modules. PHP5.1.2 is compatible with Apache2.2.x now. Not sure if there will be newer PHP4 release which will support Apache2.2.x. See if there is a PHP4 Apache Module (php4apache2.dll) over at apachelounge.com
-
Array, Web Forms, undefined index
wildteen88 replied to chuy08's topic in PHP Installation and Configuration
Duplicate thread. Please do not post duplicate threads in different forums. -
[quote author=lucerias link=topic=114110.msg464134#msg464134 date=1162887154] I am quite new to PHP, I saw many of PHP examples were coded like this, HTML is used for interface and structure design, PHP is used to process the input and then pass it to HTML and display the output. But can PHP do interface design without HTML help? I mean all the thing just do in PHP without HTML. If it is possible, then why do we follow the standard like that. Thank you. [/quote] No. PHP is a programming language and a web browser can not understand PHP. Browsers can only understand client side languages such as HTML, CSS, Javascript etc. PHP is used as you said to process user input/to make you site dynamic etc. If you use PHP you still need to use HTML in order for the browser to display your website when someone goes to it.
-
[quote author=Orio link=topic=114164.msg464396#msg464396 date=1162923964] Look at the ad next to your post. Orio. [/quote] I get a donation add! Orio the adds do rotate they do not stay the same. Anyway from what it looks like you'll want to use FCKEditor or TinyMCE they are both free WYSIWYG editors
-
You don't need Apache if you want to create a website. What you'll need to do in order to create a website is to learn HTML (and CSS). You can easily learn HTML and CSSover at w3scools.com and perhaps how to use a image editor such as Fireworks/GIMP/Photoshop to create images for your website. When you've created your website. Then you need to purchase web space from a webhost in order to get your site online.
-
Just adding space between '<' or '</' and 'script' will allow you to post your message. So you'd do this [code]< script > alert('foobar']); </ script >[/code]
-
Call to undefined function: start_session()
wildteen88 replied to Nicarlo's topic in Third Party Scripts
session_start is the correct function to start a session and always has been. There is no setting in the php.ini that can allow you to use start_session to start a session. However I think you have misread/misinterpreted what businessman said. What businessman said was perhaps your other servers had a setting a called [b]session.auto_start[/b] enabled which would start the session automatically without you explicitly telling PHP to start a session in your script. However if PHP cannot find a function when you call for it it will produce a fatal error. Fatal errors will stop the script from working so this cannot be the case.