ober
Staff Alumni-
Posts
5,327 -
Joined
-
Last visited
Everything posted by ober
-
Once the script executes on server 2, can you do a header redirect back to server 1 with the variables in the URL?
-
You will need to have access to the 404 handler provided by your server. Normally this is like 404.shtml or something similar. You will have to overwrite this file with whatever comments your users need to see. You should be able to catch the URL and then redirect or whatever you need to do.
-
Here's an idea... you PM me with a reason why this isn't a spam mechanism and I'll re-open it and try to answer the question.
-
Need some help on what system to use on my site
ober replied to Street-Car's topic in Website Critique
I'm impressed with the header graphic work... some of the best I've seen on car sites. I'm also impressed with the integration with VBulletin... great work. But I definately agree... you need to move all that great info out of the forums and onto the main page. I don't know what would be the best "system" to use... are you just looking for a decent CMS? I suppose PostNuke would probably be a fair bet, but I've never used it. I'd think a home-grown version might do best for you, however. -
Looks like someone doesn't have PHP installed or working correctly. Clicking on the links tries to make me download "page1.php".
-
Add single quotes around $sku.
-
If you want to set a limit on the number to use before it goes to the next line, you'll have to include a counter and then close the <tr> and then reopen one. [code]<table> <? include "connect.php"; $result = mysql_query("SELECT * FROM affiliates ORDER BY id"); $rowcount = 0; while($row = mysql_fetch_row($result)) { if($rowcount == 0) echo "<tr>"; // start row $id = $row[0]; $countout = $row[1]; $countin = $row[2]; $ws_name = $row[3]; $ws_link = $row[4]; $ws_button = $row[5]; ?> <td> <div align="center"><a href="afiliado.php?outid=<?php echo $id; ?>" target="_blank"> <img src="<?php echo $ws_button; ?>" width=88 height=31 alt="<?php echo $ws_name; ?>" border="0"></a> <br> <span class='style20 Estilo3'>Entraron:</span> <?php echo "<span class='style20 Estilo3'> $countin </span>";?> | <span class='style20 Estilo3'>Salieron:</span> <?php echo "<span class='style20 Estilo3'> $countout </span>";?></div> <td> if(++$rowcount == 3) // increment and compare to max row count { echo "</tr>"; // close row $rowcount = 0; // reset counter } <? } if($rowcount < 3) echo "</tr>"; // just to have valid code ?> </table>[/code] I hope that makes sense.
-
It should look like this: [code]<?php $to = 'myemail@whatever.com'; $subject = 'Test'; $name = $_POST['StartMonth'] . $_POST['StartYear']; $message = $name; $headers = 'From: website@whatever.com' . "\r\n"; mail($to, $subject, $message, $headers); ?>[/code] POST must be in caps and you can't grab 2 variables at a time.
-
You're setting a normal variable and echoing a session variable. Replace it with the following. [code]<?php echo $kt_login_user ?> <p> </p> <?php $sql = "SELECT 'welcome' FROM 'users' WHERE 'username' = '$kt_login_user'"; $qry = mysql_query($sql); if(@mysql_num_rows($qry) > 0) { $r = mysql_fetch_array($qry); $kt_welcome = $r['welcome']; } else { $kt_welcome = "My default text"; } ?> <textarea name="welcome" cols="80" rows="20"><?php echo $kt_welcome; ?></textarea> <?php mysql_close(); ?> [/code]
-
Ok... a few more things I noticed. 1) You're setting this: $kt_welcome; You're echoing this: echo $_SESSION['kt_welcome']; Those are not the same. 2) You don't need a while loop: while($r = mysql_fetch_array($qry)) { $kt_welcome = $r['welcome']; } becomes: $r = mysql_fetch_array($qry); $kt_welcome = $r['welcome'];
-
Simple Script to Process Form Data and export to CSV
ober replied to ovidx's topic in PHP Coding Help
The first part you'll have to write yourself... but here's an example of a way to write out a CSV formatted file... some modifications will have to be made. This works with a MSSQL database and spits out the column names and then the data.[code] $ehandle2 = new sql_handler(1, "", "queryoutput.php"); $exitcode = 0; //echo "<br/>" . stripslashes($query) . "<br/>"; $result = $ehandle2->update_query(stripslashes($query)); if(!$result) $exitcode++; if($exitcode == 0) { //C:\Inetpub\wwwroot\Query\temp $filelink = "./temp/qry" . date("HismdY") . ".txt"; $filename = "C:\\Inetpub\\wwwroot\\Query2\\temp\qry" . date("HismdY") . ".txt"; if (!$handle = fopen($filename, "wb")) { echo "Cannot open file " . $filename; exit(); } $printcolnames = 1; while($row = mssql_fetch_array($result)) { $rowval = ""; // ============ print column names ==================== if($printcolnames == 1) { $rowname = ""; for($i=0;$i<mssql_num_fields($result);$i++) $rowname .= mssql_field_name($result, $i) . "\t"; $rowname = substr($rowname,0,-1) . "\n"; if (!fwrite($handle, $rowname)) { echo "Cannot write to file $filename"; exit; } $printcolnames = 0; } // ========= end print column names =================== // ========= print col values ======================== for($i=0;$i<mssql_num_fields($result);$i++) $rowval .= $row[$i] . "\t"; $rowval = substr($rowval,0,-1) . "\n"; if (!fwrite($handle, $rowval)) { echo "Cannot write to file $filename"; exit; } // ========= end print col values =================== } fclose($handle); echo "<br/><br/><p class=pheader2>Your results can be found here: *</p><br/> - <a href=\"" . $filelink . "\" target=\"_blank\">Tab Delimited Results File</a> <span class=chatter>(right-click -> \"Save Target As ...\" to save to local PC, then open with Excel)</span>";[/code] -
You actually need a semi-colon after the $headers line.
-
You're not displaying any message ... it's probably sending the mail, but you don't have a success message or anything.
-
What is the method of the form? GET or POST? The variables will be passed to the processing script as $_GET['name'] or $_POST['name']. GET passes them in the URL... POST passes them without showing them in the URL.
-
Putting a div around a line of data will put each on a seperate line, creating a column. You can open the div before the loop and close it after the loop is done to center the data.
-
I would also suggest putting quotes around $kt_login_user in this statement: SELECT 'welcome' FROM `users` WHERE `id` = '$kt_login_user' Failing those changes, I'd suggest verifying that the query is executing correctly and you have something other than the Default text in the database.
-
I don't understand how chmodding would be an issue for you at all. You wouldn't have to do it manually... you can use PHP to chmod the files after they're uploaded. And I have to disagree with your statement that "the behavior of permissions is not stable".
-
That's exactly right... just make the message contain the variables. Take a shot at it and let us know what you get. You may also want to set the return value of the mail function to a variable so you can test to see if it succeeded or not.
-
Change: $r[1]; To: $r[0]; You're only selecting one field from the database and the fetch_array function starts the array at 0.
-
login two types of members to a correct page please help.
ober replied to redarrow's topic in PHP Coding Help
Alright... a few issues: 1) you don't have to use session_register(). Just use $_SESSION['var_name'] = x; 2) }else if( ! $name|| $password) won't work. $name and $password are not boolean variables. And I assume you want to fail that if when $password is blank as well.... right now it passes if $password is true. And you never compare the database results to what is passed from the form. How do you think authentication works!?!? -
XP Home will work fine. You could try the tutorials here.
-
I suggest you post this question over there. Your login here and there are the same.
-
Switch hosts?
-
[a href=\"http://www.grisoft.com/doc/SmallAndMedium/lng/us/tpl/tpl01\" target=\"_blank\"]http://www.grisoft.com/doc/SmallAndMedium/lng/us/tpl/tpl01[/a] AVG is the way to go, IMO. I wouldn't trust McAfee any farther than I could throw them and Symantec has been ok here where I work, but I honestly feel like Grisoft makes a better product and will cost you less in the long run.
-
You can download and install PHP and Apache on your computer to test your scripts and you can use a text editor or something like PHP Developer 2005 or 2006 to develop the code. But yes, you'll need a host that has PHP on it to run PHP scripts.